How to implement an assosiative array functionality using dynamic array

In reply to dave_59:

Yes it was an interview question and i haven’t got the answer for the same.