Algorithm Interview Questions | Glassdoor

Algorithm Interview Questions

763

interview questions shared by candidates

Algorithm Interview Questions

Sort: RelevancePopular Date

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

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

5 Answers

We have a pond containing a single bacterium. The number of bacteria double every 5 minutes, and the pond is full of them in 24 hours. If we started with the same pond but two bacteria, how long will it take to fill the pond?

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 ?

7 Answers

How do you check if a Linked List has a recurring loop?

4 Answers

Given a string write a function which prints all the subsets of the string. Now make the function to return only unique solutions. For example if they give you "abc" you print out a ab abc ac b bc c Now for the unique solution constraint, if they give you "aba" the output should be: a ab aba b

7 Answers

Given a string of format '2+3*2-1', calculate and return the result. No parenthesis in the input, just integers and + - * / operators. Operator precedence has to be considered. Linear time complexity and minimal data structure use is preferred.

4 Answers

Extract the N largest floating point numbers from a large file of floating point numbers.

4 Answers

Find the Kth hisghest element in a given array.

5 Answers

Write a function that finds the square root of a decimal number.

4 Answers
4150 of 763 Interview Questions