Linkedin Software Engineer Coding & Algorithms Interview Questions
Master your tech interview with our curated database of real questions from top companies.
Solve min window & animal conflicts
Question LeetCode 76. Minimum Window Substring: Given strings s and t, return the smallest substring of s that contains every character of t (includin...
Reverse a linked list
Question LeetCode 206. Reverse Linked List — Given the head of a singly linked list, reverse the list and return the reversed list. https://leetcode.c...
Find lowest common ancestor
Question LeetCode 236. Lowest Common Ancestor of a Binary Tree — Given a binary tree, find the lowest common ancestor (LCA) of two given nodes. Follow...
Count islands and distinct shapes
Question LeetCode 200. Number of Islands LeetCode 694. Number of Distinct Islands https://leetcode.com/problems/number-of-islands/description/ https:/...
Implement an LRU cache with follow-ups
Coding: Implement an LRU Cache and discuss concurrency Design and implement an in-memory Least Recently Used (LRU) cache data structure. The cache sho...
Solve six algorithmic problems
Answer the following independent algorithmic prompts. For each, explain your approach, justify data structures, analyze time/space complexity, and pro...
Detect intersection of two linked lists
Given two singly linked lists that may converge to share a common tail, determine whether they intersect and return the first node at which they join....
Compare heap and stack memory
Compare heap and stack memory. Explain how each is allocated and freed, typical lifetimes of data stored there, access patterns and performance charac...
Determine sanitized palindrome in string
Write a function that determines whether a string is a palindrome after removing non-alphanumeric characters and ignoring case (e.g., punctuation, whi...
Differentiate Java final, finalize, finally
Differentiate Java's final, finalize, and finally. Define what final means for variables, methods, and classes and give examples; explain what finaliz...
Find k closest values in a BST
Given a binary search tree with n nodes and a real target t, return k node values whose distances to t are smallest. Implement an algorithm with O(log...
Minimize adjacent-color assignment cost
You are given H linear items (e.g., houses) and an H×C cost matrix where cost[i][c] is the cost of assigning color c to item i. Adjacent items cannot ...
Design a max-stack with efficient operations
Design a stack that supports push (x), pop(), top(), peekMax(), and popMax(). The popMax operation must remove and return the maximum element; if ther...
Analyze time and space complexity
For any algorithm you implement, analyze its time and space complexity using Big-O notation. Derive and justify the best, average, and worst-case comp...