Algorithm Interview Questions

Sort: Popular Date
Sort: Popular Date

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

“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?”

“How do you find the max depth of a binary tree?”

“You have an array of numbers. For example: [-5, 1, 7, -3, 4]
Find the pair with the greatest product.In the example above, it would be 28(7x4).”

1 of 1 found helpful

“Given an array of integers, all but one of which appears an even number of times, find the one integer which appears an odd number of times. Upon completion, asked to improve the algorithm in terms…”

“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…”

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

1 of 1 found helpful

“Given two lists, A and B, of sizes n and k, respectively, describe an algorithm to determine the intersection, C, of the two lists. What is the complexity of your algorithm? (The obvious solution…”

“How would you write a sort routine to ensure that identical elements in the input are maximally spread in the output?”

“How can you solve n^m efficiently only using +, -, *, /.”

4150 of 701 Interview Questions