QCM : Programming Language Paradigms — 11 questions

Questions et réponses du QCM

1. Which option best describes what a programming paradigm is?

A standardized set of compiler instructions for a CPU
A hardware architecture that determines how code runs
A fundamental style, mindset, or philosophical approach for structuring and organizing code
A specific tool or software framework such as Python or C++

A fundamental style, mindset, or philosophical approach for structuring and organizing code

Explication

A programming paradigm is the fundamental way of thinking about structuring and organizing code. A programming language is a tool, not a mindset.

2. What is a programming paradigm?

A fundamental style or philosophical approach for structuring and organizing computer code.
A specific programming language used for a particular task.
A hardware architecture that supports certain types of software.
A set of syntax rules that all programming languages must follow.

A fundamental style or philosophical approach for structuring and organizing computer code.

Explication

A programming paradigm is a fundamental style or philosophical approach for structuring and organizing code, not a specific language or hardware architecture.

3. Why is a statement like “Python is a functional programming language” potentially misleading?

Because paradigms can only be used in imperative programs
Because languages can only define syntax, not problem-solving approach
Because a programming language can support several paradigms, not just one
Because functional programming is the same thing as object-oriented programming

Because a programming language can support several paradigms, not just one

Explication

The language/paradigm distinction matters: many languages are multi-paradigm and can be used in multiple styles. This makes “is a functional language” an overclaim.

4. What is a programming paradigm primarily concerned with?

The hardware architecture on which programs run
The specific syntax and language features used in programming
The fundamental style or philosophical approach for organizing code
The performance optimization techniques for software

The fundamental style or philosophical approach for organizing code

Explication

A programming paradigm is a fundamental style or philosophical approach for structuring and organizing code, guiding how problems are solved and code is written, rather than focusing on syntax or hardware.

5. What is the best way to classify programming paradigms at the highest level?

They are split into static and dynamic branches based on variable types
They are split into compiled and interpreted branches based on runtime
They are split into imperative and declarative branches based on state and control flow
They are split into object-oriented and non-object-oriented branches based on data types

They are split into imperative and declarative branches based on state and control flow

Explication

At the primary level, paradigms divide into imperative and declarative based on how they handle state and control flow. The other choices group paradigms by implementation or typing rather than state/control flow.

6. What is the primary purpose of a programming paradigm?

To establish a fundamental style or approach for organizing code
To specify the hardware requirements for running code
To determine the performance characteristics of software
To define the syntax of a programming language

To establish a fundamental style or approach for organizing code

Explication

A programming paradigm is a fundamental style or philosophical approach for structuring and organizing code, guiding how problems are solved and how programs are written.

7. In the imperative paradigm, how does a program primarily express computation?

By defining a database query that returns matching records
By writing declarative logic rules that avoid all computation
By only stating the desired result without any execution details
By computing a solution step by step through explicit state manipulation

By computing a solution step by step through explicit state manipulation

Explication

Imperative programming emphasizes how to compute step by step by explicitly manipulating program state. Declarative styles focus more on what result is required rather than the steps.

8. When did the distinction between imperative and declarative programming paradigms become prominent in the history of computer science?

In the 1980s with the advent of object-oriented programming
In the 2000s with the emergence of functional programming
In the 1970s with the rise of structured programming
In the 1950s with the development of assembly language

In the 1970s with the rise of structured programming

Explication

The distinction became prominent in the 1970s with the rise of structured programming, which emphasized clear control flow and separation of concerns, differentiating it from earlier, more primitive approaches.

9. How do imperative and declarative programming paradigms primarily differ in their approach to controlling program execution?

Imperative paradigms use recursion and higher-order functions, while declarative paradigms rely on loops and explicit state changes.
Imperative paradigms specify what result is needed, while declarative paradigms detail how to achieve it.
Imperative paradigms focus on step-by-step instructions and mutable state, whereas declarative paradigms emphasize what the desired outcome is, often using immutable data.
Imperative paradigms are used only in low-level programming, whereas declarative paradigms are exclusive to high-level languages.

Imperative paradigms focus on step-by-step instructions and mutable state, whereas declarative paradigms emphasize what the desired outcome is, often using immutable data.

Explication

Imperative paradigms focus on how to perform tasks through explicit instructions and mutable state, while declarative paradigms specify what the result should be, often avoiding explicit control flow.

10. Who is credited with proposing the fundamental distinction between imperative and declarative programming paradigms based on how they handle state and control flow?

Alan Turing
Peter J. Landin
Edsger Dijkstra
John McCarthy

Peter J. Landin

Explication

Peter J. Landin is credited with formalizing the distinction between imperative and declarative paradigms, particularly emphasizing how they manage state and control flow.

11. What is a key consequence of using a declarative programming paradigm in terms of side effects?

It has no impact on side effects, which are determined by the language used.
It completely eliminates all side effects in programs.
It increases side effects to improve performance.
It minimizes or completely eliminates side effects, making functions more predictable.

It minimizes or completely eliminates side effects, making functions more predictable.

Explication

Declarative programming aims to minimize or eliminate side effects, which makes functions more predictable and easier to reason about. Unlike imperative programming, where side effects are common, declarative approaches focus on expressing results rather than steps.

Révisez avec les flashcards

Mémorisez les réponses avec 11 flashcards sur Programming Language Paradigms.

What is a programming paradigm?

A fundamental style or philosophy for structuring computer code.

Programming paradigm

A style or approach for organizing code.

What distinguishes a programming language from a programming paradigm?

A language is a tool, while a paradigm is the organizing philosophy.

Voir les flashcards →

Approfondir avec la fiche

Consultez la fiche de révision complète sur Programming Language Paradigms.

Voir la fiche →

Cours similaires

Crée tes propres QCM

Importe ton cours et l'IA génère des QCM avec corrections en 30 secondes.

Générateur de QCM