Google asks this frequently. It's the merge step of merge sort, which is a core algorithm. The dummy node technique is the real lesson here. It eliminates edge cases when building a new list. You'll use this pattern in many problems: partition list, add two numbers, insert into sorted circular list. This is also a building block for Merge K Sorted Lists (which you'll see in the heaps section). Learn the two-list version first.
##### ###### ##### ### # # ### # # ###### ## ## ## ## ## ## ## # # # # # ## ##### #### ##### # # # # # # # #### ## # ## ## ## ## # # # # # ## ## # ###### ## ### # ### # ######
$ curl repovive.com/roadmaps/maang-interview-prep/linked-lists/merge-two-sorted-lists-why-this-problem
░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░██████████████████████████████████████████████████████████████████████████████████████████████████████