Exact question counts, time limits, and project rubrics vary by platform cohort and qualification tier. Always read the platform's live project instructions carefully.
Sample scenarios
An LLM writes:
```js function getTimeout(opts) { return opts.timeout || 3000; } ```
If a caller explicitly passes `{ timeout: 0 }` (meaning no timeout), what does `getTimeout` return?
`0`.
`3000`, because `0` is falsy in JavaScript—it should use nullish coalescing (`opts.timeout ?? 3000`).
`undefined`.
`NaN`.
Show the answer
B. `3000`, because `0` is falsy in JavaScript—it should use nullish coalescing (`opts.timeout ?? 3000`).
Using `||` falls back on any falsy value (`0`, `''`, `false`). Nullish coalescing `??` only falls back on `null` or `undefined`, preserving `0`.
Principle: JavaScript Operators: Nullish Coalescing (??) vs OR (||)
An LLM writes a binary search function:
```python def binary_search(arr, target): lo, hi = 0, len(arr) - 1 while lo < hi: mid = (lo + hi) // 2 if arr[mid] == target: return mid elif arr[mid] < target: lo = mid + 1 else: hi = mid - 1 return -1 ```
On which valid input does this fail?
Empty array `[]`.
A 1-element array `[7]` when `target = 7` (returns `-1` because `lo == hi` exits `while lo < hi`).
Any array with negative numbers.
It enters an infinite loop on `[1, 2, 3]`.
Show the answer
B. A 1-element array `[7]` when `target = 7` (returns `-1` because `lo == hi` exits `while lo < hi`).
With `lo, hi = 0, 0`, `while lo < hi` is immediately False, so `binary_search([7], 7)` returns `-1`. Classic off-by-one bug: the condition must be `while lo <= hi:`.
```sql SELECT * FROM users WHERE id NOT IN (SELECT user_id FROM banned_users); ```
If `banned_users.user_id` contains even a single `NULL` value, what does this query return?
All non-banned users.
Zero rows (empty set), because `id NOT IN (1, 2, NULL)` evaluates to `UNKNOWN` for every row.
Only the rows where `id` is `NULL`.
Raises a division-by-zero error.
Show the answer
B. Zero rows (empty set), because `id NOT IN (1, 2, NULL)` evaluates to `UNKNOWN` for every row.
In SQL three-valued logic, `x NOT IN (1, NULL)` means `x != 1 AND x != NULL`, which is always `UNKNOWN` (never `TRUE`). Prefer `NOT EXISTS` or filter `WHERE user_id IS NOT NULL` inside the subquery.
Principle: SQL Three-Valued Logic: NOT IN with NULL
Taking this assessment soon?
Tell us what skills or question formats you want more drills on.