Review cards · 16 cards
Data structures
Bloom filters, HyperLogLog, count-min sketches, geohashes and other tools of scale.
Cards
- A geohash turns a latitude and longitude into a short string. Points that share a longer _____ are in the same, smaller cell, so a database can find nearby points with a _____ query on an ordinary index.
- Which structure estimates how many requests each of millions of IP addresses has made, in fixed memory?
- A search engine keeps, for each word, the list of documents that contain it. This structure is an _____.
- A game needs a live leaderboard for 10 million players: the top 100 and any player's rank, updated on every score. What fits best?
- How can you track exactly which of 100 million users were active each day, in little memory?
- A Bloom filter says a key "might be present" or "is definitely not present". Which mistake can it make?
- A Bloom filter for 100 million keys with a 1% false-positive rate needs about 9.6 bits per key. How much memory is that?
- What does a count-min sketch estimate, and in which direction is it wrong?
- You need a compact "is this key in the set?" filter like a Bloom filter, but keys must also be deleted. What fits?
- To find drivers near a rider, you look up the rider's geohash cell. Why must you also search the neighbouring cells?
- You need the number of unique visitors per page, for billions of visits. What data structure fits, and what does it trade?
- In a _____, every parent holds a hash of its children's hashes. Two replicas compare their _____ hashes first and descend only into the subtrees whose hashes differ.
- When would you pick a quadtree over a fixed geohash grid?
- How does a trie make autocomplete fast enough for every keystroke?
- What is a skip list, and where is it used?
- How do you track the top 100 hashtags in a stream with millions of distinct tags, in bounded memory?
More topics
- Estimation 21 cards
- Networking 16 cards
- API design 17 cards
- Caching 21 cards
- Databases 22 cards
- Replication 15 cards
- Sharding 18 cards
- Consistency 19 cards
- Queues 18 cards
- Streaming 18 cards
- Availability 14 cards
- Resilience 16 cards
- Storage 14 cards
- Realtime 15 cards
- Security 17 cards
- Observability 18 cards
- Coordination 16 cards