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

SDE - Intern

Mathworks
upvote
share-icon
5 rounds | 7 Coding problems

Interview preparation journey

expand-icon
Journey
Hello everyone! I am thrilled to share my personal journey with you all today. It has been a remarkable and transformative experience that I hope will inspire and motivate you on your own path to success. Like many of you, I started my journey with a burning desire to excel in my career and secure a job that would align with my aspirations. However, I soon realized that achieving this goal required a solid foundation of knowledge and skills. That's when I turned to trusted resources like Striver and Love Babbar, whose videos became my guiding light throughout my preparation. I began my journey by immersing myself in the basics. I dedicated countless hours to understanding the fundamental concepts, building a strong conceptual understanding of the subjects, and mastering the core principles. It wasn't always easy, and there were moments of frustration and self-doubt, but I persisted, knowing that the path to success was paved with persistence and hard work. One of the key lessons I learned during this phase was the importance of a growth mindset. I embraced the idea that failures and setbacks were not roadblocks but stepping stones on the path to success. Each challenge I encountered became an opportunity to learn, grow, and refine my skills. This mindset shift allowed me to overcome obstacles with resilience and determination. As I delved deeper into my studies, I also realized the value of practical application. It wasn't enough to merely understand the theory; I needed to put my knowledge into practice. I actively sought out opportunities to apply what I had learned through coding projects, participating in coding competitions, and collaborating with like-minded individuals in coding communities. These experiences not only sharpened my technical skills but also honed my ability to work in teams and solve real-world problems.
Application story
I applied in this company when it came on our campus. They provided us with a company application link on which we have to apply for the same.
Why selected/rejected for the role?
Selected: I was selected because my strong hold on OOPS, DBMS and DSA Basics and my prior internship experience.
Preparation
Duration: 6 months
Topics: Data Structures, Algorithms, Object-Oriented Programming (OOP), System Design, Operating Systems, Database Management Systems (DBMS), Dynamic Programming
Tip
Tip

Tip 1 : Do Atleast 150 DSA Questions, I used to do striver's DSA Sheet.
Tip 2 : Do Atleast 2 Decent Projects
Tip 3 : Try to go as deep as possible in CS core subjects.

Application process
Where: Campus
Eligibility: Above 6.5 CGPA
Resume Tip
Resume tip

Tip 1 : Try put any prior internship experience if you have one, because they gave a lot weightage to that, I did summer internship in amazon which became my edge against all other candidates.
Tip 2 : Do Atleast 2 Decent Projects

Interview rounds

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

Out of 600 Candidates only 40 were shortlisted after this round.

1. Minimum steps to reach target by a Knight

Moderate
25m average time
60% success
0/80
Asked in companies
MicrosoftIntuitGroww

You have been given a square chessboard of size ‘N x N’. The position coordinates of the Knight and the position coordinates of the target are also given.

Your task is to find out the minimum steps a Knight will take to reach the target position.

alt text

Example:
knightPosition: {3,4}
targetPosition: {2,1}

alt text

The knight can move from position (3,4) to positions (1,3), (2,2) and (4,2). Position (4,2) is selected and the ‘stepCount’ becomes 1. From position (4,2), the knight can directly jump to the position (2,1) which is the target point and ‘stepCount’ becomes 2 which is the final answer. 

Note:

1. The coordinates are 1 indexed. So, the bottom left square is (1,1) and the top right square is (N, N).

2. The knight can make 8 possible moves as given in figure 1.

3. A Knight moves 2 squares in one direction and 1 square in the perpendicular direction (or vice-versa).
Problem approach

This problem can be seen as the shortest path in an unweighted graph. Therefore we use BFS to solve this problem. 

We try all 8 possible positions where a Knight can reach from its position. If the reachable position is not already visited and is inside the board, we push this state into the queue with a distance 1 more than its parent state. Finally, we return the distance of the target position, when it gets pop out from the queue

Try solving now

2. Fixed Point

Easy
15m average time
85% success
0/40
Asked in companies
AmazonUberMathworks

You are given an array 'ARR' of ‘N’ distinct integers sorted in ascending order. You need to find the smallest fixed point in the array, such that the value stored at a particular index is equal to the index. That means 'ARR[i]' == 'i', where 'ARR[i]' denotes element at the the 'i'th index.

Note:
 1.Note that the array contains negative integers as well. 

2. Also, note that every array contains a single fixed point.
Example :
Given Array = [-1, 1, 3, 5]
In the above example 'ARR[1]' == 1, so you need to return 1.
Problem approach

