Junior Detailed answer Linked Lists DSA & Coding Interviews

Explain Merge Two Sorted Lists.

Short answer: Use a dummy head and append the smaller of the two current nodes until one list is exhausted, then attach the remainder. Recursive merge is elegant but uses stack space.

Complexity

Time O(n + m), Space O(1) iterative.

Common follow-ups

  • Merge k sorted lists (heap / divide-and-conquer)
  • Merge sorted arrays in-place
Dummy node avoids special-casing the head — a small habit that impresses interviewers.
Toolliyo Assistant
Ask about tutorials, ebooks, training, pricing, mentor services, and support. I use public site content only—not admin or internal tools.

care@toolliyo.com

Need callback? Share your details