Kacam.net

System design

秒杀 / 限时抢购

一秒钟涌进来十万个人,只有一百件货。

Copy the prompt, then pick a model. It plays the interviewer and asks you through it scene by scene instead of handing you the answer.

On a phone with the app installed, the system opens the app directly. Links cannot open external apps inside WeChat — open it in a browser first.

The copied text ends with the answer key the model grades you against. Don't read it yourself first — working it out on your own is the point.

矛盾很集中:所有请求都打在同一行库存上。绕开它的办法有好几种,每一种都要付代价。

这道题几乎一定会被追到「宁可少卖还是宁可超卖」上,而那是个业务判断,不是技术问题 —— 看的是你会不会反问需求,而不是会不会背方案。

★★★★☆ · about 45 min · Tests: 热点写、缓存与 DB 一致性、幂等、削峰、超卖 vs 少卖

Cross-cutting patterns this one leans on

Idempotency Consistency and compensation Caching Rate limiting, shedding, breaking, degrading Hotspots and data skew Message queues

Have you done this one?

Sign in to mark this one as practised — next time you come back you'll see when you did it.

Notes from people who did this one

Nobody has written yet. After you run it, say what came out of the conversation — which scene stumped you, which conclusion you changed afterwards.

Sign in to write a note.

How to use this

How to start

  1. Pick a question, open it, copy the prompt.
  2. Paste it into a brand-new conversation — not one where you already discussed this question, or the model follows your old answers.
  3. Say nothing. Wait for its first question.

Four commands you can call out at any time

  • 跳过 move to the next scene now
  • 提示 give a direction, not the answer
  • 直说吧 spell this point out in full, then keep pressing on the trade-offs
  • 复盘 jump to the wrap-up and print the review card

Three traps

  • Don't do two questions in one conversation — context from the first makes the model prejudge your level.
  • Don't look up the answer the moment it asks. Being stuck for 30 seconds is itself useful information.
  • When it starts praising you, point it back to rule five — feeling validated crowds out noticing what you missed.

Suggested order: start with the cross-cutting drill as a parts test, use the short-link question to get used to the flow, then pick by the direction you interview for, and keep redoing the one about your own project.