Algorithm Interview Questions | Glassdoor

Algorithm Interview Questions

785

interview questions shared by candidates

Algorithm Interview Questions

Sort: RelevancePopular Date

Given a set of people, one of them is a celebrity. You have a 2D array which describes which people know each other, that is [N, M] is true if N knows M. The celebrity will not know anyone (except them self) and everyone will know the celebrity. Find an order N algorithm to find the celebrity.

5 Answers

Given a set of non-overlapping integer ranges (1,3) (5,8), etc., and an input integer, what is the best way to organize the data and allow for quick search based on the input, etc.

5 Answers

How many unique paths are there from B-L point to the T-R point of a chess table? What would be your approach to calculate this?

6 Answers

Write an algorithm to verify if a tree is a binary search tree.

5 Answers

Suppose you have 100 GB of data that you want to sort, but you only have 1 GB of memory. How would you sort this data?

7 Answers

Write a function in Java that will take a sorted array of ints, possibly with duplicates, and compact the array removing all the duplicate numbers. That is, if the contains the numbers - 1, 3, 7, 7, 8, 9, 9, 9, 10, then when the function returns, the contents should be - 1, 3, 7, 8, 9, 10. Be sure your answer is as efficient as possible. Describe the efficiency of your algorithm using big O notation.

5 Answers

Considering a 2-dimension matrix that can only be traversed by 1 adjacent position at a time and never diagonally. Create an algorithm to traverse that matrix from its upper-left corner to its lower-right corner using the shorter possible path in the most efficient way.

5 Answers

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

5 Answers

You have an analog clock with two hands, one for the hour and one for the minute. Given a time of the day, what is the angle between the two hands?

5 Answers

Output a single linked list in reverse, in linear time and constant space, and recursively

5 Answers
3140 of 785 Interview Questions