Pergunta de entrevista da empresa Amazon

They asked me to solve a data structures and algorithms problem involving efficient lookups and edge case handling. The focus wasn’t just on getting the correct answer — they wanted me to explain my reasoning clearly, analyze time and space complexity, and discuss trade-offs between different approaches.