Hello Interview (@_hellointerview) header
Hello Interview (@_hellointerview) profile picture

Where top software engineers prepare for interviews

Joined May 2023
Photo by Hello Interview (@_hellointerview)Photo by Hello Interview (@_hellointerview)Photo by Hello Interview (@_hellointerview)Photo by Hello Interview (@_hellointerview)Photo by Hello Interview (@_hellointerview)Photo by Hello Interview (@_hellointerview)Photo by Hello Interview (@_hellointerview)Photo by Hello Interview (@_hellointerview)Photo by Hello Interview (@_hellointerview)Photo by Hello Interview (@_hellointerview)
A more granular key can spread that work. But events that used to share a partition may now be processed independently. You need to decide whether the original ordering guarantee is required before changing the key.
1
121
Kafka uses the message key to choose a partition. That's useful when related events need ordering: all events for one game can go to the same partition. It also means a hugely popular game can concentrate work in one place.
1
114
Your Kafka cluster has spare capacity, but one partition is drowning in traffic. Adding brokers won't spread a single hot key across them. Look at your partition key.
2
5
56
1,457
B-trees, hash indexes and R-trees each answer a different question, and the wrong one is worse than none because you pay the write penalty without the read benefit.
1
2
253
An index is a tradeoff you make on purpose: storage and slower writes in exchange for faster reads. Candidates who add indexes without naming that cost get asked about it.
2
78
2,574
Cursors matter more than they sound. Offset pagination over a live index shows people duplicates and skips.
1
5
748
The parts that actually come up are the ones after the match: how filtering narrows the candidate set, how sorting works without loading every document, and how you paginate a result set that keeps changing underneath you.
1
1
9
776
Elasticsearch turns up in almost every design that involves search, and most candidates can say inverted index and then stop.
2
4
140
7,649
So replicas are for when the primary's CPU is the bottleneck. Caches are for when the query itself is expensive and staleness is acceptable.
1
2
148
A replica takes load off the primary and gives you the same data a few milliseconds late. A cache takes the query away entirely and gives you sub-millisecond reads of data that may be much older.
1
2
186
Read replicas and Redis are the two everyone names. They are not interchangeable and they do not solve the same problem.
1
3
55
1,906
Base64 would be shorter but two of its characters break in a URL. A slash is a path separator and a plus sign reads as a space in a query string.
1
2
226
Hash the canonical URL and encode the output in base62. Eight characters gives you 62^8, roughly 218 trillion codes.
1
1
232
Taking the first 8 characters of a URL as its short code collapses linkedin.com/in/evan-king and linkedin.com/in/stefanmai onto the same code. The redirect then has no idea where to send anyone.
1
20
1,351