Verified interview challenge
Build a radix cache for integer sequences
Store shared sequence prefixes in compressed edges, then support insertion conflicts and queries.
Unlock with Full AccessThe challenge
Build a prefix tree that stores runs of integers on compressed edges. Inserting a sequence can require splitting an existing edge without losing the sequences already represented below it.
Extend the same structure through insertion, exact search, prefix matching and enumeration. The implementation should navigate the compressed tree rather than repeatedly scan every stored sequence.
What you'll practise
Edge splitting
Preserve existing sequences when an inserted sequence diverges inside an edge.
Prefix queries
Navigate compressed paths correctly for exact matches and related sequences.
# Build on your implementation
# Run checks for the current part
# Full starter code includedRun your code to see results.