Skip to main content

LinkedIn Coding Interview Questions

32 LinkedIn coding interview problems with full optimal solutions — 4 easy, 21 medium, 7 hard. Every problem ships with multiple approaches (brute-force first, then the optimal), complexity tables for each, company-specific tips on what an LinkedIn interviewer values, and a FAQ section.

Showing 21 problems of 32

  • #56mediumfoundational

    56. Merge Intervals

    Merge all overlapping intervals in a list into non-overlapping ranges — LinkedIn uses this pattern to consolidate overlapping employment date ranges in member profiles and to compact calendar availability windows, making it one of the most practically grounded problems in their interview bank.

  • #91mediumfoundational

    91. Decode Ways

    Count the number of ways to decode a digit string where each letter maps to 1–26 — LinkedIn asks this DP problem to test whether you can enumerate valid interpretation paths under constraints, the same combinatorial reasoning used in their NLP pipeline for ambiguous entity recognition in profile text.

  • #133mediumfoundational

    133. Clone Graph

    Deep-copy a connected undirected graph using BFS and a hash map — a near-literal model of how LinkedIn clones member connection graphs across data centers, making it one of the most contextually on-brand questions in their rotation.

  • #199mediumfoundational

    199. Binary Tree Right Side View

    Return the values visible when looking at a binary tree from the right side — LinkedIn applies this BFS-by-level pattern to render hierarchical org-chart data, surfacing only the rightmost node at each reporting tier, a frequent warm-up before harder tree design questions.

  • #200mediumfoundational

    200. Number of Islands

    Count connected landmasses in a grid using BFS or DFS — LinkedIn uses this to probe how you think about connected-component discovery, the same graph reasoning behind mapping professional networks and finding isolated clusters in the member graph.

  • #207mediumfoundational

    207. Course Schedule

    Determine if a set of courses with prerequisites can all be finished — this is cycle detection on a directed graph, the exact algorithm LinkedIn runs to validate skill-path dependency chains and surface circular credential requirements in their learning platform.

  • #238mediumfoundational

    238. Product of Array Except Self

    Compute the product of every array element except the current one — without division — using prefix and suffix passes. LinkedIn asks this to test whether you can reason about O(n) algorithms under artificial constraints, mirroring how their data pipeline computes per-member aggregates that exclude the member's own data.

  • #253mediumfoundational

    253. Meeting Rooms II

    Find the minimum number of meeting rooms needed to schedule all intervals without overlap — LinkedIn applies this algorithm to allocate recruiter calendar slots and to detect overlapping employment periods in member profiles, one of their most-cited interval problems.

  • #347mediumfoundational

    347. Top K Frequent Elements

    Return the k most frequent elements from an array — this is the algorithm behind LinkedIn's 'People You May Know' ranking and trending job suggestion surfaces, where you need the top-K signals from a frequency count without sorting the entire dataset.

  • #47mediumfrequently asked

    47. Permutations II

    Given a collection of integers (possibly with duplicates), return all unique permutations. LinkedIn asks this on the backtracking round — they want the sort-then-skip-duplicates pattern, not generate-then-dedupe.

    4 free resourcesSolve →
  • #150mediumcompany favorite

    150. Evaluate Reverse Polish Notation

    Given an array of tokens in Reverse Polish (postfix) notation, evaluate and return the result. LinkedIn asks this because it's the textbook stack problem — they want clean push-on-operand, pop-pop-apply-push-on-operator without any parsing distractions.

    4 free resourcesSolve →
  • #152mediumfrequently asked

    152. Maximum Product Subarray

    Given an integer array, find the contiguous subarray with the largest product. LinkedIn asks this on the DP round because negatives turn Kadane on its head — you need to track BOTH min and max running products to handle sign flips.

    4 free resourcesSolve →
  • #208mediumcompany favorite

    208. Implement Trie (Prefix Tree)

    Implement a Trie with insert, search, and startsWith. LinkedIn asks this because it's the foundation of their typeahead and autocomplete features — they want a clean node-with-children-map structure and the isEnd boolean.

    4 free resourcesSolve →
  • #230mediumfrequently asked

    230. Kth Smallest Element in a BST

    Given a BST and integer k, return the kth smallest value. LinkedIn asks this on the BST round — they want the iterative inorder with early-stop, AND the follow-up answer if the tree is modified frequently (augment with subtree size).

    4 free resourcesSolve →
  • #244mediumcompany favorite

    244. Shortest Word Distance II

    Same as Shortest Word Distance but with many queries. LinkedIn asks this to test whether you can amortize cost across queries — pre-bucket indices by word, then run a merge-like two-pointer walk per query.

    4 free resourcesSolve →
  • #245mediumcompany favorite

    245. Shortest Word Distance III

    Same as Shortest Word Distance but word1 might equal word2 — meaning you need the closest pair of occurrences of the same word. LinkedIn asks this as the culminating follow-up to the series, testing whether you spot the asymmetric case before writing code.

    4 free resourcesSolve →
  • #277mediumcompany favorite

    277. Find the Celebrity

    Given n people and a knows(a, b) API, find THE celebrity — someone known by everyone but who knows no one. LinkedIn asks this because it's the canonical 'elimination by partial order' problem — n calls find a candidate, n calls verify.

    4 free resourcesSolve →
  • #339mediumcompany favorite

    339. Nested List Weight Sum

    Given a nested list of integers, return the sum of all integers weighted by their depth. LinkedIn asks this on the recursion round — they want clean DFS or BFS code that uses the provided NestedInteger interface without unpacking it eagerly.

    4 free resourcesSolve →
  • #364mediumcompany favorite

    364. Nested List Weight Sum II

    Same as Nested List Weight Sum but the weighting is INVERTED — deepest leaves are weight 1 and the root is the heaviest. LinkedIn asks this as the trickier follow-up; the clean solution is a 'cumulative sum at each depth' trick that avoids two passes.

    4 free resourcesSolve →
  • #366mediumcompany favorite

    366. Find Leaves of Binary Tree

    Given a binary tree, collect its leaves and remove them, then repeat. Return the order of removals. LinkedIn asks this because the elegant solution isn't iterative removal — it's a 'height from leaf' DFS that buckets each node by its eventual removal layer.

    4 free resourcesSolve →
  • #797mediumfrequently asked

    797. All Paths From Source to Target

    Given a DAG with n nodes labeled 0 to n-1, find all possible paths from node 0 to node n-1. LinkedIn asks this on the graph traversal round — they want clean DFS with path tracking, no DP needed (because it's a DAG and paths could be exponential).

    4 free resourcesSolve →

Related interview-prep guides

Interview Platforms

HackerRank Tech Interview Guide 2026: What It Tests, How It Tracks You, and the Modern Setup

HackerRank is still the volume leader in first-round technical screens for 2026 tech hiring. A browser-sandboxed coding environment that logs every keystroke, paste event, and tab-focus change inside its own tab. This guide covers what it tests, the boundary of what it can and cannot detect, and how a modern desktop setup pairs with a HackerRank session without leaking into the screen-share.

Interview Platforms

Karat Technical Interview Guide 2026: How the Third-Party Loop Actually Works

Karat is technical-interview-as-a-service. Karat-employed engineers run the technical loop for the hiring company in Karat's own recorded video and coding environment. The dynamic is different from an in-house interview: the interviewer is a contractor, not a future teammate, the rubric is fixed, the session is recorded for asynchronous review, and the hiring team's engineers watch the playback a day later. This guide is the practical map of how that loop works in 2026 and how a modern desktop setup runs alongside it.

Interview Platforms

Microsoft Teams for Tech Interviews in 2026: The Complete Candidate Guide

Microsoft Teams is the default interview surface at any company running Office 365: Fortune 500, finance, healthcare, government tech, legacy enterprise. The recording-and-transcript reality changes the threat model versus Zoom, but the OS-level boundary that protects a modern desktop AI setup is the same. This is the candidate-side guide to running a Teams interview in 2026.

LinkedIn Coding Interview Questions — Full Solutions — InterviewChamp.AI