Palindrome Linked List
Updated
Problem statement
Return whether the node values of a singly linked list read the same forward and backward. An empty list and a one-node list are palindromes. The input is a linked-list head; examples show its node values as an array. You may modify links while computing the answer.
Function
isPalindrome(head: ListNode) → booleanExamples
Example 1
head = [1,2,2,1]return = trueThe forward and reverse value sequences agree.
Example 2
head = [1,2]return = falseThe two endpoint values differ.
Constraints
- For this exercise, assume at most 100000 nodes, each containing a signed 32-bit integer.
More Intuit Online Assessment questions
- Employee Promotion OpportunitiesOA · Seen Oct 2026
- Next Pascal Row CoefficientOA · Seen Oct 2026
- Parse Router LogsOA · Seen Oct 2026
- Longest Repeated Letter Block with Adjacent SwapsOA · Seen Oct 2026
- Maximum Square-Free DivisorOA · Seen Oct 2026
- Two Tribes from Taller-Person CountsOA · Seen Oct 2026
- Shortest Path from an Encoded GraphOA · Seen Sep 2026
- Oldest and Youngest EmployeesOA · Seen Sep 2026
- Pressure-Isolation Shutdown OrderOA · Seen Sep 2026
- Submask Sum QueriesOA · Seen Sep 2026
Similar questions at other companies
- Find the Intersection Node of Two Linked ListsConcentric AI · OAConcentric AI interview questions
- Merge Two Sorted ListsThe Walt Disney Company · OAThe Walt Disney Company interview questions
- Reverse Linked-List Nodes in Groups of KPeopleStrong · OA · PHONE SCREENPeopleStrong interview questions
- Merge Two Sorted ListsLinkedIn · PHONE SCREENLinkedIn interview questions
- Middle of a Linked ListCisco · PHONE SCREENCisco interview questions
- Detect a Loop in a Linked ListEPAM · ONSITE INTERVIEWEPAM interview questions
- Merge Two Sorted ListsIBM · PHONE SCREENIBM interview questions
- Count Nodes in a ChainApple · PHONE SCREENApple interview questions
- Detect a Cycle in a Linked ListSalesforce · PHONE SCREENSalesforce interview questions
- Find the Intersection Node of Two Linked ListsVisa · PHONE SCREENVisa interview questions