100+ curated problems from top tech interviews
129 problems found
BFS level by level...
Check if number is happy...
Check palindrome with alphanumeric only...
Find element appearing > n/2 times...
Count 1 bits in integer...
Add two numbers represented by lists...
Reorder list in alternating pattern...
Recent request count in range...
Check if root-leaf path equals target...
Reverse bits of integer...
Reverse character array in-place...
Find position to insert target...
Find single number in array...
Time for all nodes to receive signal...
Integer square root...
Implement autocomplete...
Find max sum path in tree...
Remove nth node from linked list...
Max length after k character replacements...
Find range of target in sorted array...
Query key value at timestamp...
Max ones after flipping k zeros...
Find all substrings with concatenated words...
Find all unique quadruplets...
Find min eating speed for h hours...
Implement prefix tree...
Max fruit with at most 2 types...
Find minimum length subarray with sum >= target...
Check if graph is valid tree...
Count connected components...
Evaluate RPN expression...
Largest rectangle in histogram...
Simplify Unix file path...
Search word in 2D grid...
Partition string into palindromes...
Check if subset sum exists...
Find start gas station...
Bitwise AND of range...
Calculate x^n...
Convert fraction to decimal...
Order characters from alien dictionary...
Days until warmer temperature...
Replace words with dictionary root...
Find kth largest element...
Reorganize string by frequency...
Minimum conference rooms needed...
Find longest substring without repeating...
Reverse singly linked list...
Find first bad version...
Minimum candies for children...
Find median with streaming numbers...
Search words in grid using trie...
Check if linked list is palindrome...
Check if parentheses are valid...
Inorder tree traversal...
Find max depth of tree...
Check if two trees are same...
Generate valid parentheses combinations...
Find max profit from one transaction...
Can reach last index...
Minimum jumps to reach end...
Check if s1 permutation in s2...
Generate all k-combinations...
Find LCA in binary search tree...
Get rightmost nodes at each level...
Letter combinations of phone number...
Check if tree is valid BST...
Maximum non-overlapping intervals...
Remove minimum intervals for non-overlap...
Queue using two stacks...
Stack supporting min queries...
Find two numbers in sorted array...
Merge two sorted arrays in-place...
Find target in rotated array...
Find median of two sorted arrays...
Convert tree to/from string...
Build tree from traversals...
Merge two sorted linked lists...
Remove duplicates in sorted list...
Merge k sorted linked lists...
Insert interval into sorted list...
Find longest consecutive sequence...
Validate sudoku board...
Encode/decode list of strings...
Maximum sum without adjacent elements...
Number of ways to make amount...
Traverse matrix in spiral order...
Deep copy list with random pointers...
Number of paths in grid...
Number of ways to decode string...
Find max sum contiguous subarray...
Maximum coins from bursting balloons...
Deep copy undirected graph...
Shortest path with at most k stops...
Flip surrounded regions...
Set entire row/col to 0 if element is 0...
Find all unique triplets summing to 0...
Given an array of intervals where intervals[i] = [starti, endi], merge all overlapping intervals, and return an array of the non-overlapping intervals...
A transformation sequence from beginWord to endWord using dictionary wordList is a sequence where every adjacent pair of words differs by a single let...
Given an m x n 2D binary grid grid which represents a map of '1's (land) and '0's (water), return the number of islands. An island is surrounded by wa...
Design a data structure that follows the constraints of a Least Recently Used (LRU) cache. Implement the LRUCache class with get and put operations in...
There are a total of numCourses courses you have to take. Some courses may have prerequisites. Given the total number of courses and a list of prerequ...
The n-queens puzzle is the problem of placing n queens on an n x n chessboard such that no two queens attack each other. Given an integer n, return al...
Given an array nums of distinct integers, return all the possible permutations. You can return the answer in any order....
Given an integer array nums of unique elements, return all possible subsets (the power set). The solution set must not contain duplicate subsets....
A path in a binary tree is a sequence of nodes where each pair of adjacent nodes in the sequence has an edge connecting them. The path sum of a path i...
There is an integer array nums sorted in ascending order (with distinct values). Prior to being passed to your function, nums is possibly rotated at a...
Given a binary search tree (BST), find the lowest common ancestor (LCA) node of two given nodes in the BST....
Given two strings word1 and word2, return the minimum number of operations required to convert word1 to word2. You have the following three operations...
You are climbing a staircase. It takes n steps to reach the top. Each time you can either climb 1 or 2 steps. In how many distinct ways can you climb ...
You are given an integer array coins representing coins of different denominations and an integer amount representing a total amount of money. Return ...
Given a string s and a dictionary of strings wordDict, return true if s can be segmented into a space-separated sequence of one or more dictionary wor...
Given an integer array nums, return the length of the longest strictly increasing subsequence....
Given the root of a binary tree, invert the tree, and return its root....
Given an array of integers nums which is sorted in ascending order, and an integer target, write a function to search target in nums. If target exists...
Given a string s, find the length of the longest substring without repeating characters....
A phrase is a palindrome if, after converting all uppercase letters into lowercase letters and removing all non-alphanumeric characters, it reads the ...
Given an integer array nums, return all the triplets [nums[i], nums[j], nums[k]] such that i != j, i != k, and j != k, and nums[i] + nums[j] + nums[k]...
You are given an integer array height of length n. There are n vertical lines drawn such that the two endpoints of the ith line are (i, 0) and (i, hei...
Given two strings s and t of lengths m and n respectively, return the minimum window substring of s such that every character in t (including duplicat...
Given n non-negative integers representing an elevation map where the width of each bar is 1, compute how much water it can trap after raining....
You are given an array of integers nums, there is a sliding window of size k which is moving from the very left of the array to the very right. You ca...
Given an array of strings strs, group the anagrams together. You can return the answer in any order....
Given an integer array nums, return true if any value appears at least twice in the array, and return false if every element is distinct....
Given two strings s and t, return true if t is an anagram of s, and false otherwise. An Anagram is a word or phrase formed by rearranging the letters ...
Given an integer array nums and an integer k, return the k most frequent elements. You may return the answer in any order....
Given an array of integers nums and an integer target, return indices of the two numbers such that they add up to target. You may assume that each inp...
Given an unsorted array of integers nums, return the length of the longest consecutive elements sequence. You must write an algorithm that runs in O(n...
Given an integer array nums, return an array answer such that answer[i] is equal to the product of all the elements of nums except nums[i]. You must w...