# Y-Fast Trie Successor Queries: Practice Notes

Y-Fast Trie Successor Queries shows up often in coding rounds. Here is how I talk through it when the interviewer is watching.

## Key idea

Hash a compressed trie of representative keys and keep each bucket of size O(log u) in a balanced tree so successor is a hash lookup plus a small tree walk.

## Steps to say out loud

1. Restate the input and the exact ask, and nail down constraints and overflow.
2. Name the pattern (binary search on the answer, monotonic stack or deque, interval / interval-DP, string hashing, graph traversal, or shortest paths) and why a nested scan or naive search fails.
3. Code it, then trace a short example plus one empty or already-solved edge case.

## Complexity

Expected O(log log u).

## Common mistake

Leaving buckets larger than O(log u) so the local tree walk dominates.

## Practice tip

Time yourself: two minutes to explain, ten to code, three to test edges. Disclosure: I work on Linkjob AI. I also keep a practice cheat sheet at AI interview helper that uses your resume.