This is a pretty classic question, and I've heard Google has used this question in their interviews.
Problem: Make a recursive method that prints all the possible unique ways from the base of a staircase to the top of the staircase with n stairs. You can only take 1-step or 2-steps at a time.
Sample output: If it is a staircase with 3 stairs...
1 1 1
2 1
1 2
If it is a staircase with 4 stairs...
1 1 1 1
1 1 2
1 2 1
2 1 1
2 2
*order of the outputs does not matter
I've seen similar questions posted here but all of them asked for the total number of paths. This recursive method needs to print out all the possible paths. The only restriction here is that you must use recursion somewhere in the method. You can use more than 1 method if you want.