mirror of
https://github.com/rohitg00/ai-engineering-from-scratch.git
synced 2026-10-02 01:54:39 +08:00
Every "Test Your Understanding" quiz placed the correct answer in option B.
Across the 2026 questions in 338 quiz files the correct answer sat at index 1
in 61.5% of cases (uniform would be ~25%), and 107 files had every answer at B,
making the quizzes guessable without reading them.
scripts/debias_quizzes.py rewrites each question's option order with a
deterministic, content-seeded permutation and updates the correct index to
follow the moved answer. It is idempotent: options are canonicalised to a sorted
base before permuting, so re-running produces byte-identical output. Questions
whose options reference each other by position ("all of the above", "both A and
B") are left untouched. The correct-answer value, the option set, and every
explanation are preserved exactly; only order and the index change.
Result: A 23.8% / B 26.3% / C 23.5% / D 26.4%.
The script doubles as a CI guard: `--check` exits non-zero if any quiz is not
de-biased, wired into the curriculum workflow so new lessons cannot regress.
Fixes #368
40 lines
2.5 KiB
JSON
40 lines
2.5 KiB
JSON
{
|
|
"questions": [
|
|
{
|
|
"stage": "pre",
|
|
"question": "What does the '~' symbol represent in a Linux file path?",
|
|
"options": ["The root directory of the file system", "The temporary files directory", "The current user's home directory", "The directory where system programs are installed"],
|
|
"correct": 2,
|
|
"explanation": "The tilde (~) is a shortcut for the current user's home directory, typically /home/username on Linux. 'cd ~' takes you home from anywhere."
|
|
},
|
|
{
|
|
"stage": "pre",
|
|
"question": "What is the purpose of 'sudo' before a command?",
|
|
"options": ["It runs the command with root (administrator) privileges", "It runs the command in a sandboxed environment", "It speeds up the command execution", "It logs the command output to a system file"],
|
|
"correct": 0,
|
|
"explanation": "sudo (superuser do) temporarily elevates your privileges to root level for a single command. Required for system-level operations like installing packages with apt."
|
|
},
|
|
{
|
|
"stage": "post",
|
|
"question": "You get 'Permission denied' when trying to run a shell script. What command fixes this?",
|
|
"options": ["chown root script.sh", "mv script.sh /usr/bin/", "chmod +x script.sh", "sudo rm script.sh"],
|
|
"correct": 2,
|
|
"explanation": "chmod +x adds execute permission to the file. Without the execute bit set, the shell refuses to run the script even if you own it."
|
|
},
|
|
{
|
|
"stage": "post",
|
|
"question": "On a remote GPU box, your training data fills the disk. Which command shows the largest directories consuming space?",
|
|
"options": ["ls -la /", "cat /proc/meminfo", "du -h --max-depth=1 / | sort -hr | head -20", "free -h"],
|
|
"correct": 2,
|
|
"explanation": "du -h shows disk usage per directory, --max-depth=1 limits to top-level directories, and sort -hr sorts by size in descending order. This reveals which directories are consuming the most space."
|
|
},
|
|
{
|
|
"stage": "post",
|
|
"question": "What is a key difference between the macOS and Linux versions of 'sed -i'?",
|
|
"options": ["Linux sed is faster than macOS sed", "Linux sed does not support regular expressions", "macOS sed cannot modify files in place", "macOS sed requires an empty string argument after -i ('sed -i \"\"'), while Linux does not"],
|
|
"correct": 3,
|
|
"explanation": "macOS uses BSD sed which requires 'sed -i \"\" pattern file', while Linux uses GNU sed which accepts 'sed -i pattern file'. This is a common gotcha when moving scripts between systems."
|
|
}
|
|
]
|
|
}
|