
Where top software engineers prepare for interviews
Joined May 2023
- Tweets986
- Following2
- Followers5.2K
- Likes53
Your cache entry expires and ten thousand requests hit the database in the same instant. That is a stampede, and the cache working correctly is what caused it.
Everything after that is a pipeline: transcode into renditions, generate thumbnails, build manifests, push to the CDN. None of it blocks the upload finishing.
1
1
229
All five stages, end to end: hellointerview.com/twitter/y…
69
B-tree is the default and the right answer most of the time. Hash when you only ever do exact lookups. Inverted when you need search. Picking wrong costs orders of magnitude on the read you cared about.
Every index is also a write tax, which is why adding one without saying what it costs gets you a follow-up.
1
6
687
How each type works and where each one stops helping: youtube.com/watch?v=338NIkny…
2
827
Save the order, then publish to Kafka so the warehouse ships it. If the save succeeds and the Kafka publish fails, you've got an order that never ships. The transactional outbox fixes this.
The worker can publish an event and crash before marking it done, so it publishes again on restart. Consumers have to handle duplicates. You trade exactly-once for at-least-once and lean on your DB's transaction guarantees for the hard part.
1
513
Full breakdown: hellointerview.com/twitter/t…
2
333
