Mathworks interview experience Real time questions & tips from candidates to crack your interview

Associate in EDG

Mathworks
upvote
share-icon
3 rounds | 3 Coding problems

Interview preparation journey

expand-icon
Journey
My introduction to C++ during my first semester in college, thanks to my seniors, marked the beginning of a journey I hadn't anticipated. Initially, it was just another programming language to learn, but it laid the foundation for a much more significant endeavour—competitive programming. It wasn't until my fourth semester, however, that I truly embarked on my competitive programming journey. The allure of online contests and their challenges piqued my interest, and I dove headfirst into this new world. The learning curve was steep, and it took me about one and a half semesters to cover all the necessary topics. However, my dedication wasn't limited to competitive programming; I also devoted time to understanding my core subjects, ensuring a well-rounded skill set. As placement season approached, I felt a mix of anticipation and confidence. I had spent countless hours preparing, and it was time to put my skills to the test. MathWorks was the third company to visit our campus, and the opportunity to work with them was something I had hoped for. Their work in mathematical computing software resonated with my interests and aspirations. The selection process was intense, but my preparation paid off. When I received the offer from MathWorks, it was a moment of relief and exhilaration. It was a testament to the hard work, dedication, and countless hours of coding and problem-solving.
Application story
The application process was straightforward yet competitive. I submitted my resume, which I had meticulously prepared to highlight my projects, internships, and proficiency in CPP and other programming languages. Alongside this, I crafted a cover letter that narrated my journey in programming, my passion for innovation, and how I envisioned contributing to MathWorks. The application was not just a submission of documents but a reflection of my dedication and dreams.
Why selected/rejected for the role?
My selection was largely due to my ability to successfully answer all the data structures and algorithms (DSA) questions presented to me. Additionally, the managerial round went exceptionally well, characterized by a fruitful and engaging conversation, which further solidified my candidacy for the position.
Preparation
Duration: 11 months
Topics: Data Structures, Algorithms, OOPS, Operating Systems, DBMS
Tip
Tip

Tip 1: Don't look at the solution for DSA questions straight away. Spend some time, look at the approach, and data structures used in the solution, and then write your code. This will improve your problem-solving skills.
Tip 2: Object Oriented Programming is very important. Learn it in depth and keep revising
Tip 3: Try to solve a problem in a particular period. This will prepare you for coding rounds before the interview

Application process
Where: Campus
Eligibility: No backlog in any subjects
Resume Tip
Resume tip

Tip 1: Never lie on your resume
Tip 2: You should have good projects on your resume

Interview rounds

01
Round
Medium
Online Coding Interview
Duration90 minutes
Interview date25 Aug 2022
Coding problem2

The online coding round consisted of three data structures and algorithms questions alongside ten multiple-choice questions, all scheduled to commence at 11 a.m., challenging my knowledge and skills.

1. Find maximum difference between nearest left and right smaller elements

Moderate
20m average time
79% success
0/80
Asked in companies
MathworksFlipkart limited

Given an integer array arr of length n, the task is to find the maximum absolute difference between the nearest left smaller and nearest right smaller element of every element in array arr. If for any element in the arr, the nearest smaller element doesn't exist then consider it as 0.

Problem approach

Just implement using the concept of the next smaller element on the right and left of the array
and then iterate to the array and calculate the max abs diff

Try solving now

2. Maximum Subarray Sum

Moderate
25m average time
75% success
0/80
Asked in companies
SquadstackAmazonRazorpay

Given an integer array arr, find the contiguous subarray (containing at least one number) which has the largest sum and returns its sum.

Problem approach

The intuition of the algorithm is not to consider the subarray as a part of the answer if its sum is less than 0. A subarray with a sum less than 0 will always reduce our answer and so this type of subarray cannot be a part of the subarray with maximum sum.

Here, we will iterate the given array with a single loop and while iterating we will add the elements in a sum variable. Now, if at any point the sum becomes less than 0, we will set the sum as 0 as we are not going to consider any subarray with a negative sum. Among all the sums calculated, we will consider the maximum one.

Try solving now
02
Round
Easy
Group Discussion
Duration15 minutes
Interview date26 Aug 2022
Coding problem0

In our group, which comprised five students, we were assigned the topic of essential skills for advancement in corporate life for our group discussion. This discussion was further segmented into three distinct sub-rounds. During the initial round, each student was provided with an opportunity to express their viewpoints. In the subsequent round, participants were encouraged to present innovative ideas related to the topic. Finally, in the third sub-round, students were given the chance to engage in a debate with their peers on the subject, despite it being structured as a group discussion.

03
Round
Easy
Video Call
Duration60 minutes
Interview date26 Aug 2022
Coding problem1

It was a technical Interview along with some managerial questions. The time was 3 p.m..

1. Sort An Array of 0s, 1s and 2s

Easy
10m average time
90% success
0/40
Asked in companies
DelhiveryInfo Edge India (Naukri.com)IBM

Given an array consisting of only 0s, 1s, and 2s. Write a program to in-place sort the array without using inbuilt sort functions.

Problem approach

I first thought of counting the no. of 0s, 1s and 2s and then filling the array. This will take O(n) time complexity and constant space. However, the interviewer wanted me to solve this in a single pass that only iterate once. 

So I used a 3 pointer approach

If arr[mid] == 0, we will swap arr[low] and arr[mid] and will increment both low and mid. Now the subarray from index 0 to (low-1) only contains 0.
If arr[mid] == 1, we will just increment the mid pointer and then the index (mid-1) will point to 1 as it should according to the rules.
If arr[mid] == 2, we will swap arr[mid] and arr[high] and will decrement high. Now the subarray from index high+1 to (n-1) only contains 2.
In this step, we will do nothing to the mid-pointer as even after swapping, the subarray from mid to high(after decrementing high) might be unsorted. So, we will check the value of mid again in the next iteration.

Try solving now

Here's your problem of the day

Solving this problem will increase your chance to get selected in this company

Skill covered: Programming

What is recursion?

Choose another skill to practice
Similar interview experiences
company logo
SDE - Intern
3 rounds | 2 problems
Interviewed by Mathworks
3619 views
0 comments
0 upvotes
company logo
SDE - Intern
5 rounds | 7 problems
Interviewed by Mathworks
732 views
0 comments
0 upvotes
company logo
Software Engineer
5 rounds | 7 problems
Interviewed by Mathworks
865 views
1 comments
0 upvotes
company logo
SDE - 1
4 rounds | 16 problems
Interviewed by Mathworks
506 views
0 comments
0 upvotes