Docsity

Functional Programming Practice Exam (Core Concepts, Higher Order Functions, Types, Monads, Exams of Advanced Education

Partial preview of the text

Download Functional Programming Practice Exam (Core Concepts, Higher Order Functions, Types, Monads and more Exams Advanced Education in PDF only on Docsity!

Functional Programming Practice

Exam (Core Concepts, Higher Order

Functions, Types, Monads,

Languages, Concurrency,

Applications, Ethics) - 300 Original

Questions with Answers

Original functional programming practice

300 Multiple-Choice Practice Questions

with Answer Key and Explanations

2026 Edition

Exam Overview

This original practice exam covers core concepts, higher order functions, types, monads and abstractions, languages and tools, concurrency and testing, applications, ethics, and applied scenarios. Language features change so please confirm with current documentation. It is educational only and is not an official vendor exam. It does not reproduce course material.

Exam Functional Programming Practice Exam (Core Concepts, Higher Order Functions, Types, Monads, Languages, Concurrency, Applications, Ethics) - 300 Original Questions with Answers

Intended for Programmers learning functional programming

Number of questions 300 multiple-choice (four options, one best answer)

Content areas 9

Suggested time 5 hours (about 60 seconds per question)

Suggested passing target 80% or higher (240 of 300)

Answer format The correct answer and explanation appear directly after each question

Content Blueprint

Content area Questions Share Core Concepts 33 11% Higher Order Functions 33 11% Types 33 11% Monads and Abstractions 33 11% Languages and Tools 33 11% Concurrency and Testing 33 11% Applications 33 11% Ethics 33 11% Applied Scenarios 36 12%

How to Use This Exam

  • Cover the answer lines with a sheet of paper and attempt each question before checking.
  • Work one content area at a time, or take all questions in one sitting.
  • Mark every question you miss or guess on, then reread its explanation.
  • Repeat missed questions after a few days; explain why each wrong option is wrong.

Reference Materials Used

Original study notes written for this exam (confirm against current official documentation and local rules) Note: This is an independent practice resource. It is not affiliated with or endorsed by any testing organization, and it does not contain actual exam questions or proprietary material. Facts, laws, fees and guidelines change; confirm current requirements with official sources. Some distractors were generated from other items in the same exam and explanations are short.

Section 1: Core Concepts

Educational only and not an official vendor exam; language features and libraries change so please confirm with current documentation; not legal advice

1. In this topic, what is true of "Statement"?

A. Performs an action B. Shares structure between versions C. Turn multi argument function into chained single ones D. Function defined for all inputs Correct answer: A. Performs an action Explanation: Here, "Statement" is matched with "Performs an action". Other options: "Shares structure between versions" belongs to "Persistent data structure"; "Turn multi argument function into chained single ones" belongs to "Currying"; "Function defined for all inputs" belongs to "Totality".

2. "Referential transparency": which option fits best?

A. Deconstruct data by shape B. Call can be replaced by its value C. Reuses unchanged parts D. Style built on functions and immutability Correct answer: B. Call can be replaced by its value Explanation: Here, "Referential transparency" is matched with "Call can be replaced by its value". Other options: "Deconstruct data by shape" belongs to "Pattern matching"; "Reuses unchanged parts" belongs to "Structural sharing"; "Style built on functions and immutability" belongs to "Functional programming".

3. Which statement best matches "Type inference"?

A. Compiler deduces types B. Repeating gives the same result C. Cache pure results D. Sum and product types Correct answer: A. Compiler deduces types Explanation: Here, "Type inference" is matched with "Compiler deduces types". Other options: "Repeating gives the same result" belongs to "Idempotence"; "Cache pure results" belongs to "Memoization"; "Sum and product types" belongs to "Algebraic data type".

4. In this topic, what is true of "Structural sharing"?

A. Type inference system B. Reuses unchanged parts C. Omit explicit arguments D. Style built on functions and immutability Correct answer: B. Reuses unchanged parts Explanation: Here, "Structural sharing" is matched with "Reuses unchanged parts". Other options: "Type inference system" belongs to "Hindley Milner"; "Omit explicit arguments" belongs to "Point free style"; "Style built on functions and immutability" belongs to "Functional programming".

5. "Lambda calculus": which option fits best?

A. Deconstruct data by shape B. Substitute equals for equals C. Formal model of computation D. Turn multi argument function into chained single ones Correct answer: C. Formal model of computation Explanation: Here, "Lambda calculus" is matched with "Formal model of computation". Other options: "Deconstruct data by shape" belongs to "Pattern matching"; "Substitute equals for equals" belongs to "Equational reasoning"; "Turn multi argument function into chained single ones" belongs to "Currying".

6. Which statement best matches "Church encoding"?

A. Style built on functions and immutability B. Represent data with functions C. Function that captures its scope D. Stops recursion Correct answer: B. Represent data with functions Explanation: Here, "Church encoding" is matched with "Represent data with functions". Other options: "Style built on functions and immutability" belongs to "Functional programming"; "Function that captures its scope" belongs to "Closure"; "Stops recursion" belongs to "Base case".

7. In this topic, what is true of "Higher order function"?

A. Takes or returns functions B. Reuses unchanged parts C. Compare by content D. Function defined for all inputs Correct answer: A. Takes or returns functions Explanation: Here, "Higher order function" is matched with "Takes or returns functions". Other options: "Reuses unchanged parts" belongs to "Structural sharing"; "Compare by content" belongs to "Value semantics"; "Function defined for all inputs" belongs to "Totality".

8. "Memoization": which option fits best?

A. Cache pure results B. Function that captures its scope C. Call can be replaced by its value D. Style built on functions and immutability Correct answer: A. Cache pure results Explanation: Here, "Memoization" is matched with "Cache pure results". Other options: "Function that captures its scope" belongs to "Closure"; "Call can be replaced by its value" belongs to "Referential transparency"; "Style built on functions and immutability" belongs to "Functional programming".

13. In this topic, what is true of "Point free style"?

A. Call can be replaced by its value B. Function defined for all inputs C. Turn multi argument function into chained single ones D. Omit explicit arguments Correct answer: D. Omit explicit arguments Explanation: Here, "Point free style" is matched with "Omit explicit arguments". Other options: "Call can be replaced by its value" belongs to "Referential transparency"; "Function defined for all inputs" belongs to "Totality"; "Turn multi argument function into chained single ones" belongs to "Currying".

14. "Immutability": which option fits best?

A. Data is not changed after creation B. Combine functions into one C. Compare by content D. Cache pure results Correct answer: A. Data is not changed after creation Explanation: Here, "Immutability" is matched with "Data is not changed after creation". Other options: "Combine functions into one" belongs to "Function composition"; "Compare by content" belongs to "Value semantics"; "Cache pure results" belongs to "Memoization".

15. Which statement best matches "Pattern matching"?

A. Compare by content B. Compute only when needed C. Deconstruct data by shape D. Same reference Correct answer: C. Deconstruct data by shape Explanation: Here, "Pattern matching" is matched with "Deconstruct data by shape". Other options: "Compare by content" belongs to "Value semantics"; "Compute only when needed" belongs to "Lazy evaluation"; "Same reference" belongs to "Referential equality".

16. In this topic, what is true of "Expression"?

A. Produces a value B. Takes or returns functions C. Predictable results D. Represent data with functions Correct answer: A. Produces a value Explanation: Here, "Expression" is matched with "Produces a value". Other options: "Takes or returns functions" belongs to "Higher order function"; "Predictable results" belongs to "Determinism"; "Represent data with functions" belongs to "Church encoding".

17. "Hindley Milner": which option fits best?

A. Type inference system B. Cache pure results C. Function calls itself D. Data is not changed after creation Correct answer: A. Type inference system Explanation: Here, "Hindley Milner" is matched with "Type inference system". Other options: "Cache pure results" belongs to "Memoization"; "Function calls itself" belongs to "Recursion"; "Data is not changed after creation" belongs to "Immutability".

18. Which statement best matches "Equational reasoning"?

A. Omit explicit arguments B. Call can be replaced by its value C. Substitute equals for equals D. Same reference Correct answer: C. Substitute equals for equals Explanation: Here, "Equational reasoning" is matched with "Substitute equals for equals". Other options: "Omit explicit arguments" belongs to "Point free style"; "Call can be replaced by its value" belongs to "Referential transparency"; "Same reference" belongs to "Referential equality".

19. In this topic, what is true of "Referential equality"?

A. Same reference B. Compiler deduces types C. Function that captures its scope D. Repeating gives the same result Correct answer: A. Same reference Explanation: Here, "Referential equality" is matched with "Same reference". Other options: "Compiler deduces types" belongs to "Type inference"; "Function that captures its scope" belongs to "Closure"; "Repeating gives the same result" belongs to "Idempotence".

20. "Function composition": which option fits best?

A. Predictable results B. Combine functions into one C. Produces a value D. Type inference system Correct answer: B. Combine functions into one Explanation: Here, "Function composition" is matched with "Combine functions into one". Other options: "Predictable results" belongs to "Determinism"; "Produces a value" belongs to "Expression"; "Type inference system" belongs to "Hindley Milner".

25. In this topic, what is true of "Persistent data structure"?

A. Compiler deduces types B. Shares structure between versions C. Reuses the stack frame D. Stops recursion Correct answer: B. Shares structure between versions Explanation: Here, "Persistent data structure" is matched with "Shares structure between versions". Other options: "Compiler deduces types" belongs to "Type inference"; "Reuses the stack frame" belongs to "Tail call optimization"; "Stops recursion" belongs to "Base case".

26. "Functional programming": which option fits best?

A. Produces a value B. Style built on functions and immutability C. Call can be replaced by its value D. Data is not changed after creation Correct answer: B. Style built on functions and immutability Explanation: Here, "Functional programming" is matched with "Style built on functions and immutability". Other options: "Produces a value" belongs to "Expression"; "Call can be replaced by its value" belongs to "Referential transparency"; "Data is not changed after creation" belongs to "Immutability".

27. Which statement best matches "Recursion"?

A. Substitute equals for equals B. Produces a value C. Function calls itself D. Same input gives same output with no side effects Correct answer: C. Function calls itself Explanation: Here, "Recursion" is matched with "Function calls itself". Other options: "Substitute equals for equals" belongs to "Equational reasoning"; "Produces a value" belongs to "Expression"; "Same input gives same output with no side effects" belongs to "Pure function".

28. In this topic, what is true of "Idempotence"?

A. Compiler deduces types B. Repeating gives the same result C. Function calls itself D. Data is not changed after creation Correct answer: B. Repeating gives the same result Explanation: Here, "Idempotence" is matched with "Repeating gives the same result". Other options: "Compiler deduces types" belongs to "Type inference"; "Function calls itself" belongs to "Recursion"; "Data is not changed after creation" belongs to "Immutability".

29. "Lambda": which option fits best?

A. Anonymous function B. Repeating gives the same result C. Shares structure between versions D. Predictable results Correct answer: A. Anonymous function Explanation: Here, "Lambda" is matched with "Anonymous function". Other options: "Repeating gives the same result" belongs to "Idempotence"; "Shares structure between versions" belongs to "Persistent data structure"; "Predictable results" belongs to "Determinism".

30. Which statement best matches "Base case"?

A. Change outside the function B. Performs an action C. Stops recursion D. Turn multi argument function into chained single ones Correct answer: C. Stops recursion Explanation: Here, "Base case" is matched with "Stops recursion". Other options: "Change outside the function" belongs to "Side effect"; "Performs an action" belongs to "Statement"; "Turn multi argument function into chained single ones" belongs to "Currying".

31. In this topic, what is true of "Value semantics"?

A. Compare by content B. Represent data with functions C. Same input gives same output with no side effects D. Shares structure between versions Correct answer: A. Compare by content Explanation: Here, "Value semantics" is matched with "Compare by content". Other options: "Represent data with functions" belongs to "Church encoding"; "Same input gives same output with no side effects" belongs to "Pure function"; "Shares structure between versions" belongs to "Persistent data structure".

32. "Algebraic data type": which option fits best?

A. Sum and product types B. Substitute equals for equals C. Compute only when needed D. Deconstruct data by shape Correct answer: A. Sum and product types Explanation: Here, "Algebraic data type" is matched with "Sum and product types". Other options: "Substitute equals for equals" belongs to "Equational reasoning"; "Compute only when needed" belongs to "Lazy evaluation"; "Deconstruct data by shape" belongs to "Pattern matching".

Section 2: Higher Order Functions

Educational only and not an official vendor exam; language features and libraries change so please confirm with current documentation; not legal advice

34. In this topic, what is true of "compose"?

A. Pairs elements from two lists B. Associative operation C. Calls a function with arguments D. Joins functions right to left Correct answer: D. Joins functions right to left Explanation: Here, "compose" is matched with "Joins functions right to left". Other options: "Pairs elements from two lists" belongs to "zip"; "Associative operation" belongs to "Semigroup"; "Calls a function with arguments" belongs to "apply".

35. "partition": which option fits best?

A. Continuation passing style B. Maps then flattens C. Splits by a predicate D. Associative operation Correct answer: C. Splits by a predicate Explanation: Here, "partition" is matched with "Splits by a predicate". Other options: "Continuation passing style" belongs to "CPS"; "Maps then flattens" belongs to "flatMap"; "Associative operation" belongs to "Semigroup".

36. Which statement best matches "Endofunction"?

A. Function from a type to itself B. Takes while a condition holds C. Keeps elements that satisfy a predicate D. Maps then flattens Correct answer: A. Function from a type to itself Explanation: Here, "Endofunction" is matched with "Function from a type to itself". Other options: "Takes while a condition holds" belongs to "takeWhile"; "Keeps elements that satisfy a predicate" belongs to "filter"; "Maps then flattens" belongs to "flatMap".

37. In this topic, what is true of "Trampoline"?

A. Reduces from the left B. Avoids stack growth in recursion C. Applies a function to each element D. Groups by key Correct answer: B. Avoids stack growth in recursion Explanation: Here, "Trampoline" is matched with "Avoids stack growth in recursion". Other options: "Reduces from the left" belongs to "fold left"; "Applies a function to each element" belongs to "map"; "Groups by key" belongs to "groupBy".

38. "Transducer": which option fits best?

A. True if some element matches B. Focus on part of a structure C. Composable transformation of reductions D. Associative operation Correct answer: C. Composable transformation of reductions Explanation: Here, "Transducer" is matched with "Composable transformation of reductions". Other options: "True if some element matches" belongs to "any"; "Focus on part of a structure" belongs to "Lens"; "Associative operation" belongs to "Semigroup".

39. Which statement best matches "filter"?

A. Keeps elements that satisfy a predicate B. Focus on part of a structure C. Associative operation with an identity D. Enables anonymous recursion Correct answer: A. Keeps elements that satisfy a predicate Explanation: Here, "filter" is matched with "Keeps elements that satisfy a predicate". Other options: "Focus on part of a structure" belongs to "Lens"; "Associative operation with an identity" belongs to "Monoid"; "Enables anonymous recursion" belongs to "Y combinator".

40. In this topic, what is true of "Predicate"?

A. Applies a function to each element B. Composable transformation of reductions C. Function returning a Boolean D. Maps then flattens Correct answer: C. Function returning a Boolean Explanation: Here, "Predicate" is matched with "Function returning a Boolean". Other options: "Applies a function to each element" belongs to "map"; "Composable transformation of reductions" belongs to "Transducer"; "Maps then flattens" belongs to "flatMap".

41. "any": which option fits best?

A. True if some element matches B. Reduces from the right C. Swaps argument order D. Splits pairs into two lists Correct answer: A. True if some element matches Explanation: Here, "any" is matched with "True if some element matches". Other options: "Reduces from the right" belongs to "fold right"; "Swaps argument order" belongs to "flip"; "Splits pairs into two lists" belongs to "unzip".

42. Which statement best matches "Semigroup"?

A. Joins functions right to left B. True if some element matches C. Associative operation D. Joins functions left to right Correct answer: C. Associative operation Explanation: Here, "Semigroup" is matched with "Associative operation". Other options: "Joins functions right to left" belongs to "compose"; "True if some element matches" belongs to "any"; "Joins functions left to right" belongs to "pipe".

47. "Identity element": which option fits best?

A. Does nothing under the operation B. Associative operation C. Composable transformation of reductions D. Takes while a condition holds Correct answer: A. Does nothing under the operation Explanation: Here, "Identity element" is matched with "Does nothing under the operation". Other options: "Associative operation" belongs to "Semigroup"; "Composable transformation of reductions" belongs to "Transducer"; "Takes while a condition holds" belongs to "takeWhile".

48. Which statement best matches "identity function"?

A. Focus on part of a structure B. True if some element matches C. Returns its input D. Splits by a predicate Correct answer: C. Returns its input Explanation: Here, "identity function" is matched with "Returns its input". Other options: "Focus on part of a structure" belongs to "Lens"; "True if some element matches" belongs to "any"; "Splits by a predicate" belongs to "partition".

49. In this topic, what is true of "sortBy"?

A. Calls a function with arguments B. Grouping does not matter C. Sorts by a key D. Order does not matter Correct answer: C. Sorts by a key Explanation: Here, "sortBy" is matched with "Sorts by a key". Other options: "Calls a function with arguments" belongs to "apply"; "Grouping does not matter" belongs to "Associativity"; "Order does not matter" belongs to "Commutativity".

50. "reduce": which option fits best?

A. Represents the rest of a computation B. Maps then flattens C. Combines elements into one value D. Reduces from the left Correct answer: C. Combines elements into one value Explanation: Here, "reduce" is matched with "Combines elements into one value". Other options: "Represents the rest of a computation" belongs to "Continuation"; "Maps then flattens" belongs to "flatMap"; "Reduces from the left" belongs to "fold left".

51. Which statement best matches "pipe"?

A. Joins functions left to right B. Grouping does not matter C. Groups by key D. Combines elements into one value Correct answer: A. Joins functions left to right Explanation: Here, "pipe" is matched with "Joins functions left to right". Other options: "Grouping does not matter" belongs to "Associativity"; "Groups by key" belongs to "groupBy"; "Combines elements into one value" belongs to "reduce".

52. In this topic, what is true of "Commutativity"?

A. Running value in a fold B. Order does not matter C. Grouping does not matter D. Drops while a condition holds Correct answer: B. Order does not matter Explanation: Here, "Commutativity" is matched with "Order does not matter". Other options: "Running value in a fold" belongs to "Accumulator"; "Grouping does not matter" belongs to "Associativity"; "Drops while a condition holds" belongs to "dropWhile".

53. "Y combinator": which option fits best?

A. Composable transformation of reductions B. Joins functions right to left C. Calls a function with arguments D. Enables anonymous recursion Correct answer: D. Enables anonymous recursion Explanation: Here, "Y combinator" is matched with "Enables anonymous recursion". Other options: "Composable transformation of reductions" belongs to "Transducer"; "Joins functions right to left" belongs to "compose"; "Calls a function with arguments" belongs to "apply".

54. Which statement best matches "apply"?

A. Splits by a predicate B. Swaps argument order C. Running value in a fold D. Calls a function with arguments Correct answer: D. Calls a function with arguments Explanation: Here, "apply" is matched with "Calls a function with arguments". Other options: "Splits by a predicate" belongs to "partition"; "Swaps argument order" belongs to "flip"; "Running value in a fold" belongs to "Accumulator".

55. In this topic, what is true of "takeWhile"?

A. Keeps elements that satisfy a predicate B. Takes while a condition holds C. Reduces from the left D. Function from a type to itself Correct answer: B. Takes while a condition holds Explanation: Here, "takeWhile" is matched with "Takes while a condition holds". Other options: "Keeps elements that satisfy a predicate" belongs to "filter"; "Reduces from the left" belongs to "fold left"; "Function from a type to itself" belongs to "Endofunction".

61. In this topic, what is true of "map"?

A. Maps then flattens B. Takes while a condition holds C. Applies a function to each element D. Pairs elements from two lists Correct answer: C. Applies a function to each element Explanation: Here, "map" is matched with "Applies a function to each element". Other options: "Maps then flattens" belongs to "flatMap"; "Takes while a condition holds" belongs to "takeWhile"; "Pairs elements from two lists" belongs to "zip".

62. "Lens": which option fits best?

A. Splits by a predicate B. Focus on part of a structure C. Reduces from the left D. Joins functions left to right Correct answer: B. Focus on part of a structure Explanation: Here, "Lens" is matched with "Focus on part of a structure". Other options: "Splits by a predicate" belongs to "partition"; "Reduces from the left" belongs to "fold left"; "Joins functions left to right" belongs to "pipe".

63. Which statement best matches "zip"?

A. Groups by key B. Composable transformation of reductions C. Calls a function with arguments D. Pairs elements from two lists Correct answer: D. Pairs elements from two lists Explanation: Here, "zip" is matched with "Pairs elements from two lists". Other options: "Groups by key" belongs to "groupBy"; "Composable transformation of reductions" belongs to "Transducer"; "Calls a function with arguments" belongs to "apply".

64. In this topic, what is true of "unzip"?

A. Focus on part of a structure B. Sorts by a key C. Splits pairs into two lists D. Associative operation Correct answer: C. Splits pairs into two lists Explanation: Here, "unzip" is matched with "Splits pairs into two lists". Other options: "Focus on part of a structure" belongs to "Lens"; "Sorts by a key" belongs to "sortBy"; "Associative operation" belongs to "Semigroup".

65. "groupBy": which option fits best?

A. Groups by key B. Reduces from the right C. Focus on part of a structure D. Combines elements into one value Correct answer: A. Groups by key Explanation: Here, "groupBy" is matched with "Groups by key". Other options: "Reduces from the right" belongs to "fold right"; "Focus on part of a structure" belongs to "Lens"; "Combines elements into one value" belongs to "reduce".

66. Which statement best matches "flip"?

A. Associative operation with an identity B. Keeps elements that satisfy a predicate C. Function from a type to itself D. Swaps argument order Correct answer: D. Swaps argument order Explanation: Here, "flip" is matched with "Swaps argument order". Other options: "Associative operation with an identity" belongs to "Monoid"; "Keeps elements that satisfy a predicate" belongs to "filter"; "Function from a type to itself" belongs to "Endofunction".