Step 1: Thought of linear search but time complexity was more than expected.
Step 2: Tried binary search, First check whether middle element is Fixed Point or not. If it is, then return it; otherwise if the index of middle + 1 element is less than or equal to the value at the high index, then Fixed Point(s) might lie on the right side of the middle point (obviously only if there is a Fixed Point). Similarly, check if the index of middle – 1 element is greater than or equal to the value at the low index, then Fixed Point(s) might lie on the left side of the middle point.

Try solving now
02
Round
Medium
Group Discussion
Duration20 minutes
Interview date20 Aug 2022
Coding problem1

Timing : 10 AM
Topic : Pros and Cons about MathWorks EDG Program

40 People were shortlisted for this round and only 20 made it through to the next round.

1. Group Discussion

Pros and Cons about MathWorks EDG Program

03
Round
Medium
Video Call
Duration75 minutes
Interview date20 Aug 2022
Coding problem2

A female interviewer took my online technical round.

The round was focused around DSA, C++ and OOPS. She asked me 2 DSA Questions and Some questions on OOPS and C++. She focused a lot on pointers.

After this round 7 were shortlisted for next round out of 20.

1. All Possible Balanced Parentheses

Easy
10m average time
90% success
0/40
Asked in companies
SamsungGrabMathworks

You are given a positive integer 'N'. You have to generate all possible sequences of balanced parentheses using 'N' pairs of parentheses.

A sequence of brackets is called balanced if one can turn it into a valid math expression by adding characters ‘+’ and ‘1’. For example, sequences ‘(())()’, ‘()’ and ‘(()(()))’ are balanced, while ‘)(‘, ‘(()’ and ‘(()))(‘ are not.

For example :
For N = 1, there is only one sequence of balanced parentheses,  ‘()’.

For N = 2, all sequences of balanced parentheses are ‘()()’, ‘(())’.
Problem approach

Step 1: Create a recursive function that accepts a string (s), count of opening brackets (o) and count of closing brackets (c) and the value of n.
Step 2: if the value of opening bracket and closing bracket is equal to n then print the string and return.
Step 3: If the count of opening bracket is greater than count of closing bracket then call the function recursively with the following parameters String s + “}”, count of opening bracket o, count of closing bracket c + 1, and n.
Step 4: If the count of opening bracket is less than n then call the function recursively with the following parameters String s + “{“, count of opening bracket o + 1, count of closing bracket c, and n.

Try solving now

2. K Largest Element

Moderate
10m average time
90% success
0/80
Asked in companies
AmazonWalmartPayPal

You are given an unsorted array containing ‘N’ integers. You need to find ‘K’ largest elements from the given array. Also, you need to return the elements in non-decreasing order.

Problem approach

Using Max-Heap:
Follow the below steps to solve the problem:

Build a Max Heap
Use Extract Max K times to get K maximum elements from the Max Heap
Time complexity: O(N + K * log(N))

She asked if we put 2 same elements in a max heap, then how would you pop them out, because both have the same priority now, I told her I will also keep track of the count for the same element, the one with the lower count (which was put first) will be popped first!

Try solving now
04
Round
Medium
HR Round
Duration60 minutes
Interview date20 Aug 2022
Coding problem1

This was a Managerial round.

Out of 8 People, 2 were selected for the further rounds.

1. Basic HR Questions

How do you do time management?
Have you ever shown your integrity(refuse to do a task as it was unethical according to you)?

How can you work under pressure?

How do you prioritize your work?
How do you handle multiple deadlines?

How do you convince people?
How do you work/lead in a team?
How do you learn(books, videos, blogs)?

Location and domain preferences( and why).

05
Round
Easy
HR Round
Duration60 minutes
Interview date20 Aug 2022
Coding problem1

This was a HR round.

After all the 5 rounds, Out of 600 Candidates that applied for this company's placement drive, Only 1 was selected. That was ME!

1. Basic HR Questions

• Introduction
• Why Mathworks?
• Location preference.
• Family background.
• What do you know about us?
• About job role.

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
4 rounds | 3 problems
Interviewed by Mathworks
1192 views
0 comments
0 upvotes
company logo
SDE - Intern
3 rounds | 2 problems
Interviewed by Mathworks
3619 views
0 comments
0 upvotes
company logo
SDE - Intern
3 rounds | 3 problems
Interviewed by Mathworks
1436 views
0 comments
0 upvotes
company logo
SDE - 1
4 rounds | 16 problems
Interviewed by Mathworks
506 views
0 comments
0 upvotes
Companies with similar interview experiences
company logo
SDE - Intern
3 rounds | 6 problems
Interviewed by Amazon
15480 views
4 comments
0 upvotes
company logo
SDE - Intern
4 rounds | 7 problems
Interviewed by Microsoft
15338 views
1 comments
0 upvotes
company logo
SDE - Intern
2 rounds | 4 problems
Interviewed by Amazon
10142 views
2 comments
0 upvotes