0% found this document useful (0 votes)
32 views14 pages

Top 37 Coding Interview Questions

The document lists various coding problems along with their descriptions, including finding the median of two sorted arrays, longest palindromic substring, and maximum depth of a binary tree. Each problem is accompanied by a practice link for further engagement. The problems cover a wide range of topics in algorithms and data structures.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
32 views14 pages

Top 37 Coding Interview Questions

The document lists various coding problems along with their descriptions, including finding the median of two sorted arrays, longest palindromic substring, and maximum depth of a binary tree. Each problem is accompanied by a practice link for further engagement. The problems cover a wide range of topics in algorithms and data structures.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 14

37

1 Median of Two Sorted Arrays


Problem: Find the median of two sorted arrays

Practice Link

2 Longest Palindromic Substring

Problem: Find the longest palindromic substring in a


given string

Practice Link

3 Container With Most Water

Problem: Given n non-negative integers representing


the heights, find two lines that form a container to
hold the most water

Practice Link

www.learnbay.co
4 Two Sum

Problem: Given an array of integers nums and an integer


target return indices of the two numbers such that they
add up to the target

Practice Link

5 Add Two Numbers


Problem: Add two non-empty linked lists representing
two non-negative integers

Practice Link

6 Longest Unique Substring

Problem: Add two non-empty linked lists representing


two non-negative integers

Practice Link

www.learnbay.co
7 Search in Rotated Sorted Array

Problem: Search for a target value in a rotated


sorted array

PracticeLink

8 Combination Sum

Problem: Find all unique combinations of candidates


where the chosen numbers sum to the target

PracticeLink

9 Permutations
Problem: Return all possible permutations of a
collection of numbers

Practice Link

www.learnbay.co
10 Merge Two Sorted Lists

Problem: Merge two sorted linked lists into one sorted list

PracticeLink

11 Best Time to Buy and Sell Stock

Problem: Find the maximum profit by choosing a single


day to buy one stock and a different day to sell

PracticeLink

12 Valid Parentheses
Problem: Determine if the input string of parentheses
is valid

Practice Link

www.learnbay.co
13 Coin Change

Problem: Find the minimum number of coins needed to


make a certain amount

PracticeLink

14 Longest Increasing Subsequence

Problem: Find the length of the longest strictly


increasing subsequence

PracticeLink

15 Binary Tree Inorder Traversal

Problem: Perform in order traversal on a binary tree

PracticeLink

www.learnbay.co
16 Subsets

Problem: Return all possible subsets of a given array

PracticeLink

17 Word Search
Problem: Find if a word exists in a grid following
specific rules

PracticeLink

18 Climbing Stairs
Problem: Calculate the number of distinct ways to
reach the top of a staircase with `n` steps.

PracticeLink

www.learnbay.co
19 Binary Tree Level Order Traversal

Problem: Return level-order traversal of a binary tree

PracticeLink

20 Serialize and Deserialize Binary Tree

Problem: Convert a binary tree into a serialized string


and vice versa

PracticeLink

21 Lowest Common Ancestor of Binary Tree


Problem: Find the lowest common ancestor of two
nodes in a binary tree

PracticeLink

www.learnbay.co
22 Maximum Depth of Binary Tree

Problem: Find the maximum depth of a binary tree

PracticeLink

23 Validate Binary Search Tree


Problem: Determine if a binary tree is a valid binary
search tree

PracticeLink

24 Kth Smallest Element in a BST

Problem: Find the kth smallest element in a binary


search tree

PracticeLink

www.learnbay.co
25 Insert Interval
Problem: Insert a new interval into a list of non-
overlapping intervals

PracticeLink

26 Non-overlapping Intervals
Problem: Find the minimum number of intervals to
remove to make the rest of the intervals non-
overlapping

PracticeLink

27 Search a 2D Matrix

Problem: Search for a target value in an m x n matrix

PracticeLink

www.learnbay.co
28 Product of Array Except Self

Problem: Return an array `answer` where `answer[i]` is


the product of all elements of the array except `nums[i]`

PracticeLink

29 Maximum Subarray

Problem: Find the contiguous subarray with the


maximum sum

PracticeLink

30 Merge Intervals
Problem: Merge overlapping intervals

PracticeLink

www.learnbay.co
31 Sliding Window Maximum

Problem: Find the maximum in each sliding window of


size `k`

PracticeLink

32 Top K Frequent Elements


Problem: Find the k most frequent elements in an array

PracticeLink

33 Number of Islands
Problem: Count the number of islands in a grid

PracticeLink

34 Word Search II
Problem: Find all words on the board

PracticeLink

www.learnbay.co
35 Course Schedule
Problem: Determine if you can finish all courses given
the prerequisites

PracticeLink

36 Implement Trie (Prefix Tree)

Problem: Implement a trie with `insert`, `search`, and


`startsWith` functions

PracticeLink

37 Palindrome Partitioning

Problem: Partition a string such that every substring


is a palindrome

PracticeLink

www.learnbay.co
38 Valid Anagram
Problem: Determine if two strings are anagrams
of each other

PracticeLink

39 Group Anagrams

Problem: Group strings that are anagrams of each


other

PracticeLink

40 Minimum Window Substring

Problem: Find the minimum window substring in `s`


that contains all the characters of `t`

PracticeLink

www.learnbay.co

You might also like