Round 1
Questions:
Question
-
Implement
cd
. Given current working directory and argument, move to final path.- E.g. cwd - /a/b/c, arg - d
- Output - /a/b/c/d
-
Given 2 linked lists, check whether the strings formed by the values of the linked lists are the same.
- Linked list A: "he" -> "" -> "ll" -> "o" -> ""
- Linked list B: "hell" -> "o"
- Output -> true.
Candidate's Approach
-
For the first question, the candidate used a stack to manage the directory changes. They missed one case while explaining the solution, but the interviewer corrected them. During the coding, the interviewer pointed out a case where the solution wouldn't work, and the candidate quickly understood the issue.
-
For the second question, the candidate used a two-pointer technique, achieving an O(1) memory solution. They handled all cases in one go.
Interviewer's Feedback
The candidate received a pass verdict. Specific feedback details were not provided.