โ† Samsung questions

Autocomplete system with prefix search and frequency ranking

Filed under Samsung

The question

Design an efficient data structure and algorithm supporting two operations on a list of millions of words: returning all words with a given prefix, ranked by highest frequency (and lexicographically in case of ties), and adding new words to the list. Operations may be called multiple times per second.

No write-up yet. Related questions below have one.

Related Samsung questions

Collected from public candidate posts and coding forums. Updated Nov 2026.