This material trains the functional programming and Big Data content of A level Computer Science. It is for Year 12 and Year 13 students, and it follows most closely the specifications that include this content, for example AQA's, where the two topics are linked: functional programming is one of the main ways of processing data too large for a single machine.
The quiz has twelve questions. Six are short Python programs, printed in code blocks, whose output the student must predict: a map, a filter, a fold that turns a list of bits into a number, a pipeline that filters, maps and folds in turn, a composition of two functions where the order matters, and a partial application that returns a function. Every program was run to check its output. Three more are about the vocabulary of the paradigm: the domain and co-domain of a function type, spotting the higher-order function among four definitions, and the head and tail of a list, including the tail of a one-item list. The last three are about Big Data: which characteristic a stream of traffic sensor readings shows, why functions without side effects and immutable data suit processing spread across many servers, and how a graph schema represents a social network.
Every explanation traces the code step by step and says what the tempting wrong answer did, for example applying the functions of a composition in the wrong order or summing the bits instead of folding them.
The flashcards cover the functional paradigm, function types, first-class objects, higher-order functions, map, filter, fold, partial application, composition, head and tail, side effects, the three Vs of Big Data, why relational databases struggle with it, fact-based models and graph schemas.
The written work has eight longer tasks to answer on paper: explaining and tracing a map, filter and reduce pipeline; building a pipeline that adds VAT in pounds to the more expensive items in a list and totals them; partial application and composition with worked values; a recursive length function on head and tail; the three characteristics of Big Data with examples; the features of functional programming that suit distributed processing; representing a social network as a graph schema and as a fact-based model; and first-class functions with a small higher-order function. Each task has a model answer and the points a marker would look for.
There is also a short oral practice with an examiner, who accepts Python or any functional language, asks one question at a time and gives brief feedback at the end.
The content is based on the functional programming and Big Data sections of the A level specifications, for example AQA 7517 sections 4.11 (Big Data) and 4.12 (fundamentals of functional programming).
Practice material written by Zestly, based on the functional programming and Big Data content of the A level Computer Science specifications (for example AQA 7517 sections 4.11 and 4.12).
What does this Python program print? ```python values = [1, 2, 3, 4] result = list(map(lambda x: x * x - 1, values)) print(result) ```
[0, 3, 8, 15]
map applies the function to every item and returns the results in the same order: 1 × 1 − 1 = 0, 2 × 2 − 1 = 3, 3 × 3 − 1 = 8, 4 × 4 − 1 = 15. list() turns the result into [0, 3, 8, 15]. map never combines the items into one value; that is what a fold (reduce) does.