Samsung Electronics interview question

Mainly focus on Recursion, BFS, DFS