Many a times, technical interviewers ask questions such as 'print something'. Eg: http://www.geeksforgeeks.org/given-a-binary-tree-print-all-root-to-leaf-paths/
The following code will ask to print all paths from root to leaf.
How do I unit test a code like this ?
One solution would be to return a datastructure will all paths. But then interviewer would rebuke me for consuming huge space complexity ?