Practical Algorithms for Engineers: Bloom Filters, Approximate Nearest-Neighbor & Performance

Episode 1 64 min

Marcello La Rocca Senior software engineer at Tundra.com

Episode 1 · Practical Algorithms for Engineers: Bloom Filters, Approximate Nearest-Neighbor & Performance

64 min

What we talked about

Marcello La Rocca is a senior software engineer at Tundra, an online shop. He has worked as a web developer and on data infrastructure at Twitter, Microsoft and Apple, and he is the author of Advanced Algorithms and Data Structures. Alexey asks him how people can learn algorithms without using them every day at work, and about the Bloom filters and approximate nearest- neighbour search covered in the book.

Marcello says learners should focus on what an algorithm solves and when to use it, rather than on memorising it or on mathematical proofs. He recommends MIT's video lectures, Tim Roughgarden's Coursera course and Grokking Algorithms. He stresses basic structures such as arrays, lists, sets, stacks and queues, and says it helps to know each API and roughly how it is implemented. He disagrees with web developers who think they do not need algorithms, since using a list for containment checks instead of a set can slow an application badly. To practise outside work, he suggests competitions such as Google Code Jam and profiling applications to find bottlenecks that a known algorithm can fix.

The book bridges textbook theory and hands-on use, with a real use case for each structure. Marcello explains that a Bloom filter tests membership in fixed memory, at the cost of rehashing and occasional false positives. In a crawler, a false positive only means a page is processed again. Alexey describes an adtech project that used Bloom filters to find returning users by device ID, where a false positive meant showing an unneeded ad. For nearest-neighbour search, Marcello says binary search trees do not generalise to multi-dimensional data, and KD-trees struggle with high dimensions. R-trees and SS-trees allow approximate search, which is often good enough. Alexey describes an OLX recommender that compares 16-dimensional vectors using Faiss, and Marcello calls it a perfect use case.

On libraries, Marcello says you usually need the contract and guarantees rather than the internals, and you look inside to tune performance or to customise. Alexey's team reimplemented Bloom filters so that Python, Java, Go and JavaScript could read the same serialised filters with matching hash seeds. On interviews, Marcello says algorithm-only questions miss skills like Git and debugging, and Alexey calls a Facebook interview with two problems in 35 minutes too cruel. Marcello sees Python as ideal for data science and C++ for production performance, and Alexey notes Cython keeps code in Python while gaining native speed.

Chapters

  1. 1:51 Guest Intro: Marcello La Rocca and book announcement 1 min
  2. 3:11 Career Path: web development to Twitter, Microsoft, Apple, Tundra 2 min
  3. 5:19 Learning Philosophy: focus on applications over formal proofs 2 min
  4. 7:30 Anecdote: mathematical proof vs practical innovation 2 min
  5. 9:23 Recommended Resources: MIT course, Tim Roughgarden, Grokking Algorithms 1 min
  6. 10:34 Core Data Structures: arrays, lists, sets, dictionaries, stacks, queues 2 min
  7. 12:17 Abstraction vs Implementation: APIs, performance trade-offs 4 min
  8. 15:57 Practicing Algorithms Outside Work: competitions and side projects 3 min
  9. 19:14 Using Libraries & Profiling: spotting algorithmic wins in production 1 min
  10. 20:14 Performance Pitfalls: containment checks and wrong list usage 2 min
  11. 22:12 Data-Science Use Cases: Bloom filters and nearest-neighbour search 1 min
  12. 23:39 Book Overview: bridging theory and practical use cases 1 min
  13. 25:04 Book Structure: basics, nearest-neighbour & MapReduce, graphs & optimization 1 min
  14. 26:31 Prerequisites & Format: appendices, pseudocode, who the book is for 2 min
  15. 28:37 Code Repository: implementations in Java, JavaScript, Python (and more) 2 min
  16. 30:09 Bloom Filter Explained: memory-efficient containment with false positives 5 min
  17. 34:43 Bloom Filter Applications: crawlers, routing tables, marketing/adtech 1 min
  18. 35:59 Adtech Example: device IDs and returning-user targeting with Bloom filters 3 min
  19. 39:10 Nearest-Neighbour Need: KD-tree limits and high-dimensional data challenges 4 min
  20. 42:44 Approximate Nearest-Neighbour: R-trees, SS-trees for geolocation & logistics 2 min
  21. 44:46 Vector Similarity: embeddings, recommender systems, Faiss usage 3 min
  22. 47:47 Frameworks vs Internals: when to trust libraries and when to inspect them 2 min
  23. 49:52 Cross-language Compatibility: serializing Bloom filters and hash seeds 3 min
  24. 52:55 Tech Interviews: algorithm emphasis, balanced assessment approaches 6 min
  25. 58:53 Hands-on Learning: LeetCode, contests, open-source projects 2 min
  26. 1:00:39 Language Trade-offs: Python vs C++ and using Cython for performance 2 min
  27. 1:03:01 Closing: contact info and book links 1 min

Marcello La Rocca Senior software engineer at Tundra.com

Marcello La Rocca is a senior software engineer at Tundra.com and the author of Advanced Algorithms and Data Structures (Manning). His work and interests span graphs, optimization algorithms, genetic algorithms, machine learning, and quantum computing. He has contributed to large-scale web applications at Twitter, Microsoft, and Apple, worked on data infrastructure and applied research in both academia and industry, and authored the Neatsort adaptive sorting algorithm.

Topics in this episode

The wiki pages this conversation is filed under, the strongest first.

Software Engineering

How software engineering discipline shapes data, ML, and AI systems through testing, interfaces, deployment, and maintainability.

Competitions Beyond Kaggle

How to use non-Kaggle competitions as portfolio evidence through reproducible code, evaluation notes, research challenges, and honest limits.

Data Scientist Interview Prep

Prepare for data scientist interviews with role targeting, CV evidence, recruiter screens, technical rounds, case studies, and offer questions.

Embeddings

Embeddings as representations for semantic search, RAG, recommendations, multimodal retrieval, and language systems.

Evolutionary Algorithms

How evolutionary algorithms connect to game AI, evolutionary deep learning, prompt search, optimization, and agent systems.

Information Retrieval

Information retrieval as the design of retrieval units, indexes, candidate generation, prefilters, and the handoff to ranking or generation.

ML for Software Engineers

A roadmap for software engineers moving into ML: transferable skills, missing data habits, project sequence, production awareness, and interviews.

Vector Databases

Vector databases as the storage, indexing, and nearest-neighbor retrieval layer for embeddings.

Related books

Software Mistakes and Tradeoffs

10 questions answered

In Software Mistakes and Tradeoffs you’ll learn from costly mistakes that Tomasz Lelek and Jon Skeet have encountered over their impressive careers. You’ll explore real-world scenarios where poor understanding of tradeoffs lead to major problems down the road, to help you make better design decisions. Plus, with a little practice, you’ll be able to avoid the pitfalls that trip up even the most experienced developers.

Tomasz Lelek Jon Skeet

Street Coder

12 questions answered

Software development isn't an "ivory tower" exercise. Street coders get the job done by prioritizing tasks, making quick decisions, and knowing which rules to break.

Sedat Kapanoglu

Optional analytics

Optional analytics are off unless you allow them. Your choice does not affect access to DataTalks.Club, Slack, events, or courses.

Current choice: not chosen.

Privacy Policy

If you allow analytics, self-hosted Umami counts anonymous public pageviews without analytics cookies. Private account and learning pages are excluded. Read the Privacy Policy for the complete data boundary.

Want to learn more about our community?

How it started, who's here, and everything that goes on here: courses, events, Slack, and more.

About DataTalks.Club