Skip to content

Practice bank

Every practice problem from every lesson, in one place. Filter to find your next problem. Each one opens in its lesson, with hints and worked answers.

Difficulty

259 problems from 82 lessons.

  1. Python · from Every button I made in a loop says the last name · Tests run here

    Topics: Closures

  2. Python · from Every button I made in a loop says the last name · Tests run here

    Topics: Closures

  3. Python · from Every button I made in a loop says the last name · Tests run here

    Topics: Closures

  4. Python · from My import got 100 times slower when the data grew 10 times · Tests run here

    Topics: list, tuple, dict and set, and what each operation costs

  5. Python · from My import got 100 times slower when the data grew 10 times · Tests run here

    Topics: list, tuple, dict and set, and what each operation costs; Names, objects and references

  6. Python · from My import got 100 times slower when the data grew 10 times · Tests run here

    Topics: list, tuple, dict and set, and what each operation costs

  7. Python · from My import got 100 times slower when the data grew 10 times · Tests run here

    Topics: list, tuple, dict and set, and what each operation costs; Decisions and loops: if, for and while

  8. Python · from I removed the bad readings, but one is still there · Tests run here

    Topics: Comprehensions

  9. Python · from I removed the bad readings, but one is still there · Tests run here

    Topics: Comprehensions; Mutable and immutable objects

  10. Python · from I removed the bad readings, but one is still there · Tests run here

    Topics: Comprehensions; list, tuple, dict and set, and what each operation costs

  11. Python · from After one error, debug mode stayed on for everyone · Tests run here

    Topics: Context managers

  12. Python · from After one error, debug mode stayed on for everyone · Tests run here

    Topics: Context managers

  13. Python · from After one error, debug mode stayed on for everyone · Tests run here

    Topics: Context managers; Exceptions

  14. Python · from My loop never stops · Tests run here

    Topics: Decisions and loops: if, for and while

  15. Python · from My loop never stops · Tests run here

    Topics: Decisions and loops: if, for and while

  16. Python · from My loop never stops · Tests run here

    Topics: Decisions and loops: if, for and while

  17. Python · from Count errors in a 10 GB log · Streaming · Tests run here

    Topics: Iterators and generators; collections, itertools and functools

  18. Python · from Count errors in a 10 GB log · Streaming · Tests run here

    Topics: Iterators and generators

  19. Python · from Count errors in a 10 GB log · Streaming · Tests run here

    Topics: Iterators and generators; collections, itertools and functools

  20. Python · from Count errors in a 10 GB log · Top k · Tests run here

    Topics: Iterators and generators; Heaps: top-k, k-way merge, two heaps

  21. Python · from I added a field, and two different orders came out equal · Tests run here

    Topics: Dataclasses

  22. Python · from I added a field, and two different orders came out equal · Tests run here

    Topics: Dataclasses

  23. Python · from I added a field, and two different orders came out equal · Tests run here

    Topics: Dataclasses

  24. Python · from I pasted the same timing code into twenty functions · Tests run here

    Topics: Decorators, with arguments and functools.wraps

  25. Python · from I pasted the same timing code into twenty functions · Tests run here

    Topics: Decorators, with arguments and functools.wraps

  26. Python · from I pasted the same timing code into twenty functions · Tests run here

    Topics: Decorators, with arguments and functools.wraps; Exceptions

  27. Python · from My server ignored the port I set · Tests run here

    Topics: Exceptions

  28. Python · from My server ignored the port I set · Tests run here

    Topics: Exceptions; Your first functions: def and return

  29. Python · from My server ignored the port I set · Tests run here

    Topics: Exceptions; Your first functions: def and return

  30. Python · from My server ignored the port I set · Tests run here

    Topics: Exceptions; list, tuple, dict and set, and what each operation costs

  31. Python · from My script can’t find its file when I run it from another folder · Tests run here

    Topics: Files and pathlib

  32. Python · from My script can’t find its file when I run it from another folder · Tests run here

    Topics: Files and pathlib; Exceptions

  33. Python · from My script can’t find its file when I run it from another folder · Tests run here

    Topics: Files and pathlib; Decisions and loops: if, for and while

  34. Python · from My script can’t find its file when I run it from another folder · Tests run here

    Topics: Files and pathlib; list, tuple, dict and set, and what each operation costs

  35. Python · from My function printed the total, but gave me None · Tests run here

    Topics: Your first functions: def and return

  36. Python · from My function printed the total, but gave me None · Tests run here

    Topics: Your first functions: def and return

  37. Python · from My function printed the total, but gave me None · Tests run here

    Topics: Your first functions: def and return; Decisions and loops: if, for and while

  38. Python · from I closed the window and my code was gone · Tests run here

    Topics: Install Python and run your first file

  39. Python · from I closed the window and my code was gone · Tests run here

    Topics: Install Python and run your first file

  40. Python · from I closed the window and my code was gone · Tests run here

    Topics: Install Python and run your first file

  41. Python · from My function remembers the last call · Tests run here

    Topics: Functions, *args, **kwargs and the mutable-default trap

  42. Python · from My function remembers the last call · Tests run here

    Topics: Functions, *args, **kwargs and the mutable-default trap; Numbers, strings, slicing and f-strings

  43. Python · from My function remembers the last call · Tests run here

    Topics: Functions, *args, **kwargs and the mutable-default trap; Mutable and immutable objects

  44. Python · from I pushed my fix, and my teammate’s work disappeared · Tests run here

    Topics: Git for everyday work: commit, branch, merge, rebase, pull requests

  45. Python · from I pushed my fix, and my teammate’s work disappeared · Tests run here

    Topics: Git for everyday work: commit, branch, merge, rebase, pull requests

  46. Python · from I pushed my fix, and my teammate’s work disappeared · Tests run here

    Topics: Git for everyday work: commit, branch, merge, rebase, pull requests

  47. Python · from Python says my formula has too many nested parentheses · Tests run here

    Topics: How Python runs your code

  48. Python · from Python says my formula has too many nested parentheses · Tests run here

    Topics: How Python runs your code

  49. Python · from Python says my formula has too many nested parentheses · Tests run here

    Topics: How Python runs your code; Functions, *args, **kwargs and the mutable-default trap

  50. Python · from Python says my formula has too many nested parentheses · Tests run here

    Topics: How Python runs your code

  51. Python · from I started a new game, and the old board changed too · Tests run here

    Topics: is vs ==, shallow vs deep copy

  52. Python · from I started a new game, and the old board changed too · Tests run here

    Topics: is vs ==, shallow vs deep copy

  53. Python · from I started a new game, and the old board changed too · Tests run here

    Topics: is vs ==, shallow vs deep copy

  54. Python · from The bug happened at 3 a.m., and my prints told me nothing · Tests run here

    Topics: Logging

  55. Python · from The bug happened at 3 a.m., and my prints told me nothing · Tests run here

    Topics: Logging; Exceptions

  56. Python · from The bug happened at 3 a.m., and my prints told me nothing · Tests run here

    Topics: Logging

  57. Python · from pip says it’s installed, but Python can’t find it · Tests run here

    Topics: Modules, packages and virtual environments

  58. Python · from pip says it’s installed, but Python can’t find it · Tests run here

    Topics: Modules, packages and virtual environments

  59. Python · from pip says it’s installed, but Python can’t find it · Tests run here

    Topics: Modules, packages and virtual environments; list, tuple, dict and set, and what each operation costs

  60. Python · from Python says my list can’t be a dict key · Tests run here

    Topics: Mutable and immutable objects; list, tuple, dict and set, and what each operation costs

  61. Python · from Python says my list can’t be a dict key · Tests run here

    Topics: Mutable and immutable objects; Names, objects and references

  62. Python · from Python says my list can’t be a dict key · Tests run here

    Topics: Mutable and immutable objects; list, tuple, dict and set, and what each operation costs

  63. Python · from I changed my copy, and the original changed too · Tests run here

    Topics: Names, objects and references; list, tuple, dict and set, and what each operation costs

  64. Python · from I changed my copy, and the original changed too · Tests run here

    Topics: Names, objects and references; Your first functions: def and return

  65. Python · from I changed my copy, and the original changed too · Tests run here

    Topics: Names, objects and references; list, tuple, dict and set, and what each operation costs

  66. Python · from My shop’s total says 0.30000000000000004 · Tests run here

    Topics: Numbers, strings, slicing and f-strings

  67. Python · from My shop’s total says 0.30000000000000004 · Tests run here

    Topics: Numbers, strings, slicing and f-strings

  68. Python · from My shop’s total says 0.30000000000000004 · Tests run here

    Topics: Numbers, strings, slicing and f-strings; list, tuple, dict and set, and what each operation costs

  69. Python · from My shop’s total says 0.30000000000000004 · Tests run here

    Topics: Numbers, strings, slicing and f-strings

  70. Python · from My bank opened the same account twice · Tests run here

    Topics: Classes: inheritance, MRO, super() and dunder methods

  71. Python · from My bank opened the same account twice · Tests run here

    Topics: Classes: inheritance, MRO, super() and dunder methods

  72. Python · from My bank opened the same account twice · Tests run here

    Topics: Classes: inheritance, MRO, super() and dunder methods

  73. Python · from My sales report loop takes twenty minutes · Tests run here

    Topics: pandas basics: DataFrames, filtering, groupby and merge

  74. Python · from My sales report loop takes twenty minutes · Tests run here

    Topics: pandas basics: DataFrames, filtering, groupby and merge

  75. Python · from My sales report loop takes twenty minutes · Tests run here

    Topics: pandas basics: DataFrames, filtering, groupby and merge

  76. Python · from Someone set the price to -5, and my report broke · Tests run here

    Topics: @property, class methods and static methods

  77. Python · from Someone set the price to -5, and my report broke · Tests run here

    Topics: @property, class methods and static methods

  78. Python · from Someone set the price to -5, and my report broke · Tests run here

    Topics: @property, class methods and static methods

  79. Python · from I fixed one bug, and two old ones came back · Tests run here

    Topics: pytest basics

  80. Python · from I fixed one bug, and two old ones came back · Tests run here

    Topics: pytest basics; Exceptions

  81. Python · from I fixed one bug, and two old ones came back · Tests run here

    Topics: pytest basics

  82. Python · from Python says my counter has no value · Tests run here

    Topics: Scope and the LEGB rule; Decisions and loops: if, for and while

  83. Python · from Python says my counter has no value · Tests run here

    Topics: Scope and the LEGB rule; Mutable and immutable objects

  84. Python · from Python says my counter has no value · Tests run here

    Topics: Scope and the LEGB rule

  85. Python · from Counting words took me twenty lines, and it was slow · Tests run here

    Topics: collections, itertools and functools

  86. Python · from Counting words took me twenty lines, and it was slow · Tests run here

    Topics: collections, itertools and functools

  87. Python · from Counting words took me twenty lines, and it was slow · Tests run here

    Topics: collections, itertools and functools; Iterators and generators

  88. Python · from The total came out as “33”, three files away from the bug · Tests run here

    Topics: Type hints

  89. Python · from The total came out as “33”, three files away from the bug · Tests run here

    Topics: Type hints

  90. Python · from The total came out as “33”, three files away from the bug · Tests run here

    Topics: Type hints

  91. Python · from My calculator says 2 + 3 is 23 · Tests run here

    Topics: Variables, print() and input()

  92. Python · from My calculator says 2 + 3 is 23 · Tests run here

    Topics: Variables, print() and input()

  93. Python · from My calculator says 2 + 3 is 23 · Tests run here

    Topics: Variables, print() and input()

  94. SQL · from The sales tile says two customers ordered, but it was only Hugo · Tests run here

    Topics: Aggregates

  95. SQL · from The sales tile says two customers ordered, but it was only Hugo · Tests run here

    Topics: Aggregates

  96. SQL · from The sales tile says two customers ordered, but it was only Hugo · Tests run here

    Topics: Aggregates

  97. SQL · from Bigger than the order before, or just typed in late? · Tests run here

    Topics: Correlated subqueries; Joins: inner, left, right, full, self and cross

  98. SQL · from Bigger than the order before, or just typed in late? · Tests run here

    Topics: Correlated subqueries; Simple subqueries

  99. SQL · from Bigger than the order before, or just typed in late? · Tests run here

    Topics: Correlated subqueries; Aggregates

  100. SQL · from A team of one made the above-average pay list · Tests run here

    Topics: CTEs; GROUP BY and HAVING

  101. SQL · from A team of one made the above-average pay list · Tests run here

    Topics: CTEs; Simple subqueries

  102. SQL · from A team of one made the above-average pay list · Tests run here

    Topics: CTEs; Joins: inner, left, right, full, self and cross

  103. SQL · from Our “second-highest price” is the highest price · Tests run here

    Topics: DISTINCT

  104. SQL · from Our “second-highest price” is the highest price · Tests run here

    Topics: DISTINCT

  105. SQL · from Our “second-highest price” is the highest price · Tests run here

    Topics: DISTINCT

  106. SQL · from Grace got the window-shopper email twice · Tests run here

    Topics: EXISTS vs IN vs JOIN, and the NOT IN + NULL trap; DISTINCT

  107. SQL · from Grace got the window-shopper email twice · Tests run here

    Topics: EXISTS vs IN vs JOIN, and the NOT IN + NULL trap; Correlated subqueries

  108. SQL · from Grace got the window-shopper email twice · Tests run here

    Topics: EXISTS vs IN vs JOIN, and the NOT IN + NULL trap; GROUP BY and HAVING

  109. SQL · from Grace shopped on one day and got the loyalty coupon · Tests run here

    Topics: GROUP BY and HAVING

  110. SQL · from Grace shopped on one day and got the loyalty coupon · Tests run here

    Topics: GROUP BY and HAVING

  111. SQL · from Grace shopped on one day and got the loyalty coupon · Tests run here

    Topics: GROUP BY and HAVING

  112. SQL · from Dana never paid, and finance never noticed · Tests run here

    Topics: Joins: inner, left, right, full, self and cross; GROUP BY and HAVING

  113. SQL · from Dana never paid, and finance never noticed · Tests run here

    Topics: Joins: inner, left, right, full, self and cross

  114. SQL · from Dana never paid, and finance never noticed · Tests run here

    Topics: Joins: inner, left, right, full, self and cross

  115. SQL · from Each customer's latest order · Top N per group · Tests run here

    Topics: Window functions: ranking, LAG, LEAD, running totals, frames

  116. SQL · from Each customer's latest order · Top N per group · Tests run here

    Topics: Window functions: ranking, LAG, LEAD, running totals, frames

  117. SQL · from Each customer's latest order · Previous row · Tests run here

    Topics: Window functions: ranking, LAG, LEAD, running totals, frames; Date and string functions

  118. SQL · from Each customer's latest order · Running total · Tests run here

    Topics: Window functions: ranking, LAG, LEAD, running totals, frames

  119. SQL · from Dana first ordered in August and got September’s welcome email · Tests run here

    Topics: Logical query processing order

  120. SQL · from Dana first ordered in August and got September’s welcome email · Tests run here

    Topics: Logical query processing order; Joins: inner, left, right, full, self and cross

  121. SQL · from Dana first ordered in August and got September’s welcome email · Tests run here

    Topics: Logical query processing order; GROUP BY and HAVING

  122. SQL · from We deleted Ben’s duplicate payment, and the real one went too · Tests run here

    Topics: INSERT, UPDATE and DELETE

  123. SQL · from We deleted Ben’s duplicate payment, and the real one went too · Tests run here

    Topics: Data types and constraints

  124. SQL · from We deleted Ben’s duplicate payment, and the real one went too · Tests run here

    Topics: INSERT, UPDATE and DELETE; Tables, rows and keys

  125. SQL · from A guest checked out, and nobody got a reminder · Tests run here

    Topics: NULL and three-valued logic

  126. SQL · from A guest checked out, and nobody got a reminder · Tests run here

    Topics: NULL and three-valued logic

  127. SQL · from A guest checked out, and nobody got a reminder · Tests run here

    Topics: NULL and three-valued logic; GROUP BY and HAVING

  128. SQL · from Order 109 disappeared from the warehouse’s list · Tests run here

    Topics: SELECT, WHERE, ORDER BY and LIMIT

  129. SQL · from Order 109 disappeared from the warehouse’s list · Tests run here

    Topics: SELECT, WHERE, ORDER BY and LIMIT

  130. SQL · from Order 109 disappeared from the warehouse’s list · Tests run here

    Topics: SELECT, WHERE, ORDER BY and LIMIT

  131. SQL · from Grace cancelled, and we still asked if she’d ordered twice · Tests run here

    Topics: Joins: inner, left, right, full, self and cross

  132. SQL · from Grace cancelled, and we still asked if she’d ordered twice · Tests run here

    Topics: Joins: inner, left, right, full, self and cross

  133. SQL · from Grace cancelled, and we still asked if she’d ordered twice · Tests run here

    Topics: Joins: inner, left, right, full, self and cross; GROUP BY and HAVING

  134. SQL · from Elif bought two backpacks and got the bottle offer twice · Tests run here

    Topics: Simple subqueries

  135. SQL · from Elif bought two backpacks and got the bottle offer twice · Tests run here

    Topics: Simple subqueries; GROUP BY and HAVING

  136. SQL · from Elif bought two backpacks and got the bottle offer twice · Tests run here

    Topics: Simple subqueries; GROUP BY and HAVING

  137. SQL · from My report shows reviews of a product we don’t sell · Tests run here

    Topics: Tables, rows and keys

  138. SQL · from My report shows reviews of a product we don’t sell · Tests run here

    Topics: Tables, rows and keys

  139. SQL · from My report shows reviews of a product we don’t sell · Tests run here

    Topics: Tables, rows and keys

  140. DSA · from I reversed the list, but the caller’s list didn’t change · Tests run here

    Topics: Arrays and strings

  141. DSA · from I reversed the list, but the caller’s list didn’t change · Two pointers · Tests run here

    Topics: Arrays and strings; Two pointers

  142. DSA · from I reversed the list, but the caller’s list didn’t change · Tests run here

    Topics: Arrays and strings

  143. DSA · from My sort is right, but 50,000 scores take half a minute · Sorting · Tests run here

    Topics: Basic sorting

  144. DSA · from My sort is right, but 50,000 scores take half a minute · Two pointers · Tests run here

    Topics: Basic sorting; Two pointers; Hashing and hash maps

  145. H-indexMedium

    DSA · from My sort is right, but 50,000 scores take half a minute · Sorting · Tests run here

    Topics: Basic sorting

  146. DSA · from My code passed every test, then timed out on the big one · Tests run here

    Topics: Big-O for time and space; Hashing and hash maps

  147. DSA · from My code passed every test, then timed out on the big one · Tests run here

    Topics: Big-O for time and space

  148. DSA · from My code passed every test, then timed out on the big one · Tests run here

    Topics: Big-O for time and space; Arrays and strings

  149. DSA · from My binary search says 0 isn’t in [4, 5, 6, 7, 0, 1, 2] · Binary search · Tests run here

    Topics: Binary search on an index and on the answer

  150. DSA · from My binary search says 0 isn’t in [4, 5, 6, 7, 0, 1, 2] · Binary search · Tests run here

    Topics: Binary search on an index and on the answer

  151. DSA · from My binary search says 0 isn’t in [4, 5, 6, 7, 0, 1, 2] · Binary search · Tests run here

    Topics: Binary search on an index and on the answer

  152. DSA · from My anagram check says aab and abb match · Hash map · Tests run here

    Topics: Hashing and hash maps

  153. DSA · from My anagram check says aab and abb match · Hash map · Tests run here

    Topics: Hashing and hash maps

  154. DSA · from My anagram check says aab and abb match · Hash map · Tests run here

    Topics: Hashing and hash maps; Basic sorting

  155. DSA · from My rate limiter let 200 requests through in one second · Queue · Tests run here

    Topics: Stacks and queues

  156. DSA · from My rate limiter let 200 requests through in one second · Queue · Tests run here

    Topics: Stacks and queues; Designing data structures: LRU and LFU caches, min stack, randomized set

  157. DSA · from My rate limiter let 200 requests through in one second · Queue · Tests run here

    Topics: Stacks and queues; Hashing and hash maps

  158. DSA · from My power function crashes when n is 5,000 · Recursion · Tests run here

    Topics: Recursion

  159. DSA · from My power function crashes when n is 5,000 · Recursion · Tests run here

    Topics: Recursion; Stacks and queues

  160. DSA · from My power function crashes when n is 5,000 · Recursion · Tests run here

    Topics: Recursion

  161. DSA · from My no-repeat finder says 2, but “vdf” has 3 · Sliding window · Tests run here

    Topics: Sliding window

  162. DSA · from My no-repeat finder says 2, but “vdf” has 3 · Sliding window · Tests run here

    Topics: Sliding window

  163. DSA · from My no-repeat finder says 2, but “vdf” has 3 · Sliding window · Tests run here

    Topics: Sliding window; Hashing and hash maps

  164. DSA · from My bracket check says ([)] is fine · Stack · Tests run here

    Topics: Stacks and queues; Two pointers

  165. DSA · from My bracket check says ([)] is fine · Monotonic stack · Tests run here

    Topics: Stacks and queues; Monotonic stack and queue

  166. DSA · from My bracket check says ([)] is fine · Stack · Tests run here

    Topics: Stacks and queues

  167. DSA · from My tank finder says 40, but two walls hold 49 · Two pointers · Tests run here

    Topics: Two pointers; Arrays and strings

  168. DSA · from My tank finder says 40, but two walls hold 49 · Two pointers · Tests run here

    Topics: Two pointers; Basic sorting

  169. DSA · from My tank finder says 40, but two walls hold 49 · Two pointers · Tests run here

    Topics: Two pointers

  170. DSA · from Two Sum · Two pointers · Tests run here

    Topics: Two pointers

  171. DSA · from Two Sum · Hash map · Tests run here

    Topics: Hashing and hash maps

  172. Three SumMedium

    DSA · from Two Sum · Two pointers · Tests run here

    Topics: Two pointers; Basic sorting

  173. DSA · from Two Sum · Two pointers · Tests run here

    Topics: Two pointers; Basic sorting

  174. System Design · from The phone app makes five calls to draw one screen · Think it through, then compare answers

    Topics: REST vs GraphQL vs gRPC

  175. System Design · from The phone app makes five calls to draw one screen · Think it through, then compare answers

    Topics: REST vs GraphQL vs gRPC

  176. System Design · from The phone app makes five calls to draw one screen · Think it through, then compare answers

    Topics: REST vs GraphQL vs gRPC

  177. System Design · from I added a cache, and now the shop shows the old price · Think it through, then compare answers

    Topics: Caching: cache-aside, write-through, write-back, eviction, TTL

  178. System Design · from I added a cache, and now the shop shows the old price · Think it through, then compare answers

    Topics: Caching: cache-aside, write-through, write-back, eviction, TTL; CDNs

  179. System Design · from I added a cache, and now the shop shows the old price · Think it through, then compare answers

    Topics: Caching: cache-aside, write-through, write-back, eviction, TTL

  180. System Design · from Users in Sydney wait three seconds for images from Virginia · Think it through, then compare answers

    Topics: CDNs

  181. System Design · from Users in Sydney wait three seconds for images from Virginia · Think it through, then compare answers

    Topics: CDNs; Object storage

  182. System Design · from Users in Sydney wait three seconds for images from Virginia · Think it through, then compare answers

    Topics: CDNs

  183. System Design · from My page takes two seconds, and I can’t say where the time goes · Think it through, then compare answers

    Topics: Client–server, HTTP and HTTPS

  184. System Design · from My page takes two seconds, and I can’t say where the time goes · Think it through, then compare answers

    Topics: Client–server, HTTP and HTTPS; Latency numbers worth knowing

  185. System Design · from My page takes two seconds, and I can’t say where the time goes · Think it through, then compare answers

    Topics: Client–server, HTTP and HTTPS

  186. System Design · from I moved my site, but some users still reach the old server · Think it through, then compare answers

    Topics: DNS

  187. System Design · from I moved my site, but some users still reach the old server · Think it through, then compare answers

    Topics: DNS; Load balancers: L4 vs L7 and algorithms

  188. System Design · from I moved my site, but some users still reach the old server · Think it through, then compare answers

    Topics: DNS

  189. System Design · from The interviewer asks how much storage a photo app needs, and I freeze · Think it through, then compare answers

    Topics: Back-of-the-envelope estimates

  190. System Design · from The interviewer asks how much storage a photo app needs, and I freeze · Think it through, then compare answers

    Topics: Back-of-the-envelope estimates

  191. System Design · from The interviewer asks how much storage a photo app needs, and I freeze · Think it through, then compare answers

    Topics: Back-of-the-envelope estimates

  192. System Design · from My page makes 50 database calls and takes four seconds · Think it through, then compare answers

    Topics: Latency numbers worth knowing

  193. System Design · from My page makes 50 database calls and takes four seconds · Think it through, then compare answers

    Topics: Latency numbers worth knowing

  194. System Design · from My page makes 50 database calls and takes four seconds · Think it through, then compare answers

    Topics: Latency numbers worth knowing

  195. System Design · from One server is at 95% while the other two sit idle · Think it through, then compare answers

    Topics: Load balancers: L4 vs L7 and algorithms

  196. System Design · from One server is at 95% while the other two sit idle · Think it through, then compare answers

    Topics: Load balancers: L4 vs L7 and algorithms

  197. System Design · from One server is at 95% while the other two sit idle · Think it through, then compare answers

    Topics: Load balancers: L4 vs L7 and algorithms; Partitioning and consistent hashing

  198. System Design · from On sale day, our one server hit 100% and the shop went down · Think it through, then compare answers

    Topics: Vertical vs horizontal scaling

  199. System Design · from On sale day, our one server hit 100% and the shop went down · Think it through, then compare answers

    Topics: Vertical vs horizontal scaling; Object storage

  200. System Design · from On sale day, our one server hit 100% and the shop went down · Think it through, then compare answers

    Topics: Vertical vs horizontal scaling; Replication

  201. System Design · from Our orders are fine, but the activity feed has two billion rows · Think it through, then compare answers

    Topics: SQL vs NoSQL

  202. System Design · from Our orders are fine, but the activity feed has two billion rows · Think it through, then compare answers

    Topics: SQL vs NoSQL

  203. System Design · from Our orders are fine, but the activity feed has two billion rows · Think it through, then compare answers

    Topics: SQL vs NoSQL; Partitioning and consistent hashing

  204. System Design · from Design a URL shortener · Think it through, then compare answers

    Topics: Case studies: URL shortener, rate limiter, chat, news feed, video, ride-hailing, payments and more; Object storage

  205. System Design · from Design a URL shortener · Think it through, then compare answers

    Topics: Queues and pub/sub; Batch vs stream processing

  206. System Design · from Design a URL shortener · Think it through, then compare answers

    Topics: Rate-limiting algorithms

  207. System Design · from Design a URL shortener · Think it through, then compare answers

    Topics: Multi-region and disaster recovery; Unique ID generation

  208. Frameworks · from The browser blocked my front end from calling my own API · Tests run here

    Topics: CORS and CSRF

  209. Frameworks · from The browser blocked my front end from calling my own API · Tests run here

    Topics: CORS and CSRF

  210. Frameworks · from The browser blocked my front end from calling my own API · Tests run here

    Topics: CORS and CSRF

  211. Frameworks · from The note form showed one mistake at a time, and saved spaces as a title · Tests run here

    Topics: Django: apps, MTV, views, the ORM, migrations, admin, forms, middleware, auth

  212. Frameworks · from The note form showed one mistake at a time, and saved spaces as a title · Tests run here

    Topics: Django: apps, MTV, views, the ORM, migrations, admin, forms, middleware, auth

  213. Frameworks · from The note form showed one mistake at a time, and saved spaces as a title · Tests run here

    Topics: Django: apps, MTV, views, the ORM, migrations, admin, forms, middleware, auth

  214. Frameworks · from The order list page is slow · N+1 queries · Think it through, then compare answers

    Topics: Django ORM performance: N+1, select_related, prefetch_related

  215. Frameworks · from The order list page is slow · N+1 queries · Think it through, then compare answers

    Topics: Django ORM performance: N+1, select_related, prefetch_related

  216. Frameworks · from The order list page is slow · N+1 queries · Think it through, then compare answers

    Topics: Django ORM performance: N+1, select_related, prefetch_related

  217. Frameworks · from The order list page is slow · N+1 queries · Think it through, then compare answers

    Topics: Django ORM performance: N+1, select_related, prefetch_related; Django REST Framework: serializers, viewsets, permissions, throttling, pagination

  218. Frameworks · from A user made someone else the owner of a note by adding one field to the JSON · Tests run here

    Topics: Django REST Framework: serializers, viewsets, permissions, throttling, pagination

  219. Frameworks · from A user made someone else the owner of a note by adding one field to the JSON · Tests run here

    Topics: Django REST Framework: serializers, viewsets, permissions, throttling, pagination

  220. Frameworks · from A user made someone else the owner of a note by adding one field to the JSON · Tests run here

    Topics: Django REST Framework: serializers, viewsets, permissions, throttling, pagination

  221. Frameworks · from Every request opened two database sessions, and closed none · Tests run here

    Topics: FastAPI: parameters, Pydantic v2, response models, dependency injection, routers

  222. Frameworks · from Every request opened two database sessions, and closed none · Tests run here

    Topics: FastAPI: parameters, Pydantic v2, response models, dependency injection, routers

  223. Frameworks · from Every request opened two database sessions, and closed none · Tests run here

    Topics: FastAPI: parameters, Pydantic v2, response models, dependency injection, routers

  224. Frameworks · from My Flask tests pass one at a time, and fail together · Tests run here

    Topics: Flask: routing, contexts, blueprints, app factory, config, Jinja2, SQLAlchemy, testing

  225. Frameworks · from My Flask tests pass one at a time, and fail together · Tests run here

    Topics: Flask: routing, contexts, blueprints, app factory, config, Jinja2, SQLAlchemy, testing

  226. Frameworks · from My Flask tests pass one at a time, and fail together · Tests run here

    Topics: Flask: routing, contexts, blueprints, app factory, config, Jinja2, SQLAlchemy, testing

  227. Frameworks · from My app said “Saved” when nothing was saved · Tests run here

    Topics: HTTP methods and status codes

  228. Frameworks · from My app said “Saved” when nothing was saved · Tests run here

    Topics: HTTP methods and status codes

  229. Frameworks · from My app said “Saved” when nothing was saved · Tests run here

    Topics: HTTP methods and status codes

  230. Frameworks · from The second deploy crashed: table notes already exists · Tests run here

    Topics: ORMs and migrations

  231. Frameworks · from The second deploy crashed: table notes already exists · Tests run here

    Topics: ORMs and migrations

  232. Frameworks · from The second deploy crashed: table notes already exists · Tests run here

    Topics: ORMs and migrations

  233. Frameworks · from Someone typed a quote into our search box and read other users’ notes · Tests run here

    Topics: Top OWASP risks: injection, XSS, broken authentication

  234. Frameworks · from Someone typed a quote into our search box and read other users’ notes · Tests run here

    Topics: Top OWASP risks: injection, XSS, broken authentication

  235. Frameworks · from Someone typed a quote into our search box and read other users’ notes · Tests run here

    Topics: Top OWASP risks: injection, XSS, broken authentication

  236. Frameworks · from Our error pages lost their security headers · Tests run here

    Topics: The request lifecycle

  237. Frameworks · from Our error pages lost their security headers · Tests run here

    Topics: The request lifecycle

  238. Frameworks · from Our error pages lost their security headers · Tests run here

    Topics: The request lifecycle

  239. Frameworks · from The same note showed up twice as I scrolled · Tests run here

    Topics: REST design

  240. Frameworks · from The same note showed up twice as I scrolled · Tests run here

    Topics: REST design

  241. Frameworks · from The same note showed up twice as I scrolled · Tests run here

    Topics: REST design

  242. Frameworks · from Users are logged out at random behind the load balancer · Tests run here

    Topics: Sessions, JWT and OAuth2

  243. Frameworks · from Users are logged out at random behind the load balancer · Tests run here

    Topics: Sessions, JWT and OAuth2

  244. Frameworks · from Users are logged out at random behind the load balancer · Tests run here

    Topics: Sessions, JWT and OAuth2

  245. Frameworks · from 200 open chats froze my Flask server · Tests run here

    Topics: WSGI vs ASGI

  246. Frameworks · from 200 open chats froze my Flask server · Tests run here

    Topics: WSGI vs ASGI

  247. Frameworks · from 200 open chats froze my Flask server · Tests run here

    Topics: WSGI vs ASGI

  248. AI Engineering · from The chatbot doesn’t know your docs · RAG · Think it through, then compare answers

    Topics: RAG basics: why, chunking, embedding, top-k

  249. AI Engineering · from The chatbot doesn’t know your docs · RAG · Think it through, then compare answers

    Topics: Advanced RAG: hybrid search, reranking, query rewriting, metadata filters, GraphRAG, agentic RAG; Vector databases and ANN indexes: HNSW, IVF, PQ

  250. AI Engineering · from The chatbot doesn’t know your docs · RAG · Think it through, then compare answers

    Topics: Why models hallucinate; RAG basics: why, chunking, embedding, top-k

  251. AI Engineering · from The chatbot doesn’t know your docs · RAG · Think it through, then compare answers

    Topics: Advanced RAG: hybrid search, reranking, query rewriting, metadata filters, GraphRAG, agentic RAG; Safety: prompt injection, jailbreaks, data leakage and PII

  252. Scenarios · from p95 latency tripled after a deploy · Think it through, then compare answers

    Topics: The error rate jumped

  253. Scenarios · from p95 latency tripled after a deploy · Think it through, then compare answers

    Topics: Production: memory leak, DB CPU at 100%, deadlocks, disk full, intermittent 502s; A 40-second report, duplicate rows, dashboards that disagree

  254. Scenarios · from p95 latency tripled after a deploy · Think it through, then compare answers

    Topics: Production: memory leak, DB CPU at 100%, deadlocks, disk full, intermittent 502s

  255. Scenarios · from p95 latency tripled after a deploy · Think it through, then compare answers

    Topics: Cache stampede and queue backlog

  256. Interview Playbook · from The coding round, step by step · Think it through, then compare answers

    Topics: The coding-round method: clarify, examples, brute force, optimize, code, test, analyze

  257. Interview Playbook · from The coding round, step by step · Think it through, then compare answers

    Topics: The coding-round method: clarify, examples, brute force, optimize, code, test, analyze

  258. Interview Playbook · from The coding round, step by step · Think it through, then compare answers

    Topics: The coding-round method: clarify, examples, brute force, optimize, code, test, analyze

  259. Interview Playbook · from The coding round, step by step · Think it through, then compare answers

    Topics: The coding-round method: clarify, examples, brute force, optimize, code, test, analyze