MathWorks Coding Interview Questions: 21 Tagged Problems
21 coding problems tagged MathWorks — 5 easy · 10 medium · 6 hard — with solutions in 13 languages. Plus a 2-week study plan by topic.
- Problems: 21
- By difficulty: 5 easy · 10 medium · 6 hard
- Languages: JavaScript, TypeScript, Python, Java, C++, C, C#, Go, Kotlin, Swift, Rust, PHP and Ruby
- Cost: Free on every plan; sign in to run and submit
21 problems the CodeKairo catalogue tags as commonly asked in MathWorks's coding rounds — 5 easy, 10 medium and 6 hard — each judged by hidden tests in 13 languages. The most common topics among them are Arrays (13), Dynamic Programming (6) and Strings (5). The tag is the catalogue's own annotation of where a problem tends to come up — not a list published by MathWorks, which CodeKairo is not affiliated with.
MathWorks study plan by topic
All 21 problems tagged MathWorks over 2 weeks, about 12 h 30 min of solving, grouped by technique in the order they build on each other — Hash Table, Two Pointers, Binary Search and Stack and 13 more.
Week 1: Hash Table, Two Pointers, Binary Search +5
11 problems on Hash Table, Two Pointers, Binary Search, Stack, Queue, Monotonic Stack, Matrix and Simulation, easiest first within each topic.
- Degree of an Array Easy
- Keyboard Row Easy
- Last Substring in Lexicographical Order Hard
- Maximum Number of Alloys Medium
- Earliest Second to Mark Indices I Medium
- Valid Parentheses Easy
- Count Subarrays With Fixed Bounds Hard
- Minimum Cost Tree From Leaf Values Medium
- Unique Paths II Medium
- Cherry Pickup Hard
- Reshape the Matrix Easy
Week 2: Heap, Bit Manipulation, Bitmask +6
10 problems on Heap, Bit Manipulation, Bitmask, Combinatorics, Breadth-First Search, Union Find, Dynamic Programming, Game Theory and Brainteaser, easiest first within each topic.
- Task Scheduler Medium
- Total Cost to Hire K Workers Medium
- Counting Bits Easy
- Beautiful Arrangement Medium
- Count Anagrams Hard
- Shortest Distance from All Buildings Hard
- Number of Islands Medium
- Count Vowels Permutation Hard
- Remove Colored Pieces if Both Neighbors are the Same Color Medium
- Bulb Switcher Medium
All problems tagged MathWorks
Easy (5)
- Keyboard Row Array, String, Hash Table
- Counting Bits Dynamic Programming, Bit Manipulation
- Reshape the Matrix Array, Matrix, Simulation
- Degree of an Array Array, Hash Table
- Valid Parentheses String, Stack
Medium (10)
- Earliest Second to Mark Indices I Array, Binary Search, Greedy
- Maximum Number of Alloys Array, Binary Search
- Beautiful Arrangement Dynamic Programming, Backtracking, Bit Manipulation
- Remove Colored Pieces if Both Neighbors are the Same Color Math, String, Greedy
- Total Cost to Hire K Workers Array, Two Pointers, Simulation
- Minimum Cost Tree From Leaf Values Array, Dynamic Programming, Stack
- Bulb Switcher Math, Brainteaser
- Unique Paths II Array, Dynamic Programming, Matrix
- Number of Islands Array, Matrix, Depth-First Search
- Task Scheduler Array, Greedy, Heap
Hard (6)
- Last Substring in Lexicographical Order String, Two Pointers
- Count Anagrams Hash Table, Math, String
- Shortest Distance from All Buildings Array, Matrix, Breadth-First Search
- Cherry Pickup Array, Matrix, Dynamic Programming
- Count Subarrays With Fixed Bounds Array, Sliding Window, Two Pointers
- Count Vowels Permutation Dynamic Programming
Topics MathWorks asks most
- Arrays 13 problems
- Dynamic Programming 6 problems
- Strings 5 problems
- Matrix 5 problems
- Greedy 4 problems
- Hash Table 3 problems
- Math 3 problems
- Two Pointers 3 problems
- Counting 2 problems
- Binary Search 2 problems
- Stack 2 problems
- Simulation 2 problems