28 problems · 5 Easy, 12 Medium, 11 Hard · Ranked #72 of 458
Difficulty breakdown
5 Easy
18% · avg 23%
12 Medium
43% · avg 59%
11 Hard
39% · avg 18%
Top topics
array
53.6%
string
35.7%
dynamic-programming
35.7%1.8x
greedy
25%3x
math
21.4%1.7x
binary-search
17.9%2x
Interview profile
Based on 28 reported problems, MathWorks interviews are significantly harder than average - 39% Hard vs 18% across all companies.
Compared to the industry average, MathWorks puts unusual emphasis on bitmask (7.1% of problems, 13.2x the industry average), greedy (25% of problems, 3x the industry average), simulation (10.7% of problems, 2.5x the industry average). If you're short on time, these are the categories to double down on.
The most common topics are array (53.6%), string (35.7%), dynamic-programming (35.7%), greedy (25%). Problems below are sorted by frequency, the ones at the top are asked most often.
All 28 problems
Problem
Difficulty
Frequency
Topics
Count Subarrays With Fixed Bounds
You are given an integer array nums and two integers minK and maxK.
You are the owner of a company that creates alloys using various types of metals. There are n different types of metals available, and you have access to k mach...
In MATLAB, there is a handy function called reshape which can reshape an m x n matrix into a new one with a different size r x c keeping its original data.
Given an array of strings words, return the words that can be typed using letters of the alphabet on only one row of American keyboard like the image below.
In LeetCode Store, there are n items to sell. Each item has a price. However, there are some special offers, and a special offer consists of one or more differe...
You are given the root of a binary tree. We install cameras on the tree nodes where each camera at a node can monitor its parent, itself, and its immediate chil...
Remove Colored Pieces if Both Neighbors are the Same Color
There are n pieces arranged in a line, and each piece is colored either by 'A' or by 'B'. You are given a string colors of length n where colors[i] is the color...
There are n people standing in a line labeled from 1 to n. The first person in the line is holding a pillow initially. Every second, the person holding the pill...
Given head which is a reference node to a singly-linked list. The value of each node in the linked list is either 0 or 1. The linked list holds the binary repre...
You are given a string s and an integer k. You can choose any character of the string and change it to any other uppercase English character. You can perform th...
Given a 0-indexed integer array nums of size n, find the maximum difference between nums[i] and nums[j] (i.e., nums[j] - nums[i]), such that 0 <= i < j < n and...
Suppose you have n integers labeled 1 through n. A permutation of those n integers perm (1-indexed) is considered a beautiful arrangement if for every i (1 <= i...
Given a palindromic string of lowercase English letters palindrome, replace exactly one character with any lowercase English letter so that the resulting string...
You are the owner of a company that creates alloys using various types of metals. There are n different types of metals available, and you have access to k mach...
In MATLAB, there is a handy function called reshape which can reshape an m x n matrix into a new one with a different size r x c keeping its original data.
Given an array of strings words, return the words that can be typed using letters of the alphabet on only one row of American keyboard like the image below.
In LeetCode Store, there are n items to sell. Each item has a price. However, there are some special offers, and a special offer consists of one or more differe...
You are given the root of a binary tree. We install cameras on the tree nodes where each camera at a node can monitor its parent, itself, and its immediate chil...
There are n pieces arranged in a line, and each piece is colored either by 'A' or by 'B'. You are given a string colors of length n where colors[i] is the color...
There are n people standing in a line labeled from 1 to n. The first person in the line is holding a pillow initially. Every second, the person holding the pill...
Given head which is a reference node to a singly-linked list. The value of each node in the linked list is either 0 or 1. The linked list holds the binary repre...
You are given a string s and an integer k. You can choose any character of the string and change it to any other uppercase English character. You can perform th...
Given a 0-indexed integer array nums of size n, find the maximum difference between nums[i] and nums[j] (i.e., nums[j] - nums[i]), such that 0 <= i < j < n and...
Suppose you have n integers labeled 1 through n. A permutation of those n integers perm (1-indexed) is considered a beautiful arrangement if for every i (1 <= i...
Given a palindromic string of lowercase English letters palindrome, replace exactly one character with any lowercase English letter so that the resulting string...
Given the head of a linked list, reverse the nodes of the list k at a time, and return the modified list.
HardLikely
linked-listrecursion
How often are these problems asked?
Frequency scores are based on crowdsourced interview reports. A higher score means the problem has been reported more often in recent MathWorks interviews.
Very Likely
75-100%
Likely
50-74%
Sometimes
25-49%
Rare
0-24%
Preparing for your MathWorks coding interview
MathWorks interviews focus heavily on array, string, dynamic-programming problems. If you're short on time, these are the categories to prioritize. The problems on this page are sorted by frequency, so start from the top and work your way down.
Beyond solving problems, practice explaining your approach. MathWorks interviewers care about your thought process - how you break down a problem, consider edge cases, and evaluate tradeoffs between solutions. A clean O(n) solution you can explain clearly beats an O(log n) solution you can't articulate.
What coding problems does MathWorks ask in interviews?add
MathWorks has been reported to ask 28 distinct coding problems. The most common topics are array, string, dynamic-programming. 5 are Easy difficulty, 12 are Medium, and 11 are Hard. Problems are sorted by frequency - the ones at the top are asked most often.
How hard are MathWorks coding interviews?add
Based on 28 reported problems, MathWorks interviews are significantly harder than average - 39% Hard vs 18% across all companies. 43% of questions are Medium difficulty. Focus on the high-frequency Medium problems first, then work through the Hard ones.
How should I prepare for a MathWorks coding interview?add
Start with the highest-frequency problems listed on this page. Focus on the core topics: array, string, dynamic-programming. Practice solving them under time pressure and explaining your approach out loud. Mock interviews with AI can simulate the real experience.
Simulate a real MathWorks coding interview with an AI interviewer. Get a scorecard with specific feedback on your problem-solving, code quality, and communication.