Reddit Experience · 2026 Q1

Day [0/6] {Intersection of two Lists}

1 upvote

Interview Experience

https://preview.redd.it/8v35lr332hog1.png?width=1366&format=png&auto=webp&s=02a5b948ccb7186381ef91271f9fdfc15d12659a in the most optimal solution, 1. I pointed at both the heads and starte

Full Details

https://preview.redd.it/8v35lr332hog1.png?width=1366&format=png&auto=webp&s=02a5b948ccb7186381ef91271f9fdfc15d12659a in the most optimal solution, 1. I pointed at both the heads and started iterating till one of the pointers reach the end node. 2. There i found the 2nd pointer which began from the longer list was d distance behind. i.e it needs to travel d distances to reach to coincide 3. i sent the front pointer to the alternate head now iterated again. 4. Later found both got the same head start. i.e the one behind traveled d distances and same with the ahead pointer then they intersected
Free preview — Unlock all questions →