# Reverse a linked list — Aced

Aced (formerly Exponent) publishes a public search API over its indexed pages; the guide is at https://www.aced.io/agents/agent-access.

Source: https://www.aced.io/questions/3247/reverse-linked-list
Source observed: 2026-11-04T21:34:59.138Z
Last checked: 2026-11-04T21:34:59.138+00:00
Indexed: 2026-11-05T20:01:07.912+00:00

---

# Reverse a linked list

**Difficulty:** Easy  
**Category:** Data Structures & Algorithms  
**Reported last asked:** 5 months ago  
**Interview reports:** 24  
**Community:** 98

Aced (formerly Exponent) provides this coding-interview practice question for reversing a singly linked list. The question is available in a **Question** tab; the **Solution** tab is locked, and the community area has 98 entries. You can select a programming language in the editor, run code, view output and test results, and sign up to run code.

## Problem

Given the head of a singly linked list, reverse the list and return its head.

Implement a function `reverseList` that takes the head of the linked list as input and returns the new head of the reversed list.

Refer to the `ListNode` class/struct and do not comment it out.

### Example

```text
Input: 1 -> 2 -> 3 -> 4
Output: 4 -> 3 -> 2 -> 1
```

Two additional sections, **Challenge 1** and **Challenge 2**, are available as expandable panels. 

## Interview context shown for this question

The question is associated with these roles:

