Uber Interview Question

Write a function for that would implement something similar to the change directory command in the command line. Write a function to implement a "pretty tree"