‹ gallerytime-complexity
all levels · 26 questions · ~39 min

Time complexity · drill

Read a snippet, pick its Big-O. The reverse direction of live coding — train your eye on the access patterns that drive runtime.

0 / 26 passed
  1. 01Get the first element
  2. 02Cache hit check before a slow API call
  3. 03Total up an order
  4. 04Find a price tier in a sorted ladder
  5. 05Build every gift-pair combination
  6. 06Merge two product lists into one
  7. 07Sort orders by date — divide and conquer
  8. 08Find three discount codes that sum to a total
  9. 09Fibonacci — the recursive trap
  10. 10Fibonacci, but with a cache
  11. 11List every order the team can be photographed in
  12. 12How many doublings until n customers?
  13. 13Build a list of placeholders for n table rows
  14. 14Detect duplicate emails in a signup list
  15. 15Render n CSV rows by string concatenation
  16. 16Sum every cell in a seat-map grid
  17. 17Dedupe a signup list by email
  18. 18Dedupe a signup list — the fast version
  19. 19Find two prices that sum to a coupon target
  20. 20Filter blocked users out of a chat list
  21. 21Build a running list with immutable spread
  22. 22Group orders by status for a dashboard
  23. 23Walk a comment thread breadth-first
  24. 24Build a category tree from a flat list
  25. 25Tags shared between two articles
  26. 26Slice page 7 out of a 100k-row table