KatInterview

Topic

Linked Lists interview problems

Pointer manipulation, cycles and list merging. 40 original problems, each with hidden test cases you can run in the browser.

Problems40

12 easy22 medium6 hard

Showing 1–30 of 40 results

  • Compute a list's minimum, its reversal, and whether a target exists in a row- and column-sorted matrix, all in one combined function.

    Auto-gradedlinked-listreversalmatrix-searchtwo-pointers
  • Tests the ability to process a linear collection by dropping elements at even 1-based index positions.

    Auto-gradedlinked-listsarrayspointers
  • Find the first node of one chain that also lies on a second chain, where both chains are encoded in a single successor array, or report -1 if they never converge.

    Auto-gradedlinked-listhash-settwo-pointersintersection
  • Tests index arithmetic and edge-case handling by swapping the first element of a sequence with its k-th element counted from the end, including the case where both are the same element.

    Auto-gradedlinked-listtwo-pointersswapedge-cases
  • Find the single repeated value in an array of size n + 1 containing integers from 1 to n without altering the array or using extra space.

    Auto-gradedtwo-pointersarrayslinked-listfloyds-algorithm
  • Merge two non-decreasing sequences into a single sorted sequence, maintaining stable order on equal values.

    Auto-gradedtwo-pointerslinked-listarrayssorting
  • Reverse each full consecutive block of k items in a list, leaving a shorter leftover tail unchanged; tests pointer-style reversal logic and boundary handling.

    Auto-gradedlinked-listin-place-reversaltwo-pointerssimulation
  • Demonstrate deep copying of a sequential structural chain featuring auxiliary target links via node-level or serialized array transformations.

    Auto-gradedlinked-listsarraysdeep-copy
  • Evaluate two algorithmic challenges using the two-pointer technique: detecting cyclic pointer references and locating index pairs for a target sum in an ordered list.

    Auto-gradedlinked-liststwo-pointersarrays
  • Build an independent duplicate of a linked list whose nodes carry both a next link and an arbitrary jump link, using a serialized list-of-records format.

    Auto-gradedlinked-listhash-mapdeep-copypointers
  • Tests the ability to reverse a sequential list of numbers efficiently, mimicking linked list reversal operations.

    Auto-gradedlinked-listsarrayspointers
  • Flatten a tree-like linked structure with main and side links into a single doubly linked sequence using preorder traversal.

    Auto-gradedlinked-liststrees-graphsstacks-queues
  • Two pointer-manipulation tasks: remove the k-th node from the tail of a singly linked list, and delete a value from a general binary tree by overwriting it with the deepest-rightmost node's value.

    Model answerlinked-listtwo-pointersbinary-treebfs
  • Reverse each full consecutive block of k elements in a list of values, leaving a short trailing remainder untouched, using the pointer-based linked-list technique.

    Auto-gradedlinked-listin-placepointerssimulation
  • Tests a two-pointer merge of two non-decreasing integer lists into a single sorted list, handling empty inputs and duplicate values correctly.

    Auto-gradedtwo-pointersmergesorting
  • Contrast contiguous arrays, linked lists, and unrolled lists for indexed reads, inserts, growth, traversal speed, and cache behavior, and say when each one wins.

    Model answerarrayslinked-listsunrolled-linked-listcache-locality
  • Build a singly linked list with extra jump pointers from index arrays, deep-copy it without sharing nodes, and report the copy's structure by index.

    Auto-gradedlinked-listhash-mapdeep-copypointers
  • Given neighbor links for a group of disjoint chains, count how many nodes sit in the chain containing a given start node.

    Auto-gradedlinked-listtraversaltwo-pointerssimulation
  • Tests pointer manipulation and list traversal to locate the merge point of two singly linked lists in linear time with constant space.

    Auto-gradedtwo-pointerslinked-listspointer-manipulation
  • Tests pointer-manipulation intuition by reordering a singly-linked list (given as an array) into a zigzag pattern based on partitioning nodes into fixed-size buckets.

    Auto-gradedlinked listsarray manipulationreordering
  • Tests cycle detection (Floyd's or similar) on an implicit linked list encoded as a next-pointer array, requiring the candidate to find where the cycle begins.

    Auto-gradedlinked listscycle detectiontwo pointersFloyd's algorithm
  • Tests whether a candidate can verify palindrome structure on a singly linked list in O(n) time and O(1) space while restoring every pointer before returning.

    Auto-gradedtwo-pointerslinked-listsin-place
  • Tests whether a candidate can model item movement across ordered stages using a normalized O(1)-per-move doubly linked list structure.

    Auto-gradedlinked-listsimulationdesign
  • Tests pointer manipulation and node reordering by splitting a singly linked list (given as an array) into odd- and even-indexed sublists and merging them in a specific interleaved pattern.

    Auto-gradedlinked listspointer manipulationreorderingarray simulation
  • Tests pointer-manipulation reasoning by reordering a singly linked list (given as an array) so nodes alternate between the first and second halves, starting from their respective midpoints.

    Auto-gradedlinked liststwo pointersarray manipulation
  • Tests pointer manipulation intuition by reordering a singly linked list represented as an array, interleaving nodes from the front and back halves.

    Auto-gradedlinked liststwo pointersarray manipulation
  • Tests pointer manipulation by collecting nodes from a singly linked list in chunks of k, then reversing the order within each chunk's values to produce a flat list.

    Auto-gradedlinked listsk-group operationspointer manipulation
  • Tests pointer-manipulation intuition by reordering a linked list (given as an array) into a specific interleaved pattern derived from splitting and reversing halves.

    Auto-gradedlinked listsarray manipulationtwo pointers
  • Tests cycle detection on an index-as-next-pointer array to find the single duplicate value and the length of the cycle it creates.

    Auto-gradedlinked listscycle detectionFloyd's algorithm
  • Tests pointer-manipulation thinking by reordering a node list so that the first half and reversed second half are interleaved, all represented as arrays of values.

    Auto-gradedlinked listtwo pointersarray manipulation

More topics