Build a hash table where getRandom(), put() and get() are O(1) and delete is O(n).
Asked in the phone interview stage. Implement the structure using PostgreSQL tables and functions, then show its final contents after the prescribed operations.
slot, key, and value.account_003 and deleting account_006.slot ascending.1 through 10 with keys account_001 through account_010 and values active, pending, active, active, NULL, suspended, active, pending, active, closed, respectively.account_003's value to suspended before producing the output.account_005's value as SQL NULL.account_006, shift every later entry one slot earlier so slots remain consecutive.| Column | Type | Description |
|---|---|---|
| slotPK | BIGINT | Compact position of the entry |
| key | VARCHAR(64) | Unique hash-table key |
| value | VARCHAR(32) | Value associated with the key |