LinkedIn software engineer interviews cover algorithms, data structures, system design, and coding problems drawn from real interview rounds.
` 2 -> a, b, c 3 -> d, e, f 4 -> g, h, i 5 -> j, k, l 6 -> m, n, o 7 -> p, q, r, s 8 ->...Input: Listsignal of 0s and 1s representing antenna readings logged in sequence, where 1 means good signal and 0 means...Input: Array"teamId action timestamp", where action is...Input: Graph (nodes and edges)BuildPipeline class:...Input: Graph (nodes and edges)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)locations representing the...Input: Array of integersA and B. Each value in the catalog represents a product size. Find a pair [a, b] where a...Input: Arrayk substitution operations on a number string s. In each operation, choose any digit in s that is...Input: Stringdef shortest_path(graph: Dict[str, List[str]], start: str, target: str) -> List[str]:graph = {'A': ['B', 'C'], 'B': ['A', 'D'], 'C': ['A'], 'D': ['B']}, start = 'A', target = 'D' ['A', 'B', 'D'] graph = {'A': ['B', 'C'], 'B': ['A'], 'C': ['A'], 'D': []}, start = 'A', target = 'D' [] s, write a function that checks if s is a valid palindrome. A valid palindrome reads the same backward as forward after converting all uppercase letters to lowercase and excluding all non-alphanumeric characters.def isPalindrome(s: str) -> bool:"A man, a plan, a canal: Panama" True amanaplanacanalpanama, which is a palindrome."race a car" False 0 <= s.length <= 2 * 10^5 s consists of printable ASCII characters.nums, find the contiguous subarray (containing at least one number) which has the largest sum and return its sum. You must solve this problem in O(n) time complexity. def max_subarray_sum(nums: List[int]) -> int: nums = [-2,1,-3,4,-1,2,1,-5,4] 6 [4,-1,2,1] has the largest sum = 6. nums = [1] 1 1, so the largest sum is 1. 1 <= nums.length <= 10^5 -10^4 <= nums[i] <= 10^4 s, your task is to determine if it is a valid palindrome, considering only alphanumeric characters and ignoring cases. A valid palindrome reads the same forward and backward when ignoring non-alphanumeric characters.def is_valid_palindrome(s: str) -> bool:1 <= len(s) <= 2 * 10^5s, your task is to determine if it is a palindrome considering only alphanumeric characters (a-z, A-Z, 0-9) and ignoring cases. You may assume the input string only contains printable ASCII characters.Function/class signature:def is_palindrome(s: str) -> bool:"A man, a plan, a canal: Panama"True"race a car"False0 <= s.length <= 2 * 10^5s consists of printable ASCII characters.s is a valid palindrome, considering only alphanumeric characters and ignoring case. Return true if it is a palindrome, otherwise return false.def is_palindrome(s: str) -> bool:"A man, a plan, a canal: Panama" True amanaplanacanalpanama, which reads the same backward."race a car" False raceacar, which does not form a palindrome.1 <= len(s) <= 2 * 10^5 s, return true if it is a palindrome, considering only alphanumeric characters and ignoring case. A palindrome reads the same backward as forward.Function/class signature:def is_palindrome(s: str) -> bool:"A man, a plan, a canal: Panama" true amanaplanacanalpanama which is the same forwards and backwards."race a car" false raceacar which is not the same backward.0 <= s.length <= 2 * 10^5 s consists of printable ASCII characters.n representing the number of profiles and a list of connections edges, return the connected components across profiles.int n, edges defined as a list of pairs representing connections.List[List[int]] — a list that contains all connected components, with each component being a list of profile IDs.0 <= n <= 20000 <= edges.length <= n * (n - 1) / 2string s, return the length of the longest substring without repeating characters.string s int — length of the longest substring without repeating characters.0 <= s.length <= 5 * 10^4s consists of English letters, digits, symbols, and spaces.TwitterFeed that handles user activity feeds and allows users to follow/unfollow other users.postTweet(userId: int, tweet: str), getNewsFeed(userId: int), follow(followerId: int, followeeId: int), and unfollow(followerId: int, followeeId: int).List[str] for getNewsFeed, containing up to 10 most recent tweets from the user and their followed users.UserIds are in the range of 1 to 10^4Tweet content can be up to 140 characters.LRUCache that supports the following operations:get(key: int) -> int: Returns the value of the key if the key exists, otherwise return -1.put(key: int, value: int): Update the value of the key if the key exists, or add the key-value pair if the key does not exist. When the cache reaches its capacity, it should invalidate the least recently used item before inserting a new item.capacity - maximum number of items the cache can hold.int for get, no output for put.1 <= capacity <= 30000 <= key, value <= 10^4Sign up for free to access walkthroughs, AI-generated questions, and more.
Get Started Free