General Programming Flashcards

1
Q

Name 5 programming paradigms

A

Imperative, Procedural, Functional, Declarative, Object-oriented

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

What paradigm consists of sets of detailed instructions given to the computer to execute in a given order?

A

Imperative Programming

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

What is Imperative Programming?

A

A paradigm which consists of sets of detailed instructions to be executed in a given order

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

What derivation of Imperative Programming adds functions to the mix?

A

Procedural Programming

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

What do “procedures” or “subroutines” consist of in Procedural Programming?

A

Functions

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

What programming paradigm treats functions as first-class citizens, meaning they can be assigned to variables, passed as arguments and returned from other functions?

A

Functional Programming

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

What do you call a function that always produces the same result given the same input?

A

Pure Function

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

What paradigm encourages to mostly write in functions?

A

Functional Programming

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

What paradigm encourages code modularity and the absence of side effects?

A

Functional Programming

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

What paradigm would advocate minimising global scope variables?

A

Functional Programming

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

What paradigm aims to hide away from complexity and be immediately human-readable?

A

Declarative Programming

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

What is Declarative Programming?

A

A paradigm that promotes human-readability and emphasises the result required, rather than the instructions.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

If Declarative Programming focuses on the “end”, what paradigm focuses on the “means”?

A

Imperative Programming

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
14
Q

What is Functional Programming?

A

A paradigm featuring pure functions, recursion and first-class functions

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
15
Q

What is Procedural Programming?

A

A type of Imperative Programming also known as top-down problem-solving

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
16
Q

What is OOP?

A

A paradigm which separates concerns which are coded as objects

17
Q

What style of programming features entities that all have their own properties and methods?

18
Q

What paradigm makes heavy use of classes?

19
Q

What is an instance in OOP?

A

An Object created from a Class

20
Q

What do you call an Object created from a Class in OOP?

21
Q

What 1994 book explores the capabilities and pitfalls of OOP?

A

Design Patterns

22
Q

What Creational Design Pattern ensures that a class has only one immutable instance?

A

Singleton Pattern

23
Q

What is a Singleton?

A

A design pattern than ensures a class has only one immutable instance

24
Q

What Pattern consists of an object that can’t be copied or modified?

A

Singleton Pattern

25
What Pattern might you see Object.freeze(Config)?
Singleton Pattern
26
What Creational Design Pattern restricts the instantiation of a class to a singular instance?
Singleton Pattern
27
What Creational Design Pattern provides an interface for creating objects that can be modified after creation?
Factory Method Pattern
28
What is the Factory Method Design Pattern?
A Creational Design Pattern which creates objects that can be modified after creation