Brief #03 · Backend
Search Autocomplete Service
Medium⏱ 10-14 hSoon
Autocomplete over a million product names: suggestions in under 20 ms, ranked well, and forgiving of typos.
Outlines are free · building with tracking needs Pro
SThe briefFrom the team
Our search box does a LIKE '%term%' query on every keystroke, and the database groans every evening. Users type 'samsng' and get nothing. Build an autocomplete service that answers as fast as people type and still finds what they meant.
What you'll build
- 1Load a million names (generate them or use a public dataset) into a trie in memory.
- 2Return the top 10 completions for a prefix, ranked by popularity.
- 3Keep the top-k at each node so a query never walks the whole subtree.
- 4Add typo tolerance (edit distance 1) without making every query slow.
- 5A tiny frontend with debounced input that calls the API.
Step-by-step walkthrough
Walkthrough coming soon
This project's step-by-step walkthrough, with real outputs at every step, is still being written. You can read the brief and try it on your own meanwhile; tracking opens when the walkthrough is ready.
Done when
- p95 under 20 ms for prefix queries on a million entries.
- 'samsng' suggests Samsung products.
- Memory use is measured and written down.
- Unit tests cover empty prefixes, unicode and very long input.
Stretch goals
- Rebuild the index from new data without downtime.
- Support Bangla names, and explain what changes.