{ "q1": { "type": "blank", "question": "\n

\nThe concepts beind the functional programming paradigm requires functions\nto be ____, meaning functions only rely on their given inputs to produce\nan output. A benefit of using such ____ functions is the reduction of\n____, which occur when there are changes performed within a function's\noperation that are outside its scope.\n

\n\n

\nTo support this programming paradigm, Python supports ____ functions,\nwhich means you can pass functions as arguments to other functions.\nThree common higher-order functions in Python are:\n

\n\n\n\n\n

\nTo create anonymous functions that we can pass to the higher-order\nfunctions above, we can use ____ expressions.\n

\n\n

\nBecause the first two higher-order functions above return iterables, we\ncan re-write them using ____, which are a more Pythonic way of making\nlists.\n

\n\n

\nRather than materializing or populating a whole list or iterable, we can\nproduce items one-by-one using a ____ function that contains the\nyield keyword.\n

\n" }, "q2": { "type": "order", "question": "\n\n

\nMapReduce is a programming model created by Google and is used for\nprocessing large data sets across a large cluster of commodity machines.\nInspired by the functional programming paradigm, a typical MapReduce\napplication goes through the following three phases:\n

\n\n
    \n\n
  1. Worker nodes apply the first function to each item in the local\n data set and writes the intermediate output to a temporary\n storage.
  2. \n\n
  3. Worker nodes redistribute the intermediate output such that all the\n data belonging to one key is located on the same worker node.
  4. \n\n
  5. Worker nodes process each group of intermediate output data with\n second function to produce final result.
  6. \n\n
\n\n

\nOrder the following items to match the descriptions of the phases above.\n

\n", "responses": { "map": "Map", "reduce": "Reduce", "shuffle": "Shuffle" } } }