Group Every Third Linked-List Node
Updated
Problem statement
Given a singly linked list head, number its original nodes from 1.
Move the nodes at original positions 3, 6, 9, and so on to the end. Keep the relative order of those nodes, and also keep the relative order of all other nodes.
Return the new head. Reuse the input nodes; a small number of temporary dummy nodes is allowed. The list is serialized as an array of its values in examples and tests.
Function
groupThirdNodes(head: ListNode) → ListNodeExamples
Example 1
head = [1,2,3,4,5,6,7]return = [1,2,4,5,7,3,6]Original positions 3 and 6 contain 3 and 6. The other nodes stay in order as [1,2,4,5,7], followed by [3,6].
Example 2
head = [9,8]return = [9,8]No original position is divisible by 3, so the list stays unchanged.
Constraints
- 0 <= head.length <= 2000
- -1000000000 <= head[i] <= 1000000000
Source note: Screenshots of public Reddit comments describing the reported Adobe OA task and any included author clarification. The practice version adds the details stated in the source note.
More Adobe Online Assessment questions
- Base Unit ConversionsOA · Seen Nov 2026
- Rotate an Array In PlaceOA · PHONE SCREEN · Seen Aug 2026
- Top-Funded Villages and ProjectsOA · Seen Aug 2026
- Count Parent Nodes With a Target SumOA · Seen Aug 2026
- Largest Binary Number by ConcatenationOA · Seen Aug 2026
- Count Events by CategoryOA · Seen Aug 2026
- Graph M-ColoringOA · Seen Aug 2026
- Hall of Shifting TilesOA · Seen Aug 2026
- K-th Ancestor Subtree Preorder QueryOA · Seen Aug 2026
- Maze ReachabilityOA · Seen Aug 2026
Similar questions at other companies
- LRU CacheTypeSafe AI · OA
- Minimize Task Resource ConsumptionNVIDIA · OANVIDIA interview questions
- Least Recently Used CacheMicrosoft · OA · PHONE SCREEN · ONSITE INTERVIEWMicrosoft interview questions
- Largest Microorganism After ConsumptionOpenAI · OAOpenAI interview questions
- Buffet Day GainsUpstart · OAUpstart interview questions
- Chain MergeRubrik · OARubrik interview questions
- LRU Page FaultsExpedia · OAExpedia interview questions
- LFU CacheSnowflake · OA · ONSITE INTERVIEWSnowflake interview questions
- LFU CacheArista Networks · OAArista Networks interview questions
- Find the Intersection Node of Two Linked ListsConcentric AI · OAConcentric AI interview questions
Adobe interview experiences
- Adobe New Grad OA: Unit Conversion and Code Review: 1 Experience
- Adobe Web, QA, DevOps, ML Roles: 13 Experiences (Part 3 of 3)
- Adobe SWE Interviews, Level Unknown: 25 Experiences (Part 2 of 3)
- Adobe Interviews, Level Unknown: 38 Experiences (Part 1 of 3)
- Adobe New Grad MTS Interview Questions: 7 Experiences
- Adobe ML/Research Intern Interviews: 12 Experiences (Part 4 of 4)