Question bank › A-level Computer Science › Paper 2 – Computer systems

Big data & functional programming

Answer on paper first, then reveal the mark scheme one mark at a time.

1Core3 marks

Big data is often described using three characteristics. Name these three characteristics and describe each one. [3]

2Standard4 marks

Big data is often stored using the fact-based model rather than a relational database.

(a) Describe the fact-based model. [3]

(b) Give one reason why it is suited to big data. [1]

3Standard4 marks

In the functional programming language shown, map applies a function to every list item, filter keeps items for which a function returns true, and foldl combines a list from the left using a function and a starting value.

Evaluate each expression. [4]

(i)   map (+3) [1, 4, 2]
(ii)  filter (>2) [1, 4, 2, 5]
(iii) foldl (+) 0 [1, 2, 3, 4]
(iv)  foldl (-) 0 [10, 4, 3]
4Hard5 marks

Two functions are defined:

add x y = x + y
inc = add 1
double x = x * 2

(a) Explain what is meant by partial application, using inc as your example. [2]

(b) Evaluate (double . inc) 4, where . is function composition. [2]

(c) Evaluate (inc . double) 4. [1]

5Hard5 marks

(a) Write a recursive function countEven that returns the number of even integers in a list. For example countEven [3, 8, 5, 2, 6] returns 3. You may use the function even, head, tail or pattern matching (x:xs). [4]

(b) State the value of head [3, 5, 8] and of tail [3, 5, 8]. [1]

6Standard4 marks

Explain why functional programming is well suited to processing big data. [4]

Still losing marks on this topic?

Book a free introductory session and we'll find exactly which step is costing you.

Book a free intro