Data Structures Interview Questions
- 0of 0 votes
AnswersExplain data structure and design for list feature or auto complete suggestion.
- PsychIdris October 03, 2011 in India
Tries and Has map implementation.| Report Duplicate | Flag | PURGE
Flipkart Software Engineer / Developer Data Structures Algorithm - 0of 0 votes
Answersgive a binary tree (not BST)where tree node, with extra pointer inorder-successor, initaliy all inorder-successor pointer set to NULL.
- jayesh30785 September 27, 2011 in India
write a code to set all pointer to its inordersuccessor.
struct Node
{
int data;
Node *left, *right;
Node *successor;
};| Report Duplicate | Flag | PURGE
Amazon Software Engineer / Developer Data Structures Trees and Graphs Algorithm - 0of 0 votes
AnswersGiven a list
- abc September 23, 2011 in India
emp1 manger1
emp2 manager2
It contains all the employes and manager relationship. From this list construct the organizational tree of company. Write programme for it.| Report Duplicate | Flag | PURGE
Amazon Software Engineer / Developer Data Structures - 1of 1 vote
AnswersDesign a hashtable, you have 1000 items, how many slot would you choose. why.
- Bill September 10, 2011 in United States| Report Duplicate | Flag | PURGE
Bloomberg LP Software Engineer / Developer Data Structures - 0of 0 votes
AnswersI was asked to design a data structure for a phone address book with 3 fields
- Raj August 21, 2011
name, phone number , address
one must be able to search this phone book on any of the 3 fields .| Report Duplicate | Flag | PURGE
Oracle Software Engineer / Developer Data Structures - 0of 0 votes
AnswersDesign a queue (FIFO) using only stacks (LIFO). The only supported operations on the stack are: Push(), Pop() and IsEmpty(). The final queue had to implement the operations Queue() and Dequeue(). The program had to be efficient and handle exceptions.
- Anonymous August 15, 2011| Report Duplicate | Flag | PURGE
Google Software Engineer / Developer Data Structures Algorithm - 0of 0 votes
AnswersThere is a 2d matrix and in each point there are some gold coins.
- dheeraj2311 August 06, 2011
Then starting from the bottom left point you have to collect the maximum number of points. The constraint is that you can only move in right and up direction.
Then asked me to optimize it
After that do it using recursion
Compare the two methods
Give a mathematical formula for this problem.| Report Duplicate | Flag | PURGE
Adobe Software Engineer / Developer Data Structures - 0of 0 votes
Answerswhen would you prefer to use a linked list over an array and vice versa
- annika July 22, 2011| Report Duplicate | Flag | PURGE
Amazon Software Engineer / Developer Data Structures - 0of 0 votes
AnswersDesign an Evaluation of a mathematical expression.
- Chari July 20, 2011| Report Duplicate | Flag | PURGE
Microsoft Software Engineer / Developer Data Structures - 0of 0 votes
AnswersImplement Game of Snake DS, Why this DS, Approaches for optimizing the current DS
- Game Of Snake July 18, 2011| Report Duplicate | Flag | PURGE
Amazon Software Engineer / Developer Data Structures - 0of 0 votes
AnswersConvert a BST to sorted Double linked list
- abcd July 15, 2011| Report Duplicate | Flag | PURGE
Amazon Software Engineer / Developer Data Structures - 0of 0 votes
AnswersFind where the cycle starts in P shaped Linked List
- abcd July 15, 2011| Report Duplicate | Flag | PURGE
Amazon Software Engineer / Developer Data Structures - 0of 0 votes
AnswersWrite the code to test if a given binary tree is balanced or not? Write/give test cases for the same.
- Saahithi July 11, 2011| Report Duplicate | Flag | PURGE
Amazon Software Engineer in Test Data Structures - 0of 0 votes
Answersprint a tree layer by layer
- pansophism June 29, 2011| Report Duplicate | Flag | PURGE
Amazon Software Engineer / Developer Data Structures - 0of 0 votes
AnswersSorted Array Merge Problem: Design an algorithm to merge two sorted positive integer arrays A and B. Size of array A is n and size of array B is m. Array A has m empty blocks(-1) at random places. Merge array B into A such that array A is sorted and does not have empty blocks.
- None June 26, 2011| Report Duplicate | Flag | PURGE
Amazon Software Engineer / Developer Data Structures - 0of 0 votes
AnswersRead a file of this format:
japan usa japan russia usa japan japan australia
Print the output in the following format:
<country> : <count>
So for above file output would be:japan : 4 usa : 2 australia : 1 russia : 1
Note that since australia and russia both have count as 1, the name are sorted, 'a' before 'r'. Do it in the most efficient way.
- Anonymous June 19, 2011| Report Duplicate | Flag | PURGE
Amazon Software Engineer / Developer Data Structures - 0of 0 votes
Answers1. WAP to check if given linked list is palindrome
- someone June 16, 2011| Report Duplicate | Flag | PURGE
Amazon Software Engineer / Developer Data Structures - 0of 0 votes
Answerswrite a program to merge two sorted arays ?
- Whataheck June 12, 2011
This is for the written test| Report Duplicate | Flag | PURGE
Amazon Software Engineer / Developer Data Structures - 0of 0 votes
Answerscode to reverse a Linked List
- Whataheck June 12, 2011
This is for the written test| Report Duplicate | Flag | PURGE
Amazon Software Engineer / Developer Data Structures - 0of 0 votes
AnswersA string is well formed if for every "(" left parenthesis you have matching right one ")".In the same way every ")" should have a preceding "(".write a program finds if a string is wellformed .
- Whataheck June 12, 2011
This is for the written test| Report Duplicate | Flag | PURGE
Amazon Software Engineer / Developer Data Structures - 0of 0 votes
AnswersWhich data structure is fast when you want to sort or search Linked List or Array?
- sk June 10, 2011| Report Duplicate | Flag | PURGE
Amazon Software Engineer / Developer Data Structures - 0of 0 votes
AnswersWhat is Hashtable, using which data structure hash table is implemented
- sk June 10, 2011| Report Duplicate | Flag | PURGE
Amazon Software Engineer / Developer Data Structures - 0of 0 votes
AnswersGiven a binary matrix of N X N of integers , you need to return only unique rows of binary arrays
- Rahul June 09, 2011
eg:
0 1 0 0 1
1 0 1 1 0
0 1 0 0 1
1 1 1 0 0
ans:
0 1 0 0 1
1 0 1 1 0
1 1 1 0 0| Report Duplicate | Flag | PURGE
Google Software Engineer / Developer Algorithm Data Structures Matrix - 1of 1 vote
AnswersA rooted binary tree with keys in its nodes has the binary search tree
- Rahul June 09, 2011
property (BST property) if, for every node, the keys in its left
subtree are smaller than its own key, and the keys in its right
subtree are larger than its own key. It has the heap property if, for
every node, the keys of its children are all smaller than its own key.
You are given a set of n binary tree nodes that each contain an
integer i and an integer j. No two i values are equal and no two j
values are equal. We must assemble the nodes into a single binary tree
where the i values obey the BST property and the j values obey the
heap property. If you pay attention only to the second key in each
node, the tree looks like a heap, and if you pay attention only to the
first key in each node, it looks like a binary search tree.Describe a
recursive algorithm for assembling such a tree| Report Duplicate | Flag | PURGE
Google Software Engineer / Developer Algorithm Data Structures Trees and Graphs