-
Notifications
You must be signed in to change notification settings - Fork 0
/
example-quiz.json
50 lines (50 loc) · 1.83 KB
/
example-quiz.json
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
{
"title": "An Example Quiz",
"questions": [
{
"type": "flash-card",
"question": "What are the SOLID principles of object-oriented design?",
"answer": "- Single **responsibility** principle: a class should have only one job\n- **Open/closed** principle: classes should be open for extension but closed for modification\n- Liskov **substitution** principle: classes should be replaceable by their children without breaking functionality\n- **Interface** segregation principle: a class shouldn't expose methods to its clients that the clients don't need\n- **Dependency** inversion principle: classes should depend on abstractions instead of directly depending on each other"
},
{
"type": "single-choice",
"question": "How can one express logical implication ($p \\implies q$) using other logical operators?",
"choices": [
{
"content": "$\\neg p \\lor q$",
"correct": true
},
{
"content": "$(p \\land q) \\lor (\\neg p \\land \\neg q)$",
"correct": false
}
]
},
{
"type": "multiple-choice",
"question": "Which of the following cause undefined behavior in the C programming language?",
"choices": [
{
"content": "```c\nchar* s = \"Quiz Presenter\";\ns[0] = 'K';\n```",
"correct": true
},
{
"content": "```c\nint arr[3] = {0, 1, 2};\nreturn arr[4];\n```",
"correct": true
},
{
"content": "```c\nint val = 5;\nreturn val / 0;\n```",
"correct": true
},
{
"content": "```c\nint x = INT_MAX;\nprintf(\"%d\", x + 1);\n```",
"correct": true
},
{
"content": "```c\nint* ptr = NULL;\nprintf(\"%d\", *ptr);\n```",
"correct": true
}
]
}
]
}