Questions & Results
Q1 of 10Multiple ChoiceAccuracy60s · 1 pt
What is the value of the OCaml expression?
let x = 5 in
let x = x + 2 in
x * 2
D It produces a type error 137 / 186 answered · 91% correct
Q2 of 10Multiple ChoiceAccuracy60s · 1 pt
What is the value of the OCaml expression?
let x = 3 in
let y = (let x = 10 in x + 1) in
x + y
156 / 186 answered · 96% correct
Q3 of 10Multiple ChoiceAccuracy60s · 1 pt
What is the value of the OCaml expression?
(fun x y → x * y) 3 4
D It produces a type error 167 / 186 answered · 97% correct
Q4 of 10Multiple ChoiceAccuracy60s · 1 pt
Which definition is equivalent to the following?
let add1 x = x + 1
C let add1 x = fun x → x + 1 D let add1 = fun x → x + 1✓ Correct 171 / 186 answered · 56% correct
Q5 of 10Multiple ChoiceAccuracy60s · 1 pt
What is the type of the OCaml expression?
fun x → x ^ "!"
A string → string✓ Correct 177 / 186 answered · 93% correct
Q6 of 10Multiple ChoiceAccuracy60s · 1 pt
What is the type of the OCaml expression?
fun f x → f (f x)
C ('a → 'a) → 'a → 'a✓ Correct 179 / 186 answered · 84% correct
Q7 of 10Multiple ChoiceAccuracy60s · 1 pt
What is the value of the OCaml expression?
List.map (fun x → x * x) [1; 2; 3]
182 / 186 answered · 97% correct
Q8 of 10Multiple ChoiceAccuracy60s · 1 pt
What is the type of the OCaml expression?
List.map (fun x → x > 0)
B int list → bool list✓ Correct 185 / 186 answered · 88% correct
Q9 of 10Multiple ChoiceAccuracy60s · 1 pt
What is the value of the OCaml expression?
List.fold_left (fun acc x → acc - x) 10 [1; 2; 3]
183 / 186 answered · 92% correct
Q10 of 10Multiple ChoiceAccuracy60s · 1 pt
What is the value of the OCaml expression?
List.fold_left (fun acc x → x :: acc) [] [1; 2; 3]
D It produces a type error 186 / 186 answered · 92% correct
Score Distribution
Score (points) →