Morgan Stanley LeetCode Questions
60 questions all-time · 13 easy · 40 medium · 7 hard
| # | Problem | Difficulty | Frequency | Acceptance |
|---|---|---|---|---|
| 1 | Best Time to Buy and Sell Stock Array, Dynamic Programming | Easy | 100 | 0.6% |
| 2 | Best Team With No Conflicts Array, Dynamic Programming, Sorting | Medium | 96 | 0.5% |
| 3 | Find the Longest Valid Obstacle Course at Each Position Array, Binary Search, Binary Indexed Tree | Hard | 92 | 0.6% |
| 4 | Minimum Number of Lines to Cover Points Array, Hash Table, Math, Dynamic Programming, Backtracking, Bit Manipulation, Geometry, Bitmask | Medium | 92 | 0.4% |
| 5 | Minimum Cost to Move Chips to The Same Position Array, Math, Greedy | Easy | 92 | 0.7% |
| 6 | Find Subarrays With Equal Sum Array, Hash Table | Easy | 92 | 0.7% |
| 7 | The Employee That Worked on the Longest Task Array | Easy | 92 | 0.5% |
| 8 | Find The Original Array of Prefix Xor Array, Bit Manipulation | Medium | 92 | 0.9% |
| 9 | Two Sum Array, Hash Table | Easy | 86 | 0.6% |
| 10 | Longest Substring Without Repeating Characters Hash Table, String, Sliding Window | Medium | 79 | 0.4% |
| 11 | Count Subarrays With Fixed Bounds Array, Queue, Sliding Window, Monotonic Queue | Hard | 79 | 0.7% |
| 12 | Delete and Earn Array, Hash Table, Dynamic Programming | Medium | 79 | 0.6% |
| 13 | Merge Intervals Array, Sorting | Medium | 69 | 0.5% |
| 14 | LRU Cache Hash Table, Linked List, Design, Doubly-Linked List | Medium | 69 | 0.5% |
| 15 | Palindrome Number Math | Easy | 69 | 0.6% |
| 16 | First Unique Character in a String Hash Table, String, Queue, Counting | Easy | 69 | 0.7% |
| 17 | Jump Game Array, Dynamic Programming, Greedy | Medium | 62 | 0.4% |
| 18 | Sort Colors Array, Two Pointers, Sorting | Medium | 62 | 0.7% |
| 19 | Copy List with Random Pointer Hash Table, Linked List | Medium | 62 | 0.6% |
| 20 | Kth Largest Element in an Array Array, Divide and Conquer, Sorting, Heap (Priority Queue), Quickselect | Medium | 62 | 0.7% |
| 21 | Group Anagrams Array, Hash Table, String, Sorting | Medium | 62 | 0.7% |
| 22 | Remove Duplicates from Sorted Array Array, Two Pointers | Easy | 62 | 0.6% |
| 23 | Stamping The Sequence String, Stack, Greedy, Queue | Hard | 62 | 0.6% |
| 24 | Make K-Subarray Sums Equal Array, Math, Greedy, Sorting, Number Theory | Medium | 62 | 0.4% |
| 25 | Spiral Matrix Array, Matrix, Simulation | Medium | 62 | 0.6% |
| 26 | Daily Temperatures Array, Stack, Monotonic Stack | Medium | 62 | 0.7% |
| 27 | Remove Nth Node From End of List Linked List, Two Pointers | Medium | 62 | 0.5% |
| 28 | Next Greater Element I Array, Hash Table, Stack, Monotonic Stack | Easy | 51 | 0.8% |
| 29 | Contiguous Array Array, Hash Table, Prefix Sum | Medium | 51 | 0.5% |
| 30 | Meeting Rooms II Array, Two Pointers, Greedy, Sorting, Heap (Priority Queue), Prefix Sum | Medium | 51 | 0.5% |
| 31 | 3Sum Array, Two Pointers, Sorting | Medium | 51 | 0.4% |
| 32 | Subarrays with K Different Integers Array, Hash Table, Sliding Window, Counting | Hard | 51 | 0.7% |
| 33 | Generate Parentheses String, Dynamic Programming, Backtracking | Medium | 51 | 0.8% |
| 34 | Kth Missing Positive Number Array, Binary Search | Easy | 51 | 0.6% |
| 35 | Coin Change II Array, Dynamic Programming | Medium | 51 | 0.6% |
| 36 | Word Search Array, String, Backtracking, Depth-First Search, Matrix | Medium | 51 | 0.5% |
| 37 | Minimum Operations to Reduce X to Zero Array, Hash Table, Binary Search, Sliding Window, Prefix Sum | Medium | 51 | 0.4% |
| 38 | Remove All Adjacent Duplicates in String II String, Stack | Medium | 51 | 0.6% |
| 39 | Longest Common Subsequence String, Dynamic Programming | Medium | 51 | 0.6% |
| 40 | Next Greater Element III Math, Two Pointers, String | Medium | 51 | 0.4% |
| 41 | Minimum Substring Partition of Equal Character Frequency Hash Table, String, Dynamic Programming, Counting | Medium | 51 | 0.4% |
| 42 | Minimum Suffix Flips String, Greedy | Medium | 51 | 0.7% |
| 43 | Next Greater Element II Array, Stack, Monotonic Stack | Medium | 51 | 0.7% |
| 44 | Minimum Number of Taps to Open to Water a Garden Array, Dynamic Programming, Greedy | Hard | 51 | 0.5% |
| 45 | Least Number of Unique Integers after K Removals Array, Hash Table, Greedy, Sorting, Counting | Medium | 51 | 0.6% |
| 46 | Candy Array, Greedy | Hard | 51 | 0.5% |
| 47 | Longest Palindromic Substring Two Pointers, String, Dynamic Programming | Medium | 51 | 0.4% |
| 48 | Maximum Product Subarray Array, Dynamic Programming | Medium | 51 | 0.4% |
| 49 | Reorder List Linked List, Two Pointers, Stack, Recursion | Medium | 51 | 0.7% |
| 50 | Palindrome Linked List Linked List, Two Pointers, Stack, Recursion | Easy | 51 | 0.6% |
| 51 | Longest Increasing Subsequence Array, Binary Search, Dynamic Programming | Medium | 51 | 0.6% |
| 52 | Majority Element Array, Hash Table, Divide and Conquer, Sorting, Counting | Easy | 51 | 0.7% |
| 53 | Sum of Subarray Minimums Array, Dynamic Programming, Stack, Monotonic Stack | Medium | 51 | 0.4% |
| 54 | Coin Change Array, Dynamic Programming, Breadth-First Search | Medium | 51 | 0.5% |
| 55 | Shuffle the Array Array | Easy | 51 | 0.9% |
| 56 | Longest Consecutive Sequence Array, Hash Table, Union-Find | Medium | 51 | 0.5% |
| 57 | Container With Most Water Array, Two Pointers, Greedy | Medium | 51 | 0.6% |
| 58 | Maximum Subarray Array, Divide and Conquer, Dynamic Programming | Medium | 51 | 0.5% |
| 59 | Top K Frequent Elements Array, Hash Table, Divide and Conquer, Sorting, Heap (Priority Queue), Bucket Sort, Counting, Quickselect | Medium | 51 | 0.7% |
| 60 | Count of Range Sum Array, Binary Search, Divide and Conquer, Binary Indexed Tree, Segment Tree, Merge Sort, Ordered Set | Hard | 51 | 0.4% |
How to read this list
The tabs at the top split the questions by how recently people said they were asked in interviews. "Last 30 Days" is the past month, "Last 3 Months" is the past quarter, and so on. "All Time" is every question on record for this company.
Frequency is a score from 0 to 100 for how often a question showed up in that time window. A higher number means it came up more often, so the list starts with the most common questions first. Acceptance is the share of submissions that pass on LeetCode. Click any question to open it on LeetCode.