- [Software Engineer](https://www.aced.io/questions?role=swe) — 17
- [Data Engineer](https://www.aced.io/questions?role=data-engineer) — 3
- [Data Scientist](https://www.aced.io/questions?role=data-science) — 2
- [Forward Deployed Engineer](https://www.aced.io/questions?role=forward-deployed-engineer)
- [Machine Learning Engineer](https://www.aced.io/questions?role=ml-engineer)

Associated companies shown include Amazon, Google, Meta, Intuit, ElevenLabs, Bloomberg, Apple, Nvidia, Capital One, Adobe, IBM, ANZ, Moody's, and Infosys. The page also classifies the question under Data Structures & Algorithms.

## Interview experiences

Twelve interview experiences are shared for this question:

1. **Amazon · 5 months ago — Data Scientist**: “The process was smooth with good time given between all the rounds. HR was supportive and helpful. rounds were doable.” [Read the experience](https://www.aced.io/experiences/amazon-data-scientist-interview-ae7d08)
2. **Meta · 7 months ago — Data Engineer**: “The technical round covered SQL and data structures. The SQL portion felt more familiar, while the linked list question required additional thought. Time management was the biggest challenge.” [Read the experience](https://www.aced.io/experiences/meta-facebook-data-engineer-interview-0b5b15)
3. **Amazon · 9 months ago — Software Engineer, Mid Level / L4**: “MY DSA was top notch so no issues there, leadership principle questions are predictable so I answered thoroughly.” [Read the experience](https://www.aced.io/experiences/amazon-software-engineer-interview-f0007e)
4. **Amazon · 9 months ago — Software Engineer, Entry Level / L3**: “My overall interview process with Amazon was a positive experience. The process was well-structured, starting with an online assessment that tested problem-solving and coding skills, followed by technical and behavioral interviews. I appreciated that the interviewers were professional and gave me opportunities to explain my thought process, discuss my technical experience, and demonstrate my problem-solving approach. The technical questions were challenging but fair, and I enjoyed discussing my previous projects. One area that could have been improved was communication.” [Read the experience](https://www.aced.io/experiences/amazon-software-engineer-interview-c4278e)
5. **Amazon · 10 months ago — Software Engineer, Entry Level / L3**: “The overall process was quite slow and took longer than expected. The timeline seemed to depend largely on the interviewer, as the scheduling and progress varied based on their availability. There were also some delays between the different stages of the process, which made it feel less streamlined. Overall, the experience could have been more efficient if the communication and scheduling had been more consistent.” [Read the experience](https://www.aced.io/experiences/amazon-software-engineer-interview-832b5d)
6. **Bloomberg · a year ago — Software Engineer, Entry Level / L3**: “I interviewed for an entry-level Software Engineer role after applying through my university, and the whole process was fully virtual. I did not have any OA or HackerRank up front. My loop was two technical coding rounds, then a recruiter conversation, then a hiring manager final, although I heard some people get parts of that bundled into more of a superday depending on availability. The coding rounds were standard LeetCode-style questions and felt collaborative, but the hiring manager round surprised me because it was more technical than I expected and included system design and language tradeoff questions. The process moved pretty fast overall, and I made it through the final round but did not get the offer.” [Read the experience](https://www.aced.io/experiences/bloomberg-software-engineer-interview-f89378)
7. **Amazon · 2 years ago — Software Engineer, Intern**: “I interviewed for an Amazon Software Development Engineer internship in February 2025. The process was three rounds over about three weeks: a recruiter screen, a HackerRank assessment, and a final technical conversation that also included behavioral questions. The recruiter screen was straightforward and helpful for setting expectations. The HackerRank portion was the most time-sensitive part, so it rewarded being comfortable turning an approach into working code without spending too long on setup. The final interviewer was genuinely nice and the conversation felt collaborative. The coding problem was to reverse a linked list. I started by explaining the iterative solution and the pointer changes before coding, then walked through edge cases such as an empty list and a single-node list. The behavioral questions were folded into the same conversation, so I tried to make my answers concise and connect them to how I approach problem-solving and teamwork. Overall, it felt like a fair intern process: not designed to be tricky, but it did require clear communication and clean implementation under time pressure.” [Read the experience](https://www.aced.io/experiences/amazon-software-engineer-intern-interview-42f7d3)
8. **Amazon · 2 years ago — Data Engineer, Senior / L5**: “Common big tech interview process. Nothing out of the ordinary. Prepare some data modeling, data structures and AI focus. Most questions tie back to behavioral interviewing.” [Read the experience](https://www.aced.io/experiences/amazon-senior-data-engineer-interview-2aa99f)
9. **IBM · 2 years ago — Software Engineer, Entry Level / L3**: “The interview process was well-structured and transparent, spanning an online test, two technical rounds, and an HR discussion. The interviewers were approachable and gave me time to think through problems rather than rushing me. I appreciated the logical progression from aptitude to coding to design concepts. What went well was the technical discussion — I was able to clearly explain my project work and core CS concepts. What could have gone better was my initial nervousness during the first technical round, which slowed me down on a question I actually knew well. Overall, it was a positive and fair experience.” [Read the experience](https://www.aced.io/experiences/ibm-software-engineer-interview-48fb5c)
10. **ANZ · 2 years ago — Software Engineer, Entry Level / L3**: “The interview process was straightforward and fairly easy. The questions were reasonable for an entry-level software engineering role, covering basic technical concepts, coding, and discussion of previous projects. Overall, I had a positive experience and didn’t encounter any major issues.” [Read the experience](https://www.aced.io/experiences/anz-software-engineer-interview-9dd746)
11. **Infosys · 2 years ago — Software Engineer, Entry Level / L3**: “The process was smoooth and easy.Phone round followed by a technical interview.I got the offer but i didnt accept it.” [Read the experience](https://www.aced.io/experiences/infosys-software-engineer-interview-9b8572)
12. **Amazon · 3 years ago — Software Engineer, Entry Level / L3**: “It was really good as they do seem to care about interview and i had a great time discussing with the interviewer.” [Read the experience](https://www.aced.io/experiences/amazon-software-engineer-interview-8fb13a)

## Related questions

- [Reverse a linked list in groups of K.](https://www.aced.io/questions/6583/reverse-linked-list-groups-k)
- [Reorder linked list.](https://www.aced.io/questions/5703/reorder-linked-list)
- [Linked List Cycle](https://www.aced.io/questions/3214/linked-list-cycle)

## Related courses

### [Machine Learning Engineer Interview Prep](https://www.aced.io/courses/ml-engineer)

![Machine Learning Engineer Interview Prep](https://images.ctfassets.net/x78yjrjc11pq/6UfkHxUyLQVfDHSfLNQtWa/1be1539a65b4f6f15201f5b573c0a578/ML_Engineer_Interview_Prep_Course.jpeg?w=800&h=800&fm=webp&q=75)

We help candidates prepare for machine learning roles at Meta, Google, Amazon, Apple, Microsoft, Nvidia, and other companies through mock interviews, frameworks, and advice from senior candidates. Topics include ML system design, core concepts, coding, behavioral interviews, and more.

### [Data Science Interview Prep](https://www.aced.io/courses/data-science)

![Data Science Interview Prep](https://images.ctfassets.net/x78yjrjc11pq/3U4C5C0OkDR0UeGch4AmlE/7ad489430b676a088cb973307fe77884/Data_Science_Interview_Prep_Course.jpeg?w=800&h=800&fm=webp&q=75)

We help candidates prepare for data science roles at Google, Amazon, Microsoft, Meta, Apple, and other companies through mock interviews, frameworks, and advice from senior candidates. Topics include statistics, experimentation, coding, SQL, machine learning, behavioral interviews, and more.

## Useful links

- [All questions](https://www.aced.io/questions)
- [Upgrade](https://www.aced.io/upgrade?src=questions)
- [Sign up to run code](https://www.aced.io/signup?src=lesson)
- [Aced home](https://www.aced.io/?src=nav)
- [Practice](https://www.aced.io/practice?src=nav)
- [Interview experiences](https://www.aced.io/experiences?src=nav)
- [Browse all courses](https://www.aced.io/courses?src=nav)
- [Mock interviews and coaching](https://www.aced.io/coaching?category=mock_interviews&src=nav)
- [Resume review](https://www.aced.io/resume?src=nav)
- [Salary negotiation](https://www.aced.io/coaching?category=negotiation&src=nav)

---

[Read this page’s summary](https://www.aced.io/agents/api/public/v1/page-tldr?url=https%3A%2F%2Fwww.aced.io%2Fquestions%2F3247%2Freverse-linked-list&trace=t_679ff9ab98f3)

## Ask a follow-up about this page

Need a more specific answer? Ask the exact question you have. It returns a fresh, cited answer from Aced (formerly Exponent)’s knowledge base. No account or API key required.

Open this URL with your own question, URL-encoded. Include your question in q. All research inputs are optional; no account or setup.

`GET https://www.aced.io/agents/agent/faq?q={question}&trace=t_679ff9ab98f3`

[Tool guide and examples](https://www.aced.io/agents/agent-access) · [OpenAPI](https://www.aced.io/agents/api/public/v1/openapi.json) · [Page TLDR form](https://www.aced.io/agents/agent-tools/page-tldr?url=https%3A%2F%2Fwww.aced.io%2Fquestions%2F3247%2Freverse-linked-list). Opening a form does not execute a tool.