Data Structures Interview Questions
- 0of 0 votes
AnswersHow would you save a graph to a database?
- Anonymous November 11, 2008| Report Duplicate | Flag | PURGE
Amazon Software Engineer / Developer Database Data Structures - 1of 0 votes
AnswersSerialize a binary tree to a linked list.
- Anonymous November 06, 2008| Report Duplicate | Flag | PURGE
Amazon Software Engineer / Developer Data Structures - 0of 0 votes
AnswersGiven a finite set of SSNs or ZIP code, what data structure do you use for storage.
- Amazonview October 30, 2008| Report Duplicate | Flag | PURGE
Amazon Software Engineer / Developer Data Structures - 0of 0 votes
AnswersHow do you implement the following feature which Amazon uses on its website?
- JobSeeker October 20, 2008
"What Do Customers Ultimately Buy After Viewing This Item?"
81% buy this item
10% buy item B
9% buy item C| Report Duplicate | Flag | PURGE
Amazon Software Engineer / Developer Data Structures - 1of 0 votes
AnswersDesign a deck of cards. What classes? functions? constructors? What functions can you add? Where would you add them. for eg shuffle and deal a card functions. What happens if we need only a particular sort of card eg spades? How would you handle multiple decks?
- min2 October 09, 2008
(believe me that was never ending discussion, finally it ended when i started crying :-)| Report Duplicate | Flag | PURGE
Amazon Software Engineer / Developer Data Structures - 1of 0 votes
AnswersWhen would you use a hash table over a Binary Search Tree?
- Anonymous September 25, 2008| Report Duplicate | Flag | PURGE
Microsoft Software Engineer / Developer Data Structures - 1of 0 votes
AnswersGiven a binary tree,find efficiently if its a binary search tree.
- Suhas September 14, 2008| Report Duplicate | Flag | PURGE
Amazon Software Engineer / Developer Data Structures - -4of 0 votes
Answerswhat do you mean be data structures?
- Anonymous August 30, 2008| Report Duplicate | Flag | PURGE
Apple Software Engineer / Developer Data Structures - 2of 0 votes
AnswersList as many data structures as you can think of. How do you detect a loop in a linked list?
- Bloomberg london July 31, 2008| Report Duplicate | Flag | PURGE
Bloomberg LP Financial Software Developer Data Structures Algorithm Linked Lists - 0of 0 votes
AnswersWhere will you use Hashmap as opposed to a Tree? What is the disadvantage of using HashMap?
- hipy16 July 22, 2008| Report Duplicate | Flag | PURGE
Amazon Software Engineer / Developer Data Structures - 0of 0 votes
AnswersExplain preorder, inorder, postorder and level order of a tree. What is topological sort?
- himanshu July 22, 2008| Report Duplicate | Flag | PURGE
Amazon Software Engineer / Developer Data Structures Terminology & Trivia - 5of 5 votes
AnswersHad my first and second phone interview with Amazon. I was dropped. This site has been a great help towards my preparation and most questions are based on what you find here.
- S July 01, 2008
Posting my Questions is a small way of saying Thanks!
Interview 1:
1. What is polymorphism.
2. Design an OO parking lot. What classes and functions will it have. It should say, full, empty and also be able to find spot for Valet parking. The lot has 3 different types of parking: regular, handicapped and compact.
3. Coding: I have an integer array where every number appears even number of times and only one appears odd times. Find the number.
(I said hashtable and he asked me to write code with Hashtable)
4. What data structure would you use to look up phone numbers for customer names.
(I said Hashtable. Asked why hashtable, why not a tree. I said HT has O(1). Asked is order always 1, when more than O(1) in HT.
Second Interview:
1. Starter: Describe your college projects.
2. OO Design: Design a deck of cards. What classes, data structures will you use? How will you shuffle the cards? How will you divide (deck) among players. What class/function do you need to denote players and where will you add them? What class/function do you need to deck? What if I need to add 2 jokers to the deck of 52 cards.
3. Data Structures: How will you use a hashtable to find data in a tree. (Then he rephrased) suppose I have a hashtable, I want to store the data in a tree instead of a bucket. How will I do it. What complexity to find an element.
4. Bits & Bytes: Find if a binary representation of a number is palindrome. The function should work irrespective of number of bytes for an integer. Suppose if our machine is 4 bytes for an int, how will you use the program for 8 byte machine.
5. Unix: Suppose I have 100's of html files in many directories. I want to find the files having phone numbers.
b) Suppose I have 2 files having phone numbers, find the repeating phone numbers. (I said sort and grep). Then he asked what if the lines cannot be sorted.
All the best guys. I think the second interview was challenging since the interviewer was prodding until he heard a leave me alone. So it means that though they are based on questions in cc, be prepared for extensions. I think this site is all you need to prepare for Amazon interview.| Report Duplicate | Flag | PURGE
Amazon Software Engineer / Developer Java Data Structures Object Oriented Design Coding - 1of 0 votes
AnswersGiven a "directed" graph, write an algo to figure out if the given graph is a tree.
- phoenix June 28, 2008| Report Duplicate | Flag | PURGE
Amazon Software Engineer / Developer Data Structures - 0of 0 votes
AnswersCreate a Circular Link List from a Given Binary Tree.
- newcup June 25, 2008| Report Duplicate | Flag | PURGE
Microsoft Software Engineer / Developer Data Structures - 0of 0 votes
AnswersExplain Hash Table from the scratch as if I don't know anything.
- armisho June 03, 2008| Report Duplicate | Flag | PURGE
Amazon Software Engineer / Developer Data Structures - -1of 0 votes
AnswersExplain Queuing models.
- expert May 24, 2008| Report Duplicate | Flag | PURGE
Expedia Software Engineer / Developer Data Structures - 0of 0 votes
AnswersWrite code to reverse a singly linked list
- chriswho May 15, 2008| Report Duplicate | Flag | PURGE
Microsoft Software Engineer in Test Software Engineer / Developer Data Structures Coding Algorithm - 0of 0 votes
AnswersWrite a code segment called isFibonacci(), which, when given a variable array of integers, checks whether it is a part of the Fibonacci sequence or not? (This was asked for the second round)
- Mallika.I. March 05, 2008| Report Duplicate | Flag | PURGE
Morgan Stanley Software Engineer / Developer Data Structures - 0of 0 votes
AnswersYou are given a Linked List and a function declaration as node* KReverse(node* head, int k);
- zdmytriv February 22, 2008
KReverse is a function that reverses the nodes of a Linked List k at a time and then returns the modified Linked List.
For Example
Linked List : 1->2->3->4->5->6->7->8->9->10->11
For k = 2
Return Value: 2->1->4->3->6->5->8->7->10->9->11
For k = 3
Return value: 3->2->1->6->5->4->9->8->7->10->11
Write a solid secure definition for the function KReverse.| Report Duplicate | Flag | PURGE
Microsoft Software Engineer / Developer Data Structures Algorithm - 0of 0 votes
AnswerExplain Hashtable
- Mallika.I. February 19, 2008| Report Duplicate | Flag | PURGE
Barclays Capital Analyst Data Structures - 0of 0 votes
AnswersInhouse interview question:
- Koonz February 02, 2008
You have an array of char's like so:
[12, 46, 244, 0, 12, 83, 48, 98, 233, 83, 26, 91, 119, 148, 98]
Whats the best way to return the first repeated element. The first one in this case is 12.| Report Duplicate | Flag | PURGE
Bloomberg LP Financial Software Developer Data Structures - 0of 0 votes
AnswersWhat is a stack?
- cafemocha January 30, 2008| Report Duplicate | Flag | PURGE
VMWare Inc Software Engineer / Developer Data Structures - 0of 0 votes
AnswersGiven an array of int values design an efficient approach to find if the sum of any 2 values in the array is equal to a 3rd value in the same array.
- jobHunt January 02, 2008
Gayle please help...| Report Duplicate | Flag | PURGE
Amazon Software Engineer / Developer Data Structures - 1of 0 votes
Answers1)Implement binary search in a sorted array if array, size and element to be found is given?
- OnJobHunt December 31, 2007
2)arrange from best to worst:
BST, sorted array, unsorted array and hash search based on big O analysis for an average case for inserting, finding an element and finding the range(lowest number and highest number)
3)how would you find the unique lines(that are too long to store in memory) between 2 files tat have a billion lines of data each. How will you find the non-unique lines.| Report Duplicate | Flag | PURGE
Amazon Software Engineer / Developer Data Structures - 0of 0 votes
AnswersGiven two arrays char *pa, *pb. Write a function to return true/false. True if all occurrences of all chars in pb exist in pa. False if not.
- Rakesh December 15, 2007
Eg. if pa = czcz ; pb = czzz ; return false coz pb has one z extra
if pa = abaa; pb = ab ; return true
if pa = ab ; pb = ab ; return true| Report Duplicate | Flag | PURGE
Microsoft Data Structures Coding Algorithm