Design HashMap without using built-in hash table/hash set data structures (put, get, remove).
Asked in the Round 1 stage. Represent the operations as PostgreSQL rows and determine the value visible to each get operation at its position in the sequence.
get operation with sequence_no, key_id, key_name, and returned_valueNULL when the key has not been inserted or was removedsequence_no ascending| Column | Type | Description |
|---|---|---|
| key_idPK | INT | Identifier of the logical map key |
| key_name | VARCHAR(100) | Human-readable key label |
| Column | Type | Description |
|---|---|---|
| operation_idPK | INT | Unique operation identifier |
| sequence_no | INT | Position of the operation in the event stream |
| operation | VARCHAR(10) | Operation type: put, get, or remove |
| key_id | INT | Referenced logical map key |
| value | VARCHAR(100) | Value supplied by a put operation |