Shoring Up Weak Points + a Coding Warm-Up: Rate Limiter, LRU, Concurrency Control, Streaming JSON Parsing
Do targeted work on the weak points listed on day 28, while warming up on four frequently asked coding problems: a rate limiter, an LRU cache, concurrency control, and streaming JSON parsing.
Today's Goals
- Work through day 28's weak-point list item by item and record the improvement
- Independently implement a rate limiter and an LRU cache
- Implement a simple concurrency controller and a streaming JSON parser
Yesterday's two mock interviews produced not "it felt fine" but a four-column weak-point list. Today learns nothing new and does two things: work that list item by item, and drill the four coding problems most likely to appear on a whiteboard until you can write them from memory.
Plain-Language Walkthrough
It is always the same two bars: practice them slowly in isolation, not from the top
Anybody who has learned an instrument knows this scene: two weeks into a piece, the mistake is always the key change in bars 17 to 18. So you play the whole thing ten more times — the piece sounds smoother and those two bars are still wrong.
The reason is plain: ten runs from the top means ten more repetitions of the parts already right and ten more of the part that is wrong. Muscle memory does not distinguish right from wrong, it counts repetitions. What works is isolating those two bars, halving the tempo, watching your fingers for 20 repetitions, and only then putting them back into the piece. That is slow sectional practice.
A vague review is playing the whole thing ten more times. Paging through thirty days of notes from D1 to D28 gives you a reassuring sense of having covered it, and tomorrow you will still stumble where you stumbled yesterday. So today's work must land on yesterday's list.
The list keeps its four columns, and do not rename them — symptom, root cause, smallest practice action, how to verify. Here is a row you very likely wrote yesterday:
| Symptom | Root cause | Smallest practice action | How to verify |
|---|---|---|---|
| Eight minutes into describing mini-koda without saying what I did | told the development chronologically with no conclusion first | write a 90-second project opening — one line of positioning, one on the hardest point, one on the result — and rehearse it | time a recording; finish within 90 seconds with no notes |
Why that row passes: the symptom is observable (that figure of 8 minutes), the root cause points at one concrete habit, the action is small enough (a 90-second passage, not "practice communication"), and the verification yields a yes or no on the spot. The third column is the easiest to water down — "practice the project walkthrough a few more times" is not a smallest action, and "write a 90-second opening and rehearse it" is. Slowing down and isolating both live in that column.
The order matters too: fix what one repetition can improve before what needs accumulated time. Stumbling in the self-introduction, a missing R in STAR, and drawing before clarifying in system design can all be fixed today; "rusty on algorithms" only yields to actually typing them out this afternoon.
So why exactly a rate limiter, LRU, concurrency control, and streaming JSON parsing? Because they were not drawn at random from a problem site — those four happen to be the archetypes of what you built over these thirty days, each connected to a production scenario you already understand. More importantly, standard answers are everywhere online, and what separates candidates was never the code. So the four sections below cover four things each: what the interviewer is really testing, the complexity you should volunteer, three edge cases, and the alternative implementation you gave up.
Interview questions
What are the common rate limiting algorithms, what are their trade-offs, and which one would you actually ship?限流器有哪几种常见算法?各自的优缺点是什么?如果只能落地一种,你选哪个?
Common in ChinaCommon overseasBasic#rate-limiting#concurrency🔒 Unlock this chapter to see the answer keys.
How would you build a scheduler that caps in-flight async tasks, and why is Promise.all or asyncio.gather not enough?怎么实现一个限制并发数的调度器?为什么不能直接用 Promise.all 或者 asyncio.gather?
Common in ChinaCommon overseasIntermediate#concurrency#async🔒 Unlock this chapter to see the answer keys.
Why can't you just call JSON.parse in a streaming response, and how would you parse incrementally?为什么流式场景下不能直接用 JSON.parse?你会怎么做增量解析?
Common in ChinaCommon overseasDeep dive#streaming#json-parsing🔒 Unlock this chapter to see the answer keys.
