interview-reps 0.4.0 → 0.5.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (30) hide show
  1. package/README.md +1 -0
  2. package/content/CLAUDE.md +3 -1
  3. package/content/assessments/A01-library-desk/README.md +13 -0
  4. package/content/assessments/A01-library-desk/level-1.md +17 -0
  5. package/content/assessments/A01-library-desk/level-2.md +16 -0
  6. package/content/assessments/A01-library-desk/level-3.md +16 -0
  7. package/content/assessments/A01-library-desk/level-4.md +15 -0
  8. package/content/assessments/A02-ticket-counter/README.md +16 -0
  9. package/content/assessments/A02-ticket-counter/level-1.md +18 -0
  10. package/content/assessments/A02-ticket-counter/level-2.md +16 -0
  11. package/content/assessments/A02-ticket-counter/level-3.md +16 -0
  12. package/content/assessments/A02-ticket-counter/level-4.md +16 -0
  13. package/content/assessments/REVIEW.md +70 -0
  14. package/content/behavioral/QUESTIONS.md +44 -0
  15. package/content/behavioral/REVIEW.md +41 -4
  16. package/content/design/D13-video-streaming/README.md +21 -0
  17. package/content/design/D14-ticket-booking/README.md +20 -0
  18. package/content/design/D15-ad-click-aggregator/README.md +20 -0
  19. package/content/design/D16-distributed-key-value-store/README.md +21 -0
  20. package/content/design/D17-collaborative-document-editor/README.md +20 -0
  21. package/content/design/D18-ai-assistant-on-a-budget/README.md +21 -0
  22. package/content/design/D19-going-multi-region/README.md +20 -0
  23. package/content/design/D20-checkout-at-10x-load/README.md +20 -0
  24. package/content/design/D21-webhook-delivery/README.md +20 -0
  25. package/content/design/D22-game-leaderboard/README.md +20 -0
  26. package/content/design/D23-discovery-recommendations/README.md +21 -0
  27. package/content/design/D24-splitting-a-shared-database/README.md +20 -0
  28. package/content/design/REVIEW.md +22 -0
  29. package/dist/cli.mjs +2155 -675
  30. package/package.json +1 -1
