Data Structures Interview Questions
- 0of 0 votes
AnswersQueue. Implement a queue
- axoaxo March 26, 2012 in United States| Report Duplicate | Flag | PURGE
Citigroup Analyst Data Structures - 0of 0 votes
AnswersBinary Tree. How will you implement Binary tree
- axoaxo March 26, 2012 in United States| Report Duplicate | Flag | PURGE
Citigroup Analyst Data Structures - 0of 0 votes
AnswersTwo linked lists meet at a node and then continue as a single list. Find this node most effectively
- smack March 24, 2012 in India| Report Duplicate | Flag | PURGE
Apache Design Software Engineer / Developer Data Structures - 0of 0 votes
AnswersHow do you find the middle element of a singly linked list in the most effective manner?
- smack March 24, 2012 in India| Report Duplicate | Flag | PURGE
Apache Design Software Engineer / Developer Data Structures - 0of 0 votes
Answersexplain list, set and map
- jdicky March 22, 2012 in United States| Report Duplicate | Flag | PURGE
Amazon Software Engineer / Developer Data Structures - 0of 0 votes
Answersthere is n node graph, each node having only one root. All nodes are labeled in a random order from int 0 to n-1
the graph is represented in a array format such that the value in the array at index equal to child node label is root node label.
For root assume the value is -1.
Ex.3 4 1 2 0 5
the array is
- Sanjay Kumar March 19, 2012 in India
value : 1, 3, 3, -1, 3, 1
Index : 0, 1, 2, 3, 4, 5
Find the hight of graph. I have given an answer in O(n^2)
follow up question, if you dont have any restiction on space reduced the time complexity.| Report Duplicate | Flag | PURGE
Amazon Systems Design Engineer Data Structures - 0of 0 votes
AnswersWhat is a queue, advantages, disadvantages
- An March 19, 2012 in United States| Report Duplicate | Flag | PURGE
Amazon Software Engineer / Developer Data Structures - 0of 0 votes
AnswersWhat is a Stack, what are its advantages, disadvantages.
- An March 19, 2012 in United States| Report Duplicate | Flag | PURGE
Amazon Software Engineer / Developer Data Structures - 0of 0 votes
AnswersThere is a monkey which can walk around on a planar grid. The monkey can move one space at a time left, right, up or down. That is, from (x, y) the monkey can go to (x+1, y), (x-1, y), (x, y+1), and (x, y-1). Points where the sum of the digits of the absolute value of the x coordinate plus the sum of the digits of the absolute value of the y coordinate are lesser than or equal to 19 are accessible to the monkey. For example, the point (59, 79) is inaccessible because 5 + 9 + 7 + 9 = 30, which is greater than 19. Another example: the point (-5, -7) is accessible because abs(-5) + abs(-7) = 5 + 7 = 12, which is less than 19. How many points can the monkey access if it starts at (0, 0), including (0, 0) itself? There is no input for this program.
- techieZone March 18, 2012 in United States
Print out the how many points can the monkey access. (The number should be printed as an integer whole number eg. if the answer is 10 (its not !!), print out 10, not 10.0 or 10.00 etc)| Report Duplicate | Flag | PURGE
Software Engineer / Developer Algorithm C++ Coding Data Structures - 0of 0 votes
Answer1. Time complexities of Hash table, Array, Linked list
- varsha March 06, 2012 in United States
2. I need a fully functional hash table with time complexity for search O(n). How can I achieve this?| Report Duplicate | Flag | PURGE
Amazon Software Engineer / Developer Data Structures - 0of 0 votes
AnswersDesign a modified stack that in addition to Push and Pop can also provide minimum element present in the stack via Min function.
- ashish.kaila March 05, 2012 in United States| Report Duplicate | Flag | PURGE
Twitter Software Engineer / Developer Data Structures - 0of 0 votes
AnswersDesign a hash table that is thread safe. That is it can support concurrent reads but protects on write.
- ashish.kaila March 05, 2012 in United States| Report Duplicate | Flag | PURGE
Twitter Software Engineer / Developer Data Structures - 1of 1 vote
AnswersWrite Program to find longest common contiguous intersection from 2 lists provided to the function.
- aaz February 29, 2012 in United States for Intern
Example: list1: abcrfghwetf
list2: abrfghwwetxyab
Longest common intersection here is: fghw
Need Effecient Algorithm to implement this in Java or C, not using arrays.| Report Duplicate | Flag | PURGE
Amazon Software Engineer / Developer Algorithm C Data Structures Ideas - 0of 0 votes
Answerswhen key values are reals a similar data representation might be produced by using a hashing function with
- saurabh February 29, 2012 in India
a. mod
b. div
c. trunc
d. logN
Ans-->? Why..?| Report Duplicate | Flag | PURGE
Data Structures - 2of 2 votes
AnswersGiven a set of intervals, find the interval which has the maximum number of intersections.
- hello world February 27, 2012 in United States| Report Duplicate | Flag | PURGE
Google Software Engineer in Test Algorithm Data Structures - 0of 0 votes
AnswersGiven a queue with functions as enqueue(), dequeue(), and findmax(). You can use these functions any time. The findmax() should return the largest value in the queue at that point. You can use auxiliary space.
- nihaldps February 21, 2012 in India
Implement the queue with given operations. Find the max value in the queue.| Report Duplicate | Flag | PURGE
Adobe Computer Scientist Data Structures - 3of 3 votes
Answersone unsorted array is given.Find out the index i and j ,j> i for which a[j] - a[i] is maximum.perform in linear time complexity
- rahul baid February 17, 2012 in India| Report Duplicate | Flag | PURGE
Amazon Developer Program Engineer Data Structures Arrays - 0of 0 votes
AnswersImagine that you are developing a text editor. What is the best data structure to implement the buffer of text?
- N568 February 15, 2012
Then imagine that you have to paste 3000chars into your buffer. How does your structure handles that?| Report Duplicate | Flag | PURGE
Qualcomm Software Engineer / Developer Data Structures - 0of 0 votes
AnswersGiven (i) a non-empty binary search tree with double values (e.g. 3.5) in each node and (ii) a key value K
- mihirk February 15, 2012 in United States
Write a method to find the closest value to K.| Report Duplicate | Flag | PURGE
Google Software Engineer / Developer Algorithm Coding Data Structures Java Trees and Graphs - 0of 0 votes
Answerswrite a program to find min and max element in queue using linked list
- vaish1975 February 14, 2012 in India| Report Duplicate | Flag | PURGE
unknown Personnel Data Structures - 0of 0 votes
Answerswrite a program to find min and max element in stack using linked list
- vaish1975 February 14, 2012 in India| Report Duplicate | Flag | PURGE
unknown Personnel Data Structures - 0of 0 votes
AnswersDesign an infinite loop.. which data structure to use
- VVS February 12, 2012 in United States| Report Duplicate | Flag | PURGE
Data Structures - 0of 0 votes
AnswerHow you will create automation framework?
- arianSonia February 11, 2012 in United States for Azure
Reverse a string and write test case?
Get all Duplicates from Array, Optimize and Type of Data Structure.
Sealed AccessSpecifier,Complete Scrum Process
Code Coverage for a Test Case ?
WCF Question, Test a WCF Services etc| Report Duplicate | Flag | PURGE
Microsoft Software Engineer in Test Data Structures - 1of 1 vote
AnswersGiven a set of unique numbers from 1 to 1000, propose a data structure that allows you to perform the following operations in constant time.
- Fab February 10, 2012 in United States for Instant Video
1- Insertion,
2- Deletion,
3- Searching,
4- Get any random number.| Report Duplicate | Flag | PURGE
Amazon Software Engineer / Developer Data Structures - 0of 0 votes
AnswersGive logic for implementing "diff" command in Linux.
- mihirk February 08, 2012 in United States for Cloud Resource Management
Consider various test cases and explain what will happen in each. The two files are source code and are huge..
For e.g.
File 1: 1-2-3-4
File 2: 1-3-4-2| Report Duplicate | Flag | PURGE
VMWare Inc Software Engineer / Developer Algorithm Coding Data Structures Ideas Application / UI Design - 0of 0 votes
AnswersYou are given a linked list. Apart from the normal "Next" pointer, there is one more pointer(random ptr) in each node which points to some random node of the list. How will you create a clone of such a list? (In less than O(n^2))
- Apurva February 05, 2012 in India| Report Duplicate | Flag | PURGE
Amazon Software Engineer / Developer Data Structures - 1of 1 vote
AnswersQ: How would you print 1000 factorial(1000!). The hint he gave was 70! = 1.19785717 × 10 **100 which does not fit in any data type.
- sriniatiisc February 04, 2012 in India
A: Given that we just have to compute the factorial and print the value, loop over from 1000 to 1 and keep on accumulating the product. But pretty soon, the intermediate product wont fit in any data type and data truncation happens.
The trick is to represent the intermediate product as linked lists and then keep multiplying the numbers in a loop from 1000 to 1
Lets say the intermediate product you obtained is 125 and you want to multiply with 3. Represent the product as
5->2->1
And multiply the product with 3.
He agreed to this answer. He did not ask me to code this.| Report Duplicate | Flag | PURGE
Myntra.com Software Engineer / Developer Data Structures - 0of 0 votes
AnswersGiven numbers 1 to 1000, suggest a data structure to store them such that following operations can be executed in constant time:
- abzx12 February 02, 2012 in India
1- insertion,
2- deletion,
3- searching,
4- get_any_number (means return any number if present in the data-structure otherwise return -1).| Report Duplicate | Flag | PURGE
Amazon Software Engineer / Developer Data Structures - 0of 0 votes
AnswersGet the top 3 frequently used words in a book. The book contents are given as a single text file.
- anon.guy January 31, 2012 in United States for Kindle
I used hashmap solution. The interviewer said its not optimal. Use a combination of two or three data struct.| Report Duplicate | Flag | PURGE
Amazon Software Engineer / Developer Algorithm Arrays Coding Data Structures