← Amazon questions

Data structure with constant-time insert, delete and random retrieval

Filed under Amazon

Design a data structure that supports the following operations, each in average O(1) time: insert(val) adds val if not present and returns true (false if already present); remove(val) removes val if…

You've read your 3 free write-ups

Sign up free to keep reading. Your account opens the first 10 questions of every company.

Related Amazon questions

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