16 - Functional Programming Flashcards

(7 cards)

1
Q

What is a key feature of functional programming languages regarding data structures?

A

Data structures/variables are immutable, meaning the state/values cannot be changed after they are created.

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

What does it mean for functions in functional programming languages to be stateless?

A

Functions do not have side-effects; the output depends only on inputs and is not influenced by stored state.

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

What are higher-order functions in functional programming?

A

Functions that can take a function as an argument and/or return a function as a result.

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

What is an example of a higher-order function?

A

Map and fold.

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

How can the order of execution be determined in functional programming languages?

A

The order can be determined at run-time by the translator/compiler/interpreter.

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

True or False: In functional programming, the order of execution is defined by the program code.

A

False.

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

Fill in the blank: A higher-order function is a function that takes a _______ as an argument.

A

function.

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