GROWW SDE1 OA (2023) | Custom HashMap Design Using Separate Chaining

Question · Posted Jun 2026

Problem Statement Design a HashMap without using any built-in hash table libraries. Implement the following operations: put(key, value) → Insert or update a key-value pair. get(key) → Return the value associated with the key. If the key does not exist, return -1. remove(key) → Remove the key and its corresponding value if it exists. You must efficiently handle collisions and support all operations in near constant time. Example Input: put(1,1) put(2,2) get(1) get(3) remove(2) get(2) Output: 1 -1 -1 Explanation ...

The full answer & interview discussion are available to premium members.

Log in Create a free account