@@ -0,0 +1,20 @@
1
+ # D20 · Checkout at 10x load
2
+
3
+ Category: Infrastructure · Level: advanced · Time: 45 min
4
+
5
+ An online shop's checkout works today: web servers behind a load balancer, one main relational database with two read copies, a shared cache for product and price data, and a call to an outside payment provider for each order. A sale has brought ten times the usual traffic, and checkout is failing. Decide what to change today to get through the sale, and what to change this quarter so it doesn't happen again.
6
+
7
+ Before you design, find out the usual and current load, what the dashboards show for each part, which failures customers are seeing, what the payment provider allows, how long the sale lasts, and which parts of checkout matter most to the business.
8
+
9
+ ## If you ask
10
+
11
+ - Usually 2,000 checkouts per minute; now 20,000, for another 6 hours. Product page views are up 15x.
12
+ - The main database is at 95% CPU and its connections are used up; query times have gone from 5 ms to 2 seconds. The read copies are 40 seconds behind.
13
+ - The cache hit rate has dropped from 98% to 70% since prices were changed for the sale. Web servers are at 40% CPU but many requests time out after 30 seconds.
14
+ - The payment provider allows 500 calls per second and takes about 1 second per call. Some customers are charged but see an error page, and retry.
15
+ - No order may be lost or charged twice. The team can deploy small changes within an hour; nothing can be rebuilt today.
16
+
17
+ ## Follow-ups
18
+
19
+ - The sale ends. Name the measurements you would alert on so the team hears about this before customers do next time.
20
+ - Next year's sale is expected to bring 50x. Which of today's changes still hold, and which don't?
@@ -0,0 +1,20 @@
1
+ # D21 · Webhook delivery
2
+
3
+ Category: Infrastructure · Level: core · Time: 45 min
4
+
5
+ A software company lets its customers register a web address, and sends an HTTP request there whenever something happens in their account (an invoice is paid, a user signs up). Design the service that delivers these events. Customers' servers are outside your control: some are slow, some are down for days, and some return errors.
6
+
7
+ Before you design, find out how many events and customers there are, how quickly events must be delivered, whether order matters, what happens when a customer's server is down, how customers know an event really came from you, and what they can see about past deliveries.
8
+
9
+ ## If you ask
10
+
11
+ - 200,000 customers with 500,000 registered addresses; about 1 billion events a day, peaking at 50,000 per second.
12
+ - Most events should arrive within a few seconds. A customer whose server is down must still get every event once it recovers, for up to 3 days.
13
+ - Customers expect events about the same object (one invoice) to arrive in the order they happened.
14
+ - Customers can see each delivery attempt and its result, and can ask for events from a time range to be sent again.
15
+ - Out of scope: the systems that create the events, and customers' servers.
16
+
17
+ ## Follow-ups
18
+
19
+ - One large customer's server starts taking 30 seconds to respond to every request. What happens to everyone else's deliveries?
20
+ - A customer accidentally registers an address that points at one of your own internal services. What could go wrong, and what changes?
@@ -0,0 +1,20 @@
1
+ # D22 · Game leaderboard
2
+
3
+ Category: Social · Level: core · Time: 45 min
4
+
5
+ Design the leaderboard for a mobile game. Players earn points after each match and can see the top players, their own rank and their friends' ranks. A new board starts every Monday.
6
+
7
+ Before you design, find out how many players there are and how many matches end per second, how quickly a new score must show in the rankings, which views players open most, how ties are broken, and whether past weeks are kept.
8
+
9
+ ## If you ask
10
+
11
+ - 50 million weekly players and up to 30,000 matches finishing per second at peak, each adding points to one player's score.
12
+ - Players see the top 100, their own exact rank (for example 4,381,207th), and the ranks of up to 500 friends.
13
+ - A new score should appear in the rankings within a few seconds. Ties go to whoever reached the score first.
14
+ - The board resets every Monday at 00:00 UTC, and each past week's final top 1,000 is kept for a year.
15
+ - Out of scope: matchmaking, detecting cheating, and rewards.
16
+
17
+ ## Follow-ups
18
+
19
+ - The game launches separate boards for each of 200 countries and each of 10 skill levels. What changes?
20
+ - Cheaters are found after the week has ended, and their scores must be removed. What happens to everyone else's final ranks?
@@ -0,0 +1,21 @@
1
+ # D23 · Discovery recommendations
2
+
3
+ Category: ML · Level: advanced · Time: 45 min
4
+
5
+ A shopping app adds a "For you" shelf on its home screen, showing items each person is likely to want. People don't follow anyone, so the shelf must pick from the whole catalogue using what each person has viewed, searched and bought, including what they did a few minutes ago.
6
+
7
+ Before you design, find out how many people and items there are, how many items the shelf shows, how quickly it must load, how soon a new action should change it, how often the catalogue changes, and how success is measured.
8
+
9
+ ## If you ask
10
+
11
+ - 80 million daily users and 50 million items for sale; about 2 million items are added or sold out each day.
12
+ - The shelf shows 20 items and must load within 200 ms. It is opened about 400 million times a day.
13
+ - Something a person views or buys should change their shelf within a minute.
14
+ - A data science team supplies models that score how likely a person is to buy an item; they are too slow to score more than a few thousand items per request.
15
+ - Success is measured as purchases from the shelf. Out of scope: how the models are trained, and ads.
16
+
17
+ ## Follow-ups
18
+
19
+ - A new user opens the app for the first time. What do they see, and why?
20
+ - Shoppers complain the shelf keeps showing items they have already bought. What changes?
21
+ - The team wants to compare two versions of the shelf on live traffic. What does the system need?
@@ -0,0 +1,20 @@
1
+ # D24 · Splitting a shared database
2
+
3
+ Category: Data · Level: advanced · Time: 45 min
4
+
5
+ Two teams at an online shop, orders and catalogue, share one large relational database, and they keep slowing each other down. Plan and design moving all order data into a store of its own while the shop keeps taking orders, with a way back at every step if something goes wrong.
6
+
7
+ Before you design, find out how much order data there is and how fast it changes, which other code reads or writes the order tables, which queries join order and catalogue data, how much downtime is acceptable, and how you would know the two copies agree.
8
+
9
+ ## If you ask
10
+
11
+ - 15 TB of order data in 40 tables, with 5,000 writes per second at peak. The catalogue tables are 3 TB.
12
+ - About 30 services read the order tables directly, and several reports join orders with products in a single query.
13
+ - The shop may never stop taking orders, and no order may be lost or duplicated. A few seconds of slower responses are acceptable.
14
+ - The orders team owns the work and has six months. Every step must be reversible until the very last one.
15
+ - Out of scope: redesigning how orders work, and choosing a vendor for the new store.
16
+
17
+ ## Follow-ups
18
+
19
+ - Two weeks after the switch, finance finds that some refunds recorded during the move are missing from the new store. What happens now?
20
+ - Halfway through, the catalogue team asks to split their tables out the same way. What changes?
@@ -15,6 +15,21 @@ gap and the question they should ask themselves next time.
15
15
 
16
16
  Do not run commands and do not write files: print the review only.
17
17
 
18
+ ## The whiteboard
19
+
20
+ In the hub, an attempt can come with a whiteboard: components with their settings (replicas, sizes,
21
+ cache expiry, replicas and shards), arrows along the request path, group boxes and notes, given to you
22
+ as text with an id in [brackets] for each item. Pen drawings can't be read as text and are only counted.
23
+
24
+ - Read the board as part of the design, mainly for **high-level** and **deep-dive**: does every
25
+ requirement have a path on it, and does it hold at the person's own estimated load?
26
+ - Say where the board and the notes disagree (a component in one and not the other, a setting that
27
+ contradicts an estimate).
28
+ - Quote their own settings and labels, as you would quote their notes. Still never name the
29
+ component, setting or technique that would fix a gap.
30
+ - Attempts without a board are reviewed on the notes alone, as before. Never mark one down for having
31
+ no board.
32
+
18
33
  ## Scores
19
34
 
20
35
  Score each dimension 1 to 4, with a one-line reason that points at their own notes (quote a few
@@ -81,6 +96,13 @@ Gaps: <tags, or none>
81
96
  Next time: <one concrete habit for the next run>
82
97
  ```
83
98
 
99
+ When the attempt has a whiteboard, add one more header line right under `Next time`, so the hub can
100
+ outline what each reason is about:
101
+
102
+ ```
103
+ Board: <part> <ids>; <part> <ids> (for example: deep-dive n3 n5; trade-offs n5), or none
104
+ ```
105
+
84
106
  Then, briefly:
85
107
 
86
108
  1. **Scores, one line each**: the dimension, the score, the reason from their notes.