Data Structures Interview Questions
- 0of 0 votes
AnswersGiven an array having integers with just one integer repeated thrice, how will you find out which integer is that?
- Anonymous February 08, 2011| Report Duplicate | Flag | PURGE
Amazon Software Engineer / Developer Data Structures - 0of 0 votes
AnswersReverse a singly linked list
- Anonymous February 02, 2011| Report Duplicate | Flag | PURGE
Amazon Software Engineer / Developer Data Structures - 0of 0 votes
AnswersWhat is a linked list; what is a hash map
- Sana January 18, 2011| Report Duplicate | Flag | PURGE
Bloomberg LP Financial Software Developer Data Structures - 0of 0 votes
AnswersGiven a dictionary find out if given word can be made by two words in dictionary. For eg. given "newspaper" you have to find if it can be made by two words. (news and paper in this case)
- Anonymous January 11, 2011| Report Duplicate | Flag | PURGE
Google Software Engineer / Developer Data Structures - 0of 0 votes
AnswersIn a TicTacToe game, if you are given a particular state of player 'X', assuming that he and the other player makes perfect moves from then on, how would you tell if he would win or lose or draw ?
- ssankaran January 06, 2011| Report Duplicate | Flag | PURGE
Google Software Engineer / Developer Data Structures - 0of 0 votes
AnswersThe height of a tree is defined as follows:
- moderator December 29, 2010
The height of a terminal node is 0.
The height of an internal node is 1 + the maximum of the heights of its children.
Suppose it is specified that height() will only be called on InternalNodes.
Consider the following a implementation of InternalNode.height(), with no implementation in either Node or TerminalNode?
int height() {
int lheight = (left == null) ? 0 : left.height();
int rheight = (right == null) ? 0 : right.height();
return (lheight > rheight ? lheight : rheight);
}
Which, if any, of the following are problems that will cause the above code to fail:
A.It won’t compile because there is no definition (concrete or abstract) in Node.
B. 1 should be added to the value of the return
//options:
a)The code is correct as is.
b)A: it won’t compile, but if that were fixed it would work and produce the correct result.
c)B: it will compile but produce the wrong result.
d)Both: it won’t compile, and even if that were fixed, it would produce the wrong result.| Report Duplicate | Flag | PURGE
Citrix System Inc Software Engineer / Developer Data Structures - 0of 0 votes
Answersdesign a data structure for a DNS server
- Anonymous December 28, 2010| Report Duplicate | Flag | PURGE
Microsoft Software Engineer / Developer Data Structures - 0of 0 votes
Answerwhat is Virtualization? give an example of Virtualization.
- dutta_dipankar08@yahoo.co.in December 23, 2010| Report Duplicate | Flag | PURGE
Citrix System Inc Software Engineer / Developer Data Structures - 0of 0 votes
AnswersFind the minimum depth of a binary tree
- Ravi December 12, 2010| Report Duplicate | Flag | PURGE
Facebook Software Engineer / Developer Data Structures - 0of 0 votes
AnswersWrite a function to find the depth of a binary search tree
- Ravi December 09, 2010| Report Duplicate | Flag | PURGE
Facebook Software Engineer / Developer Data Structures - 0of 0 votes
AnswersImplement Stack using Queues?
- Chandra Sekhar November 29, 2010| Report Duplicate | Flag | PURGE
Microsoft Software Engineer / Developer Data Structures - 0of 0 votes
AnswersHow do you find a binary tree is balanced or not. No two leafs in the tree has a level difference (distance from root) greater than one.
- Kannan November 16, 2010| Report Duplicate | Flag | PURGE
LexisNexis Data Structures - 0of 0 votes
AnswersWhich one is better? HashTable or Binary balanced trees? List scenarios when you will prefer HashTable.
- Richa November 10, 2010| Report Duplicate | Flag | PURGE
F5 Networks Software Engineer / Developer Data Structures - 0of 0 votes
AnswerWrite automation design for testing ping.exe. Write classes you need to support validation of inputs and return values. Show what specific input values and return values you would use to validate it.
- Sudhakar October 31, 2010
C:\>ping.exe /?
Usage: ping [-t] [-a] [-n count] [-l size] [-f] [-i TTL] [-v TOS]
[-r count] [-s count] [[-j host-list] | [-k host-list]]
[-w timeout] [-R] [-S srcaddr] [-4] [-6] target_name| Report Duplicate | Flag | PURGE
Software Engineer in Test Data Structures - 0of 0 votes
AnswersHow will you delete duplicate odd numbers from a linked list? (delete only duplicates, keep one copy, list is not sorted) Interviewer was expecting O(n) answer. He didn't say anything clear about the extra space.
- Anonymous October 27, 2010| Report Duplicate | Flag | PURGE
Microsoft Software Engineer / Developer Algorithm C Data Structures - 0of 0 votes
AnswersFind the width of a tree pointed by head
- vinay October 25, 2010| Report Duplicate | Flag | PURGE
Amazon Software Engineer / Developer Algorithm C Data Structures - 0of 0 votes
Answersstruct A
- Anonymous October 22, 2010
{
char c;
int i;
};
what is the size of structure? and why? And how to make compiler to allocate exact 5 bytes to the structure object?| Report Duplicate | Flag | PURGE
C Data Structures - 0of 0 votes
AnswersImplement a stack that can have push, pop and find_minimum operations in o(1) time.
- anon October 20, 2010| Report Duplicate | Flag | PURGE
Amazon Software Engineer / Developer Data Structures - 0of 0 votes
AnswersImplement Queue using stacks. What's the time complexity of various queue operations for this implementation?
- Cartman October 19, 2010| Report Duplicate | Flag | PURGE
Facebook Software Engineer / Developer Data Structures - 0of 0 votes
Answers1. Compare and contrast Arraylist and Linked list based on time complexity of various operations.
- Cartman October 19, 2010
2. Inserting into Arraylist and it's complexity. Consider dynamic memory allocation in order to expand the list.| Report Duplicate | Flag | PURGE
Software Engineer / Developer Data Structures - 0of 0 votes
AnswersImplement queue using stacks.
- Cartman October 19, 2010| Report Duplicate | Flag | PURGE
Software Engineer / Developer Data Structures - 0of 0 votes
Answers1. Implement linked-list
- Cartman October 19, 2010
2. Use above to implement queue. Give time complexity of enqueue(), dequeue(), search(k)
3. Improve search(k) complexity to O(1) by modifying the above data stuuct( Hint: Linked Hashmaps)| Report Duplicate | Flag | PURGE
Software Engineer / Developer Data Structures - 0of 0 votes
AnswersConvert a doubly linked list to BST in place
- Anonymous October 17, 2010| Report Duplicate | Flag | PURGE
Google Software Engineer / Developer Data Structures - 0of 0 votes
AnswersConvert a min heap to BST without changing its structure and of course no extra space .
- Anonymous October 17, 2010| Report Duplicate | Flag | PURGE
Google Software Engineer / Developer Data Structures - 1of 1 vote
AnswersConvert a BST to max heap without using extra memory and in as optimum time as possible
- Anonymous October 17, 2010| Report Duplicate | Flag | PURGE
Google Software Engineer / Developer Data Structures - 0of 0 votes
AnswersI was explaining the solution of a question by using hash table.
- Anonymous October 17, 2010
Then he grilled me on that
What is a hash table ......
Design your own hash table and write code for it
Provide test cases
From here the disaster started :(
So be careful before uttering any term, u should have enough confidence on that.| Report Duplicate | Flag | PURGE
Google Software Engineer / Developer Data Structures - 0of 0 votes
AnswersThis was only technical question my interviewer was asking to every candidate he interviewed
- sachin323 October 13, 2010
What kind of questions u will ask to me if u have to design a Queue for me ?
i answered as
1) for data type u want it
he said int
2) It is going to contain very large numbers of objects
he said no
3)do u want to dynamically expanding
he said no , lets keep it simple
4)do want functionality of accessing any element in queue like At() function
interviewer : yes
5)Do u want min and max element functions
interviewer : yes
After this he kept saying what else what else and i was blank
he mentioned asking about environment would have been a good question like do want this queue for kernel for application or for Database
then he asked me to write a class which will implement this but he was rushing a lot kept saying we have very less time left so i end up writing queue full , queue empty , insert and pop conditions only
i must say i was bit disappointed by this interview as from CareerCup i have prepared for alot of coding question and from these kind of questions will everybody answer easily , how will they screen candidates| Report Duplicate | Flag | PURGE
Microsoft Software Engineer / Developer Data Structures - 0of 0 votes
AnswersImplement three stacks in single array
- Nani October 09, 2010| Report Duplicate | Flag | PURGE
Google Data Structures