LinkedIn logo

LinkedIn Hard Interview Questions

5 hard-level practice questions for LinkedIn technical interviews

coding Hard Verified Question #1

1. [OA] Minimum Weight Ceiling Path


Category: Graph coding problem
A network topology connects n servers labeled 1 to n. Each connection is a bidirectional link with a bandwidth cost. A network engineer needs...
Input: Graph (nodes and edges)
Output: Integer
coding Hard Verified Question #2

2. Priority Cache System


Category: String coding problem
A CDN (Content Delivery Network) maintains a fixed-capacity cache of web content. Each content item has an associated priority score. When the cache...
Input: String
Output: Integer
coding Hard Verified Question #3

3. Combine N-ary Trees


Category: Tree coding problem
You are given the roots of two N-ary organization charts, each representing a hierarchical department structure. Every node has an integer...
Input: List
Output: Computed result
coding Hard graph #1

1. [OA] Depth First Search — Find all connected components in a network of LinkedIn profiles

LinkedIn's algorithm can identify connections between users to enhance networking. We want to find all connected components given a list of connections between user profiles.
Problem statement: Given an integer n representing the number of profiles and a list of connections edges, return the connected components across profiles.
- Input: int n, edges defined as a list of pairs representing connections.
- Output: List[List[int]] — a list that contains all connected components, with each component being a list of profile IDs.
Example 1:
Input: n = 5, edges = [[0, 1], [1, 2], [3, 4]]
Output: [[0, 1, 2], [3, 4]]
Explanation: Profile 0 is connected to 1 and 2; profile 3 is connected to 4.
Example 2:
Input: n = 4, edges = [[0, 1], [1, 0], [2, 3]]
Output: [[0, 1], [2, 3]]
Constraints:
- 0 <= n <= 2000
- 0 <= edges.length <= n * (n - 1) / 2
coding Hard sliding window #2

2. [OA] Sliding Window — Implement a feature to find the longest substring without repeating characters in profile descriptions

LinkedIn users often write descriptive profiles, and analyzing these descriptions can help in improving user engagement. The goal is to identify the longest substring from a given profile description where no characters are repeated.
Problem statement: Given a string s, return the length of the longest substring without repeating characters.
- Input: string s
- Output: int — length of the longest substring without repeating characters.
Example 1:
Input: "abcabcbb"
Output: 3
Explanation: The answer is "abc", with the length of 3.
Example 2:
Input: "bbbbb"
Output: 1
Explanation: The answer is "b", with the length of 1.
Constraints:
- 0 <= s.length <= 5 * 10^4
- s consists of English letters, digits, symbols, and spaces.

Start practicing LinkedIn questions

Sign up for free to access walkthroughs, AI-generated questions, and more.

Get Started Free