FastPrepBuild and Check a Palindrome Linked List
Problems/Build and Check a Palindrome Linked List

Build and Check a Palindrome Linked List

Omnissa logoOmnissa● EasyFULLTIMEONSITE INTERVIEW

Updated Nov 2026

QuestionFunctionExamplesConstraints

Problem statement

Source note: Reported in an Omnissa onsite interview for a full-time role. The report requires building a singly linked list and checking whether it is a palindrome. That includes reversing part of it and comparing values. We chose the input as an array turned into a list, the limits, and the examples.

Our version is about 98% the same as the reported question.

You are given an integer array values listing node values from head to tail. Define your own singly linked-list node structure and build the corresponding list. Return true if the list reads the same forward and backward, or false otherwise.

The array is only an input adapter. Practice the list algorithm: locate the middle, reverse the second half, and compare corresponding node values. Once the list has been built, aim to use constant extra space for the comparison. The empty list and a one-node list are palindromes.

The judge checks the returned Boolean; it does not inspect the internal node implementation. The editorial demonstrates the required construction and pointer operations.

Function

isPalindrome(values: int[]) → boolean

Examples

Example 1

values = [3,5,5,3]return = true

The list reads 3,5,5,3 in either direction. Reversing its second half aligns [3,5] with the first half.

Example 2

values = [3,5,7]return = false

The head and tail values, 3 and 7, do not match.

Constraints

  • 0 <= values.length <= 20000
  • -1000000000 <= values[i] <= 1000000000
  • The constructed list is singly linked and contains no cycle.

More Omnissa Onsite Interview questions

  • Find the CelebrityONSITE INTERVIEW · Seen Sep 2026
  • Maximum All-Ones Square Side LengthONSITE INTERVIEW · Seen Sep 2026
  • Maximum Subarray SumONSITE INTERVIEW · Seen Sep 2026
  • Coin ChangeONSITE INTERVIEW · Seen Jul 2026
  • Longest Substring Without Repeating CharactersONSITE INTERVIEW · Seen Jul 2026
  • Rotate Array RightONSITE INTERVIEW · Seen Jul 2026

Similar questions at other companies

  • Detect a Loop in a Linked ListEPAM · ONSITE INTERVIEWEPAM interview questions
  • Merge Two Sorted Linked ListsZS · ONSITE INTERVIEWZS interview questions
  • Middle Node Of A Linked ListNVIDIA · ONSITE INTERVIEWNVIDIA interview questions
  • Reverse a Singly Linked ListGEP · ONSITE INTERVIEW
  • Merge Two Sorted Linked ListsApple · ONSITE INTERVIEWApple interview questions
  • Reverse a Singly Linked ListMicrosoft · ONSITE INTERVIEWMicrosoft interview questions
  • Reverse Linked ListThe Walt Disney Company · OA · ONSITE INTERVIEWThe Walt Disney Company interview questions
  • Detect a Linked-List CycleGoogle · ONSITE INTERVIEWGoogle interview questions
  • Detect a Cycle in a Linked ListPeopleStrong · ONSITE INTERVIEWPeopleStrong interview questions
  • Reverse a Singly Linked ListBloomberg LP · PHONE SCREEN · ONSITE INTERVIEWBloomberg LP interview questions
All Omnissa interview questionsSee Omnissa hiring insights
Saved
class Solution {
    public boolean isPalindrome(int[] values) {
        // Define nodes, build the list, and compare its halves.
    }
}
Checking account…