MathWorks Interview Questions — 29 DSA Problems
28 problems with full solutions in Python, Java, C++, JavaScript, Go, Rust.
Most frequently asked MathWorks LeetCode questions for software engineering interviews.
- Count Subarrays With Fixed Bounds (HARD) — Array, Queue, Sliding Window, Monotonic Queue
- Maximum Number of Alloys (MEDIUM) — Array, Binary Search
- Sell Diminishing-Valued Colored Balls (MEDIUM) — Array, Math, Binary Search, Greedy, Sorting, Heap (Priority Queue)
- Reshape the Matrix (EASY) — Array, Matrix, Simulation
- Total Cost to Hire K Workers (MEDIUM) — Array, Two Pointers, Heap (Priority Queue), Simulation
- Earliest Second to Mark Indices I (MEDIUM) — Array, Binary Search
- Binary Tree Cameras (HARD) — Dynamic Programming, Tree, Depth-First Search, Binary Tree
- Keyboard Row (EASY) — Array, Hash Table, String
- Maximum Palindromes After Operations (MEDIUM) — Array, Hash Table, String, Greedy, Sorting, Counting
- Shopping Offers (MEDIUM) — Array, Dynamic Programming, Backtracking, Bit Manipulation, Memoization, Bitmask
- Earliest Second to Mark Indices II (HARD) — Array, Binary Search, Greedy, Heap (Priority Queue)
- Last Substring in Lexicographical Order (HARD) — Two Pointers, String
- Count Anagrams (HARD) — Hash Table, Math, String, Combinatorics, Counting
- Remove Colored Pieces if Both Neighbors are the Same Color (MEDIUM) — Math, String, Greedy, Game Theory
- Minimum Cost Tree From Leaf Values (MEDIUM) — Array, Dynamic Programming, Stack, Greedy, Monotonic Stack
- Pass the Pillow (EASY) — Math, Simulation
- String Transformation (HARD) — Math, String, Dynamic Programming, String Matching
- Minimum Edge Reversals So Every Node Is Reachable (HARD) — Dynamic Programming, Depth-First Search, Breadth-First Search, Graph
- Longest String Chain (MEDIUM) — Array, Hash Table, Two Pointers, String, Dynamic Programming, Sorting
- Sum of Distances in Tree (HARD) — Dynamic Programming, Tree, Depth-First Search, Graph
- Number of Divisible Triplet Sums (MEDIUM) — Array, Hash Table
- Split Array Largest Sum (HARD) — Array, Binary Search, Dynamic Programming, Greedy, Prefix Sum
- Break a Palindrome (MEDIUM) — String, Greedy
- Reverse Nodes in k-Group (HARD) — Linked List, Recursion
- Maximum Difference Between Increasing Elements (EASY) — Array
- Convert Binary Number in a Linked List to Integer (EASY) — Linked List, Math
- Longest Repeating Character Replacement (MEDIUM) — Hash Table, String, Sliding Window
- Distinct Subsequences (HARD) — String, Dynamic Programming
- Beautiful Arrangement (MEDIUM) — Array, Dynamic Programming, Backtracking, Bit Manipulation, Bitmask
M
MathWorks
29 questions tracked28 with solutions
Frequency scoreSorted highest → lowest frequency✓ Our Solution = we have a detailed walkthrough
Showing 29 of 29 questions
1ArrayQueueSliding WindowMonotonic Queue
3ArrayMathBinary SearchGreedy+2
5ArrayTwo PointersHeap (Priority Queue)Simulation
7Dynamic ProgrammingTreeDepth-First SearchBinary Tree
9ArrayHash TableStringGreedy+2
10ArrayDynamic ProgrammingBacktrackingBit Manipulation+2
11ArrayBinary SearchGreedyHeap (Priority Queue)
13Hash TableMathStringCombinatorics+1
14MediumRemove Colored Pieces if Both Neighbors are the Same Color✓ Our Solution MathStringGreedyGame Theory
15ArrayDynamic ProgrammingStackGreedy+1
17MathStringDynamic ProgrammingString Matching
18Dynamic ProgrammingDepth-First SearchBreadth-First SearchGraph
19ArrayHash TableTwo PointersString+2
20Dynamic ProgrammingTreeDepth-First SearchGraph
21MediumNumber of Divisible Triplet Sums
ArrayHash Table
22ArrayBinary SearchDynamic ProgrammingGreedy+1
27Hash TableStringSliding Window
28StringDynamic Programming
29ArrayDynamic ProgrammingBacktrackingBit Manipulation+1