Data Structures Interview Questions
- -1of 1 vote
AnswersPrint a singly linked list in ascending and descending order in O(n) time. Both order printing should take O(n) time only.
- S@iR@m June 09, 2015 in India| Report Duplicate | Flag | PURGE
IBM Tech Lead Data Structures - 0of 0 votes
AnswersHave you done debugging in JVM? How would you do it.
- Tom Walker June 07, 2015 in United States| Report Duplicate | Flag | PURGE
Ebay Software Developer Data Structures Java Knowledge Based Testing test - 0of 0 votes
AnswersIf given a binary file, with data like lat, long, weather, temp in key:value. It's a structured data how would u ingest it. what are the steps that are being taken before Hive process starts.
- Tom Walker June 07, 2015 in United States
- serde (serializartion deserialization). parque etc.| Report Duplicate | Flag | PURGE
Amazon Software Developer Algorithm Data Mining Data Structures Database Distributed Computing Java SQL - 0of 0 votes
AnswersLets say if Mongo captures user views and oracle captures purchases. How would you design realtime system that answers question "give me avg. no. of views of users by purchases".
- Tom Walker June 07, 2015 in United States
So if a user watch a trailer 10 times and then decides to buy a video. How would you calculate it. He was looking for QUEUE.
He could have gone on more details but stopped because i didn't give details on this.| Report Duplicate | Flag | PURGE
Amazon Software Developer Data Mining Data Structures Database - 1of 1 vote
AnswersHow would you increase efficiency of a hive query?
- Tom Walker June 07, 2015 in United States| Report Duplicate | Flag | PURGE
Amazon Software Developer Data Mining Data Structures Database Debugging SQL - 0of 0 votes
AnswerWhat is distribute cache in Hadoop?
- Tom Walker June 07, 2015 in United States| Report Duplicate | Flag | PURGE
Amazon Software Developer Data Structures Database - 0of 0 votes
AnswerWhat do you mean by combiner?
- Tom Walker June 07, 2015 in United States| Report Duplicate | Flag | PURGE
Amazon Software Developer Data Mining Data Structures Database Distributed Computing - 0of 0 votes
AnswersAfter map phase partition, shifting, sorting happen. What does it mean?
- Tom Walker June 07, 2015 in United States| Report Duplicate | Flag | PURGE
Amazon Software Developer Data Mining Data Structures Database Java - 0of 0 votes
AnswerWhat is input split in hadoop.
- Tom Walker June 07, 2015 in United States| Report Duplicate | Flag | PURGE
Amazon Software Developer Data Mining Data Structures Database Java SQL - 0of 0 votes
AnswersAs I interviewing for Big data position. Asked Hadoop question :-
- Tom Walker June 07, 2015 in United States
Difference between TextInput vs Key Value format in Hadoop.| Report Duplicate | Flag | PURGE
Amazon Software Developer Data Mining Data Structures Database Java design - 0of 0 votes
AnswersHow Solr/Lucene or Elasticsearch work? For what purpose are they used?
- Tom Walker June 07, 2015 in United States| Report Duplicate | Flag | PURGE
Microsoft Software Developer Data Mining Data Structures Database Large Scale Computing SQL - 0of 0 votes
AnswersWhat's Hbase, Pig, used for? Why do we need Hbase if we can use Hive to query Hadoop?
- Tom Walker June 07, 2015 in United States| Report Duplicate | Flag | PURGE
Microsoft Software Developer Data Mining Data Structures Database Distributed Computing Experience Java Knowledge Based Large Scale Computing - 0of 0 votes
AnswersWhat are different phases of Map reduce operation - I think they were looking for split, combiners, partitioners, sorting phases of whole map reduce stage.
- Tom Walker June 07, 2015 in United States| Report Duplicate | Flag | PURGE
Microsoft Software Developer Data Mining Data Structures Database Distributed Computing Java Large Scale Computing SQL - 0of 0 votes
AnswersMy interview was for big data position for their Search team. They were looking for person with good Hadoop skill set :-
- Tom Walker June 07, 2015 in United States
1. Can you describe Hadoop Architecture? What are various components of it (Primary/Secondary namednodes, data node etc)? Explain working of each.| Report Duplicate | Flag | PURGE
Microsoft Software Developer Data Mining Data Structures Database Distributed Computing Ideas Java - 0of 0 votes
AnswersIs there a difference between the terms "sibling" and "cousin" of a specified node in a Binary Tree/ Binary Search Tree? If yes, then what?
- rash_coder June 07, 2015 in United States| Report Duplicate | Flag | PURGE
Microsoft Intern Data Structures - 0of 0 votes
AnswersImplement Priority Queue
- pc June 02, 2015 in India| Report Duplicate | Flag | PURGE
Microsoft Senior Software Development Engineer Algorithm Data Structures - 0of 0 votes
AnswersImplement Least Recently Used Cache for IPAddress lookup. Assume max cache size is 1000 but it should scale well with larger number
- pc June 02, 2015 in India
Key of the cache is server name and value is IPAddress.| Report Duplicate | Flag | PURGE
Microsoft Senior Software Development Engineer Algorithm Data Structures - 0of 0 votes
Answersadvantages and disadvantages of Circular queue according to its implementation in array and linkedlist ??
- rahulkumar5july May 26, 2015 in India| Report Duplicate | Flag | PURGE
TATA Consultancy Services SDE1 Data Structures - 4of 4 votes
AnswersGiven an array of integers and a number. WAP to find the pairs which sum of upto given number.
- Nitin Gupta May 15, 2015 in India for Cloud & Enterprise team
I solved it. Then he asked about writing test cases for this function.
I wrote below test cases
1.) All the elements should be number.
2.) Length of array should not be 0.
3.) Array itself should not be null.
4.) Given number, arrayLength can be represented by 32bits or 64 bits.
5.) number should not be negative.
6.) Input does not has pair, It should return false
7.) Input has pair, It should return true
8.) Input has all negative values and pair exists, then function should return true
9.) Input has all negative values and pair does not exists, function should return false
He told that he is looking for more test cases. Can you guys think of some more complex test cases.| Report Duplicate | Flag | PURGE
Microsoft SDE-2 Algorithm Arrays C++ Data Structures - 1of 1 vote
AnswersWrite a function that accepts root of a binary tree and print zigzag level order traversal, each level print in new line.
- jaip42 May 10, 2015 in India for Kindle
For example,
Given tree:
1
2 3
4 5 6 7
8 9
output:
1
2 3
7 6 5 4
8 9| Report Duplicate | Flag | PURGE
Amazon SDE1 Data Structures - 1of 1 vote
AnswersWrite a function that accepts root of a binary tree and return true if it is foldable otherwise return false. A binary tree is foldable if left subtree of root is mirror image if right subtree.
- jaip42 May 10, 2015 in India for Kindle
For example:
Given tree,
1
2 3
4 5 5 4
6 6
output: trus| Report Duplicate | Flag | PURGE
Amazon SDE1 Data Structures - 1of 1 vote
AnswersWrite a function that accepts root of a binary tree and print zigzag level order traversal, each level print in new line.
- jaip42 May 10, 2015 in India for Kindle
For example,
Given tree:
1
2 3
4 5 6 7
8 9
output:
1
2 3
7 6 5 4
8 9| Report Duplicate | Flag | PURGE
Amazon SDE1 Data Structures - 2of 2 votes
AnswersWrite a function that accepts two character arrays each represents a floating point number and return their sum in character array.
- jaip42 May 10, 2015 in India for Kindle
For example function accepts "23.45" and "2.5" and return their sum "25.95".
Restriction: We cannot use predefined functions / methods or parsing. We have to go with basic operations.| Report Duplicate | Flag | PURGE
Amazon SDE1 Data Structures - 0of 0 votes
AnswersWhich structure can be used to return the lastly added node and remove it from the collection and also will allow to peek the highest valued node without removing it from the collection. What is the time and space complexity for Push, Pop and Peek actions
- A3Clef May 08, 2015 in United States| Report Duplicate | Flag | PURGE
unknown Software Developer Data Structures - 0of 0 votes
AnswersIn a Formula-1 challenge, there are n teams numbered 1 to n. Each team has a car and a driver. Car’s specification are as follows:
- Nitin Gupta May 06, 2015 in India
– Top speed: (150 + 10 * i) km per hour
– Acceleration: (2 * i) meter per second square.
– Handling factor (hf) = 0.8
– Nitro : Increases the speed to double or top speed, whichever is less. Can be used only once.
Here i is the team number.
The cars line up for the race. The start line for (i + 1)th car is 200 * i meters behind the ith car.
All of them start at the same time and try to attain their top speed. A re-assessment of the positions is done every 2 seconds(So even if the car has crossed the finish line in between, you’ll get to know after 2 seconds). During this assessment, each driver checks if there is any car within 10 meters of his car, his speed reduces to: hf * (speed at that moment). Also, if the driver notices that he is the last one on the race, he uses ‘nitro’.
Taking the number of teams and length of track as the input, Calculate the final speeds and the corresponding completion times.| Report Duplicate | Flag | PURGE
Google SDE1 Algorithm Arrays Data Structures Java Object Oriented Design - 0of 2 votes
AnswersWrite code to rotate a square matrix:
- doomguy May 04, 2015 in United States
Input:
1 2 3
4 5 6
7 8 9
Output:
4 1 2
7 5 3
8 9 6| Report Duplicate | Flag | PURGE
Amazon SDE1 Data Structures - 1of 1 vote
AnswersYou are given two objects, Student and Course, and there exist a many to many relation between them. One student can be enrolled for more than one course and there can be many students enrolled for a single course. Design an effective data structure to store such data keeping in mind that the time complexity for search should be optimum. A search can be for the list of students enrolled for a single course, or for the list of courses a single student is enrolled.
- angshu1986 May 01, 2015 in India| Report Duplicate | Flag | PURGE
Morgan Stanley Java Developer Data Structures Java - 1of 1 vote
AnswersFind the depth of Binary search tree without using recursion?
- simy84 April 29, 2015 in United States| Report Duplicate | Flag | PURGE
Data Structures - 1of 1 vote
AnswersImplement a program to reverse the linear linked list in pairs. it should handle both even number of nodes and odd number of nodes. if odd number of nodes, the last node will be the last node after reversion.
- panchadi520 April 27, 2015 in India
Do not move the data in the nodes. Do manipulate node pointers/references. the nodes themselves need to be manipulated, not just the data in the nodes.
For example, if the initial linear linked is,
1->2->3->4->5
after reverse it should be,
2->1->4->3->5| Report Duplicate | Flag | PURGE
Amazon Senior Software Development Engineer Data Structures - 1of 1 vote
AnswersImplement a function that checks if the given binary tree is binary search tree(BST). Use tree operations to solve this. do not try solving by pre-order traversal of the tree and then checking if the array is sorted.
- panchadi520 April 27, 2015 in India
instead, traverse the tree for checking if it is BST.| Report Duplicate | Flag | PURGE
Amazon Senior Software Development Engineer Data Structures