Google interview question

bitwise operations and dfs algorithm