Palindrome Linked List Quiz

Linked List
0 Passed
0% acceptance

A 25-question quiz covering detection of palindrome linked lists using pointers, reversal, comparison, and traversal logic.

25 Questions
~50 minutes
1

Question 1

What defines a palindrome linked list?

A
It reads the same forward and backward
B
It has no repeating values
C
It contains sorted values
D
It loops back to the head
2

Question 2

What is a common technique to check if a linked list is a palindrome?

A
Fast–slow pointer to locate the middle
B
Sorting the list
C
Shifting all nodes to an array
D
Using random access
3

Question 3

What happens after the middle node is found?

A
The second half is reversed
B
The list is deleted
C
The head is removed
D
New nodes are inserted
4

Question 4

What is compared when checking for a palindrome?

A
Each node in the first half against the reversed second half
B
Only the head and tail
C
Only the middle node's value
D
Node addresses instead of data
5

Question 5

Why is an empty list considered a palindrome?

A
It has no conflicting values
B
It always stores zeros
C
It loops back to itself
D
It is treated as invalid
6

Question 6

In an even-length list, where does the slow pointer usually stop?

A
At the first node of the second half
B
Always at the exact middle
C
At a null pointer
D
At the tail
7

Question 7

Why does the fast pointer move two steps at a time?

A
To reach the end twice as fast and locate the midpoint
B
To skip null checks
C
To reverse the list as it moves
D
To search for specific values
8

Question 8

Which condition safely ends the fast–slow traversal?

A
fast == null or fast.next == null
B
slow == null
C
head.data == slow.data
D
tail becomes null
9

Question 9

Why must the second half be reversed for palindrome checks?

A
To compare corresponding nodes in the same direction
B
To make the list shorter
C
To sort the values
D
To remove duplicates
10

Question 10

What happens after comparison is complete?

A
The second half is often restored to original order
B
The entire list is replaced
C
All nodes are reversed permanently
D
The list becomes circular
11

Question 11

Is a single-node list a palindrome?

A
Yes
B
No
C
Only if the value is 0
D
Only if the list is circular
12

Question 12

Which situation definitely breaks symmetry?

A
[1 → 2 → 3 → 4 → 1]
B
[7 → 7 → 7 → 7]
C
[1 → 2 → 2 → 1]
D
[5]
13

Question 13

What property must all opposing node pairs share?

A
Equal values
B
Matching addresses
C
Negative values
D
Unique values
14

Question 14

Why can even-length lists still be palindromes?

A
Mirror symmetry does not require a central element
B
Even lists always loop
C
They must contain identical values
D
They automatically reverse
15

Question 15

Which of the following is a valid palindrome list?

A
[9 → 1 → 1 → 9]
B
[3 → 4 → 5]
C
[10 → 20]
D
[1 → 2 → 3 → 4]
16

Question 16

What operation is shown here?

plaintext
slow = slow.next
      fast = fast.next.next
A
Fast–slow midpoint discovery
B
Node deletion
C
Reversal
D
Insertion at tail
17

Question 17

What does this reversed structure imply?

plaintext
Original: 1 → 2 → 3 → 2 → 1
      Second half reversed: 1 ← 2 ← 3  (middle)
A
Ready for comparison with the first half
B
List corruption
C
Circular construction
D
Sorting procedure
18

Question 18

What does this diagram represent?

plaintext
slow: C
      fast: null
      List: A → B → C → B → A
A
Middle reached in odd-length palindrome list
B
Head deletion
C
Tail detection
D
Cycle detection
19

Question 19

What does this comparison loop check?

plaintext
while first != null and second != null:
          if first.data != second.data:
              return false
A
Symmetry between list halves
B
Cycle presence
C
Tail detection
D
Valid index range
20

Question 20

What operation is shown?

plaintext
prev = null
      while curr:
          next = curr.next
          curr.next = prev
          prev = curr
          curr = next
A
Reversing part of the list
B
Searching for value
C
Deleting nodes
D
Making the list circular
21

Question 21

Which step is essential for avoiding null-pointer errors?

A
Checking fast and fast.next during traversal
B
Deleting the head first
C
Sorting values
D
Converting to array
22

Question 22

Which property ensures the list might be a palindrome?

A
Matching value pairs across the list
B
Values increase steadily
C
List is circular
D
Nodes have unique addresses
23

Question 23

What is a drawback of reversing half the list?

A
The structure temporarily changes
B
The values get corrupted
C
The list becomes cyclic
D
Duplicates appear automatically
24

Question 24

Which situation does not require reversal?

A
Using an auxiliary stack to hold the first half
B
Odd-length lists
C
Even-length lists
D
Cycle detection
25

Question 25

What is the benefit of not restoring the list after checking?

A
It saves an extra traversal
B
It helps detect cycles
C
It allows random access
D
It sorts the list faster

QUIZZES IN Linked List