Complexity Quiz

Read the Python. State the time and space complexity. Get judged.

Answers are free text — O(n log n), nlogn and N·logN all count, and so does O(n log n + n) — a term another one provably dominates is dropped. Time and space are marked separately, so a half-right answer scores half. Unless a question says otherwise, the space asked for is auxiliary: the returned answer does not count against you. After you check, the lines that set each bound light up in the code.

The snippets are the classics — Blind 75, NeetCode 150 / 250 and LeetCode's Top 100 Liked — plus a handful of pure drills where the shape of the loop is the whole question.

Switch Question set to Interview essentials for a second set of frequently asked problems whose bound is easy to misjudge — amortised stacks and sliding windows, output-sensitive backtracking, a log taken over the answer range rather than n. Link straight to it with ?set=essentials.

Pattern coverage takes one question for every pattern in every topic — each heap pattern, each sliding-window shape, each DP family — across both sets, so a full run leaves no pattern unpriced. The pattern is named once you check. Link to it with ?set=patterns. When you finish, download the results as JSON or CSV to compare with your next attempt.

How many questions
Focus

          
sets the timesets the space

enter to check, again to continue
Keep a copy

Every answer, the right one beside it, and the score — to compare with next time.

Where the marks went
TopicTimeSpace
Worth a second look

CS_basics — computer science fundamentals & interview preparation

github | docs | issues

release V20261107 · 2026-11-07