Amazon.com

  www.amazon.com
Work in HR? Unlock Free Profile

Amazon.com Software Development Engineer/Test Interview Question

"There's an array and a hash function. There are many incoming elements to be inserted into the array, and the index for each one is the hash key obtained from the hash function. There are four methods for this structure: insert, delete, find, printAll. (1) printAll should print all the elements in the array in the order they were inserted. How to implement this? (2) (After I have answered the first question) How to implement delete if your approach for (1) is used?"
Add Tags [?]
Answer

Part of a Software Development Engineer/Test Interview Review - one of 4,689 Amazon.com Interview Reviews

Answers & Comments

0
of 0
votes

(1) Use a linked list, each item is a pointer to an element in the array.
(2) The linked list is doubly linked list. Modify the structure of the array, such that each item in the array contains not only the element but also a pointer to the corresponding linked list item.

- Interview Candidate on May 17, 2012

To comment on this question, Sign In with Facebook or Sign Up

Tags are like keywords that help categorize interview questions that have something in common.