Pregunta de entrevista de Apple

How would you implement the shell command cd?