## Print all combinations of phrases that can be formed by picking words from each of the given lists

Given N lists of words, print all combinations of phrases that can be formed by picking one word each from each of the given lists.

## Rearrange a Linked List by Separating Odd Nodes from the Even Ones

Given a linked list, rearrange it by separating odd nodes from even ones. All even nodes should come before all odd nodes in the output list and the relative order of even and odd nodes should be maintained.

## Find Maximum Difference Between a Node and its Descendants in a Binary Tree

Given a binary tree, find maximum difference between a node and its descendants in it.

## Collect maximum value of coins in a matrix

Given a M x N matrix where each cell contains a coin of some denomination, collect maximum value of coins by traversing the grid. The first traversal starts from the top-left corner of the matrix and end at the bottom-left corner and the second traversal starts from the top-right corner and end at the bottom-right …

## Count all paths in a matrix from first cell to last cell

Given a M x N rectangular grid, efficiently count all paths starting from the first cell (0,0) to the last cell (N-1,M-1) in the grid. We can either move down, or move towards right from a cell.

## Print all shortest routes in a rectangular grid

Given a M x N rectangular grid, print all shortest routes in the grid that start at the first cell (0,0) and end at the last cell (N-1,M-1). We can move down or right or diagonally (down-right) but not up or left.

## Unbounded Binary Search

Given a monotonically increasing function f(x), find the value of x where f(x) becomes positive for the first time. In other words, find a positive integer x such that f(x-1), f(x-2),… are negative and f(x+1), f(x+2),… are positive.

## Find the longest common prefix (LCP) between given set of strings

Write an efficient algorithm to find the longest common prefix (LCP) between given set of strings.

## Find the odd occurring element in log(n) time

Given an array of integers where every element appears even number of times except one element which appears odd number of times, find that odd occurring element in O(log(n)) time and constant space.

## Find length of longest path in the matrix with consecutive characters

Given a M x N matrix of characters, find the length of longest path in the matrix starting from a given character. All characters in the longest path should be increasing and consecutive to each other in alphabetical order.

## Replace all occurrences of 0 that are completely surrounded by 1 in a binary matrix

Give a M x N binary matrix, replace all occurrences of 0 by 1 which are completely surrounded by 1.

## Check if a string matches with a given wildcard pattern

Given a string and a pattern containing wildcard characters, write an efficient algorithm to check if the input string matches with the wildcard pattern or not.