Uber Interview Question

Write a function to return result from a cd command in a terminal.