Implement a dictionary without built-in Dictionary
Company: Snapchat
Role: Software Engineer
Category: Coding & Algorithms
Difficulty: hard
Interview Round: Onsite
Quick Answer: This question evaluates understanding of hash tables and low-level data-structure implementation, including hashing, collision resolution, resizing/rehashing, and performance guarantees for put/get/remove operations.
Constraints
- Inputs are Python literals matching the function signature.
- Return a deterministic exact-match value.
Examples
Input: ([['put','a',1],['put','b',2],['get','a'],['remove','a'],['get','a']],)
Expected Output: [None, None, 1, None, None]
Explanation: Basic map operations.
Input: ([['get','x'],['put','x',3],['put','x',4],['get','x']],)
Expected Output: [None, None, None, 4]
Explanation: Update existing key.
Hints
- Use deterministic tie-breaking for prompts with multiple valid outputs.
- For design-style APIs, simulate operations with explicit inputs.