Want a Free Job Posting?

Buy a job posting today and the second one is on us. For a limited time only. Act Now.

Recursive algorithm Interview Questions

Sort: Popular Date
Sort: Popular Date

“Write a function Brackets(int n) that prints all combinations of well-formed brackets. For Brackets(3) the output would be ((())) (()()) (())() ()(()) ()()()”

“Implement a power function to raise a double to an int power, including negative powers.”

“You are given an integer N and an integer M. You are supposed to write a method void findBestCoinsThatMinimizeAverage(int N, int M) that prints the best collection of N coins that minimize the...”

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

“Write a program that given 4 coin denominations and a dollar amount finds the best way to express that amount using the coins given. I.e. you have coins with denominations of 1c, 7c, 13c,19c and you...”

“Write an algorithm that does an in-order traversal of a tree recursively. Now, write the same algorithm iteratively.”

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

“Write a function for mutliply(a,b), where a and b are both positive integers, but you can only use the + or - operators.”

“Write the function nqueens(num_rows, num_cols, num_queens) -- where num_rows and num_cols is the size of an arbitrary chess board. Function returns "true" if there exists a way to place "num_queens...”

“The 2nd interview was a coding exercise with the following premise: Given a destination page and a page with all the links embedded in it, write a function that determines if the destination is...”

110 of 14 Interview Questions