20. Probabilistic Data Structures
Interview questions
Interview questions (with the counter-questions you'll get)
Q1. What is a Bloom filter, and when would you use one?
They're testing: the most-asked probabilistic structure.
Think about your answer first, then open it.
Q2. Can you delete from a Bloom filter?
They're testing: depth beyond the basics.
Think about your answer first, then open it.
Q3. How would you count unique visitors per day for a site with millions of users?
They're testing: HyperLogLog and its trade-off.
Think about your answer first, then open it.
Q4. Explain how HyperLogLog works.
They're testing: the intuition.
Think about your answer first, then open it.
Q5. What is a count-min sketch?
They're testing: frequency estimation.
Think about your answer first, then open it.
Q6. Design trending hashtags or trending searches.
They're testing: applying top-K in a system.
Think about your answer first, then open it.
Q7. How do LSM-tree databases use Bloom filters?
They're testing: linking to storage internals.
Think about your answer first, then open it.
Q8. Your Bloom filter's false-positive rate in production is 40%, not 1%. Why?
They're testing: operational understanding.
Think about your answer first, then open it.
Q9. When should you not use a probabilistic structure?
They're testing: judgement.
Think about your answer first, then open it.
Q10. How would a web crawler avoid re-crawling the same URLs, at billions of URLs?
They're testing: a classic application.
Think about your answer first, then open it.