Skip to the selected question
ASIC.FYI

ASIC Question Bank

1,000+ hardware interview questions
DescriptionQ1018
Page ↗
Q1018FWASIC interview problem

Merge two sorted linked lists

TechniquesLinked listMerge
DifficultyEasy
TopicLinked Lists
LanguageSystemVerilog
Requirements3 checkpoints
01

Problem

Merge two linked lists sorted by node value and return one sorted list.

Example input and output

Use this case to check your interpretation
Input
a = 1 -> 3 -> 5, b = 1 -> 2 -> 6
Output
1 -> 1 -> 2 -> 3 -> 5 -> 6
Explanation

Taking from a when equal preserves stable ordering while reusing every input node.

02

Requirements (3)

  • Reuse the existing nodes.
  • Keep the merge stable when values are equal.
  • Append the remaining tail after one input is exhausted.