UBS Interview Question

Explain DFS. write pseudo code and reason out time and space complexity.