Autocomplete Tickers By Prefix Ranked By Intraday Volume
Last updated: November 29, 2026
Quick Overview
Build a structure supporting add_volume(ticker, shares) and suggest(prefix) that returns up to three tickers starting with the prefix, ordered by cumulative intraday volume (highest first, ties by name).
Point72
November 29, 20260
0
0 solved
Build a structure supporting add_volume(ticker, shares) and suggest(prefix) that returns up to three tickers starting with the prefix, ordered by cumulative intraday volume (highest first, ties by name).
Analyst tools at Point72 offer ticker search boxes that must feel instant across tens of thousands of listings. The interviewer is checking trie design, where to cache ranked results, and the observation that intraday cumulative volume only grows, which makes per-node top-k caches safe.
What the Interviewer Expects
- Build a trie keyed on ticker characters
- Cache a small top-k list at each node along the path
- Exploit that volume only increases so a cached entry never needs demotion below the cut
- Return suggestions in O(len(prefix)) after the walk
- Discuss memory versus a DFS-on-query approach
Key Topics to Cover
How to Approach This
- Clarify input constraints and edge cases before writing code.
- Walk through your approach verbally and confirm with the interviewer before coding.
- Start with a brute force solution, then optimize. Mention time and space complexity.
- Test your solution with examples, including edge cases like empty input or duplicates.
- Consider common patterns: sliding window, two pointers, hash map, BFS/DFS, dynamic programming.
Possible Follow-up Questions
- If volumes can decrease (corrections), why does the per-node cache break and how would you fix it?
- How would you support fuzzy matching such as a typo in one letter?
- How would you search by company name and ticker together?
- What would you change to serve this to thousands of users with low latency?
Sharpen Your Skills on Codemia
Practice similar problems with our interactive workspace, get AI feedback, and track your progress.
Practice DSA ProblemsSample Answer
Requirements
Tickers are short uppercase strings. Volume accumulates through the day from trade prints, so it only increases. Queries return the top three by current volume for a prefix, ties broken alphabetically...
High-Level Design
A trie where every node holds a cached list of the best K tickers in its subtree. On add_volume, walk the ticker's path; at each node merge the ticker into the cached list, sort by (-volume, name) and...