CMSC330-09/15

CMSC 330 — Fall 2026 · September 15, 2026 · 186 players · Max 10 pts

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
A 14
124
✓ Correct
B 10
11
C 24
D It produces a type error
2
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
A 11
3
B 21
2
C 14
149
✓ Correct
D 13
2
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
A 7
4
B 12
162
✓ Correct
C 34
1
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
A fun add1 x → x + 1
31
B let add1 = fun → x + 1
11
C let add1 x = fun x → x + 1
34
D let add1 = fun x → x + 1
95
✓ 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
164
✓ Correct
B 'a → string
11
C string → bool
2
D char → string
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)
A 'a → 'a → 'a
14
B ('a → 'b) → 'a → 'b
10
C ('a → 'a) → 'a → 'a
150
✓ Correct
D ('a → 'b) → 'b → 'a
5
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]
A [1; 2; 3]
B [2; 4; 6]
6
C 14
D [1; 4; 9]
176
✓ Correct
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)
A int → bool
10
B int list → bool list
162
✓ Correct
C 'a list → bool list
10
D int list → int list
3
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]
A 16
10
B 6
2
C 4
169
✓ Correct
D -4
2
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]
A [3; 2; 1]
171
✓ Correct
B [1; 2; 3]
10
C [[3]; [2]; [1]]
2
D It produces a type error
3
186 / 186 answered · 92% correct

Score Distribution

1
3
3
2
3
10
7
18
29
55
55
0
1
2
3
4
5
6
7
8
9
10

Score (points) →

Players
186
Average Score
8.2
High Score
10
Max Possible
10