Skip to the selected question
ASIC.FYI

ASIC Question Bank

1,000+ hardware interview questions
DescriptionQ848
Page ↗
Q848FWASIC interview problem

Reverse a singly linked list

TechniquesLinked listPointers
DifficultyEasy
TopicLinked Lists
LanguageSystemVerilog
Requirements3 checkpoints
01

Problem

Reverse a singly linked list in place and return its new head.

Example input and output

Use this case to check your interpretation
Input
head = 1 -> 2 -> 3 -> null
Output
3 -> 2 -> 1 -> null
Explanation

Each next pointer is reversed once, and the original tail becomes the new head.

02

Requirements (3)

  • Do not allocate replacement nodes.
  • Preserve the next node before changing the current link.
  • Return null for an empty input list.