Data structures Interview Questions | Glassdoor

Data structures Interview Questions

117

interview questions shared by candidates

Data structures Interview Questions

Sort: Relevance Popular Date

Given a (potentially large) array of integers, all but one repeating an even number of times, how would you find the one repeating an odd number of times in an efficient way? eg [1 2 3 3 2 2 1 4 2] should return 4

7 Answers

How do you reverse a linked list

4 Answers

How would you print a linked list in reverse order?

4 Answers

"Reverse" of the problem if finding k-th smallest element in a tree: I had to find k-th largest.

4 Answers

I was asked two questions. Q 1. You are given two version numbers of a software, like Version 10.3.4 and Version 10.3.41. Write a program to find out which of the version numbers are the latest. If version 1 is latest output -1, if version number 2 is latest output +1 else output 0 if same version. Both the version numbers are taken as string. He also asks to make the program of minimum time complexity as we can. At the end he also asked the difference between an iterative program and one with recurrence and their advantages and disadvantages. Q 2. Given two files with a list of application IDs (or some kind of data) stored in them , write a program to compare the data in the two files and output all the common data found in each. What data structure would you use and why ? Give a minimum time and space complexity algorithm. Why did you choose the particular data Structure or algorithm ?

5 Answers

Given an infinite stream of numbers, find the top 50 integers. What's the data structure to use, and what's the time complexity.

4 Answers

Reverse a linked list.

3 Answers

Write a function that returns the depth of a tree.

3 Answers

How to print a link list reversely

3 Answers

Given a singly linked list, how can you find if there is a loop in the list?

3 Answers
1120 of 117 Interview Questions