PracHub
QuestionsPremiumCoachesLearningGuidesInterview Prep
|Home/Coding & Algorithms/Meta

Solve two linked list/array tasks

Last updated: Mar 29, 2026

Quick Overview

This two-part question evaluates proficiency with fundamental data structures and algorithmic problem-solving—specifically linked list manipulation and array-based reasoning—within the Coding & Algorithms domain and emphasizes practical application skills in implementing efficient algorithms and analyzing time and space complexity.

  • easy
  • Meta
  • Coding & Algorithms
  • Machine Learning Engineer

Solve two linked list/array tasks

Company: Meta

Role: Machine Learning Engineer

Category: Coding & Algorithms

Difficulty: easy

Interview Round: Technical Screen

You are given **two independent coding tasks**. ## Task 1: Remove the N-th node from the end of a singly linked list Given the head of a singly linked list and an integer `n`, remove the **n-th node from the end** of the list and return the head of the modified list. **Input** - `head`: head node of a singly linked list (node has fields `val` and `next`) - `n`: integer **Output** - The head of the list after removal **Constraints (typical interview assumptions)** - `1 <= n <= length(list)` - List length can be up to `10^5` **Example** - List: `1 -> 2 -> 3 -> 4 -> 5`, `n = 2` - Result: `1 -> 2 -> 3 -> 5` --- ## Task 2: Find the k-th missing positive number from a strictly increasing array You are given a strictly increasing array `arr` of positive integers and an integer `k`. Consider the infinite sequence of positive integers `1, 2, 3, ...`. Return the **k-th positive integer that is missing from** `arr`. **Input** - `arr`: strictly increasing array of positive integers - `k`: positive integer **Output** - The k-th missing positive number **Constraints (typical interview assumptions)** - `1 <= arr.length <= 10^5` - `1 <= arr[i] <= 10^9` - `1 <= k <= 10^9` **Example** - `arr = [2, 3, 4, 7, 11]`, `k = 5` - Missing positives are `[1, 5, 6, 8, 9, 10, ...]` → answer is `9`

Quick Answer: This two-part question evaluates proficiency with fundamental data structures and algorithmic problem-solving—specifically linked list manipulation and array-based reasoning—within the Coding & Algorithms domain and emphasizes practical application skills in implementing efficient algorithms and analyzing time and space complexity.

Related Interview Questions

  • Find Shortest Unique Prefixes - Meta (medium)
  • Compute Exclusive Execution Times - Meta (medium)
  • Solve Tree Columns And Maze Variants - Meta (medium)
  • Solve Tree Diameter and Palindromic Counts - Meta (medium)
  • Simulate Monster Team Battles - Meta (hard)
Meta logo
Meta
Dec 14, 2025, 12:00 AM
Machine Learning Engineer
Technical Screen
Coding & Algorithms
2
0
Loading...

You are given two independent coding tasks.

Task 1: Remove the N-th node from the end of a singly linked list

Given the head of a singly linked list and an integer n, remove the n-th node from the end of the list and return the head of the modified list.

Input

  • head : head node of a singly linked list (node has fields val and next )
  • n : integer

Output

  • The head of the list after removal

Constraints (typical interview assumptions)

  • 1 <= n <= length(list)
  • List length can be up to 10^5

Example

  • List: 1 -> 2 -> 3 -> 4 -> 5 , n = 2
  • Result: 1 -> 2 -> 3 -> 5

Task 2: Find the k-th missing positive number from a strictly increasing array

You are given a strictly increasing array arr of positive integers and an integer k. Consider the infinite sequence of positive integers 1, 2, 3, .... Return the k-th positive integer that is missing from arr.

Input

  • arr : strictly increasing array of positive integers
  • k : positive integer

Output

  • The k-th missing positive number

Constraints (typical interview assumptions)

  • 1 <= arr.length <= 10^5
  • 1 <= arr[i] <= 10^9
  • 1 <= k <= 10^9

Example

  • arr = [2, 3, 4, 7, 11] , k = 5
  • Missing positives are [1, 5, 6, 8, 9, 10, ...] → answer is 9

Submit Your Answer to Earn 20XP

Sign in to leave a comment

Loading comments...

Browse More Questions

More Coding & Algorithms•More Meta•More Machine Learning Engineer•Meta Machine Learning Engineer•Meta Coding & Algorithms•Machine Learning Engineer Coding & Algorithms
PracHub

Master your tech interviews with 8,000+ real questions from top companies.

Product

  • Questions
  • Learning Tracks
  • Interview Guides
  • Resources
  • Premium
  • For Universities
  • Student Access

Browse

  • By Company
  • By Role
  • By Category
  • Topic Hubs
  • SQL Questions
  • Compare Platforms
  • Discord Community

Support

  • support@prachub.com
  • (916) 541-4762

Legal

  • Privacy Policy
  • Terms of Service
  • About Us

© 2026 PracHub. All rights reserved.