Algorithm Interview Questions | Glassdoor

Algorithm Interview Questions

767

interview questions shared by candidates

Algorithm Interview Questions

Sort: RelevancePopular Date

You are given an array with n positive integers where all values in the array are repeated except for one. Return the one that is not repeated.

13 Answers

Write a function that computes the intersection of two arrays. The arrays are sorted. Then, what if one array is really larger than the other array?

6 Answers

You have a genealogy: 1) Describe a data structure to represent it. 2) Given any two people within the genealogy, describe an algorithm to determine if they share a common ancestor. You just need to return true/false, not all ancestors.

6 Answers

find 3 elements in an array that sum to 0.

6 Answers

What are the first 2 integers that, when added together, equal 10 in a "very large" array of unsigned integers?

6 Answers

Given a series of words written using a scrambled alphabet, figure out what order the letters of the alphabet are in.

7 Answers

Given a stream of integers of unknown (possibly large) length, how would you pick one at random? Now prove its random.

6 Answers

Define binary search tree. Develop a procedure to verify a binary search tree.

6 Answers

How would you implement integer division if your language did not offer it.

5 Answers

I have a log that consists of more than 100 million lines. Each line is just a data about user login, login time, etc. I want to sort them based on user login, and then if there is a tie based on login time, etc. However, I have limited memory, so don't think of storing all of them in an array. The memory can only hold n data where n is much smaller than 100 millions. You can access the disk though although it is much slower. How will you do it so that it is as efficient as possible?

5 Answers
2130 of 767 Interview Questions