i
MathWorks
Filter interviews by
Clear (1)
2 easy DSA questions
I have a strong interest in Matlab due to its powerful data analysis and visualization capabilities.
I have experience using Matlab for data analysis and visualization in my academic projects.
I find Matlab's syntax to be intuitive and easy to learn.
I appreciate Matlab's extensive library of functions for various mathematical and engineering tasks.
I was interviewed in May 2022.
Round duration - 90 mins
Round difficulty - Medium
- timing was 5:00 AM in the morning
- 2 coding questions and 10 MCQ
- MCQ tested variety of concepts like Database management, OOPS, pointers and C
You are a cab driver with a car that initially has 'C' empty seats. The car moves in a straight line towards the forward direction only. Your job is to determine if it is poss...
Determine if it is possible to handle all passenger trips within the car capacity without exceeding it at any point.
Iterate through each trip and keep track of the total number of passengers in the car at each point.
Check if the total number of passengers exceeds the car capacity at any point, return 'False'. Otherwise, return 'True'.
Given a binary matrix MAT
containing only 0s and 1s of size N x M, find the distance of the nearest cell containing 1 for each cell in the matrix.
The dis...
Given a binary matrix, find the distance of the nearest cell containing 1 for each cell in the matrix.
Iterate through the matrix and for each cell, find the nearest cell containing 1 using BFS or DFS.
Calculate the distance using the formula |i1 – i2| + |j1 – j2|.
Update the matrix with the distances to the nearest cell with 1.
Handle edge cases like cells already containing 1 or cells with no 1s nearby.
Ensure movements a...
Round duration - 30 mins
Round difficulty - Easy
Round was technical + HR round
Tip 1 : Do love babbar's 450 questions sheet
Tip 2 : Have atleast 2 projects and have thorough knowledge of them
Tip 3 : Dont mention anything on your resume that you are not confident about
Tip 1 : Have atleast 2 projects, of which you have thorough knowledge
Tip 2 : Be confident of anything you mention in your resume,
Tip 3 : Its good to have github link of the projects on your resume
I was interviewed in Aug 2021.
Round duration - 60 minutes
Round difficulty - Medium
Timing: The test was conducted at around 6pm.
You and your friend Ninjax are engaged in a strategic game involving coins. Ninjax arranges 'N' coins in a linear sequence.
1. Each...
Determine the maximum amount you can win in a coin game by selecting coins strategically.
Start by understanding the rules of the game and the goal of maximizing winnings.
Consider the fact that you can choose either the first or last coin in each turn.
Think about how to ensure you make the best choice at each turn to guarantee the maximum win.
Examples: For the input 4 9 5 21 7, selecting coins in the order of 9 and 21 r
Given a Binary Search Tree (BST) of integers, your task is to convert it into a greater sum tree. In the greater sum tree, each node's value should be replaced with the sum...
Convert a Binary Search Tree into a Greater Sum Tree by replacing each node's value with the sum of all nodes' values greater than the current node's value.
Traverse the BST in reverse inorder (right-root-left) to visit nodes in descending order.
Keep track of the running sum of visited nodes and update each node's value with this sum.
Recursively apply the above steps to all nodes in the BST.
Example: For the input BST [4...
Tip 1 : Revision of important topics and questions is key
Tip 2 : You should have thorough knowledge of the tech stack you have used in your projects
Tip 1 : Highlight the important points in your CV. Could be some algorithm you implemented in your project or key frameworks you used.
Tip 2 : Try to have a single page resume with concise information highlighting your key achievements.
Tip 3 : Don't write anything you can't answer questions on.
I was interviewed in Jul 2021.
Round duration - 60 Minutes
Round difficulty - Easy
It was somewhere in the middle of the day and was around 60 mins long .
It consisted of three sections
one is aptitude
then other was related to comm skills related
and the last one was 2 coding question ( each have to be done in different programming language ).
Ninja is looking to hire 'ugly ninjas' whose numbers have all prime factors from a given list. Your task is to help him find the K-th ugly ninja.
You will be given an ar...
Find the K-th ugly ninja number using prime factors from a given list.
Generate ugly numbers using prime factors from PRIME_ARR
Keep track of the K-th ugly number
Return the K-th ugly number
You are given an array ARR
and a positive integer K
. Your task is to count the total number of pairs within the array whose sum is divisible by K
.
ARR = [4, 3...
Count pairs in an array whose sum is divisible by a given integer K.
Iterate through the array and calculate the remainder of each element when divided by K.
Store the remainders in a hashmap along with their frequencies.
For each remainder R, check if K - R is present in the hashmap and add the product of their frequencies to the count.
Return the total count of pairs whose sum is divisible by K.
Round duration - 30 Minutes
Round difficulty - Easy
It was a round with HR and these questions were asked
Tip 1 : Be consistent like never ever leave even a single day practice even if you have other commitments
Tip 2 : Follow one resource properly as there are tons of resources available but try to pick one only and start other only if you are finished with the first resource
Tip 3 : There is no set defined number for the number of question you have to do , just focus on the quality of questions . Eg : 1 good hard level problem >>>> 25 easy problems like sum of array etc.
Tip 1 : Try not to stuff your resume with fancy things like multiple small small projects
Tip 2 : Try to provide links for the project you are giving as it provides credibility of your work which you have shown.
MathWorks interview questions for designations
Top trending discussions
I was interviewed in Jul 2017.
Code to print * in five consecutive lines
Use a loop to iterate five times
Inside the loop, print a string containing a single * character
Code to calculate number of bounces a ball goes through until it comes to rest.
Use a loop to simulate the bounces until the ball stops bouncing
Calculate the height of each bounce using the given formula
Keep track of the number of bounces in a counter variable
The best and less time consuming way to calculate factorial of a number is using iterative approach.
Iteratively multiply the number with all the numbers from 1 to the given number
Start with a result variable initialized to 1
Multiply the result with each number in the range
Return the final result
Code to find factorial using function recursion
Define a function that takes an integer as input
Check if the input is 0 or 1, return 1 in that case
Otherwise, call the function recursively with input-1 and multiply it with the input
posted on 14 Jul 2017
posted on 12 Jul 2016
I applied via Campus Placement
The question is about finding the minimum steps to reach from a source string to a destination string using three operations.
BFS and DFS are graph traversal techniques that can be used to solve this problem.
BFS is typically used when finding the shortest path or exploring all possible paths in a graph.
DFS is useful when searching for a specific path or exploring deeply into a graph.
In this case, BFS can be used to find...
posted on 10 May 2015
Locate sum of 2 numbers in a linear array (unsorted and sorted) and their complexities
For unsorted array, use nested loops to compare each element with every other element until the sum is found
For sorted array, use two pointers approach starting from the beginning and end of the array and move them towards each other until the sum is found
Complexity for unsorted array is O(n^2) and for sorted array is O(n)
Pointers are used to manipulate memory addresses and values in C++. Increment/decrement, address of and value at operators are commonly used.
Incrementing a pointer moves it to the next memory location of the same data type
Decrementing a pointer moves it to the previous memory location of the same data type
The address of operator (&) returns the memory address of a variable
The value at operator (*) returns the value sto
To determine if a point is inside or outside a rectangle, we check if the point's coordinates fall within the rectangle's boundaries.
Check if the point's x-coordinate is greater than the left edge of the rectangle
Check if the point's x-coordinate is less than the right edge of the rectangle
Check if the point's y-coordinate is greater than the top edge of the rectangle
Check if the point's y-coordinate is less than the b...
To find line that divides rectangle into 2 equal halves through a point inside it.
Find the center of the rectangle
Draw a line from the center to the given point
Extend the line to the opposite side of the rectangle
The extended line will divide the rectangle into 2 equal halves
There are multiple combinations of 8-bit and 16-bit signed numbers. How many such combinations are possible?
There are 2^8 (256) possible combinations of 8-bit signed numbers.
There are 2^16 (65,536) possible combinations of 16-bit signed numbers.
To find the total number of combinations, we can add the number of combinations of 8-bit and 16-bit signed numbers.
Therefore, the total number of possible combinations is 256 +
Find duplicates in an array of elements in 0(n) time and 0(1) space.
Use the property of inputs to your advantage
Iterate through the array and mark elements as negative
If an element is already negative, it is a duplicate
Return all the negative elements as duplicates
posted on 7 May 2017
I was interviewed in Feb 2017.
malloc is a function in C that dynamically allocates memory on the heap. It is used to allocate memory for variables or data structures.
malloc is used in C programming language.
It is used to allocate memory on the heap.
malloc is different from 'new' in C++ as it does not call constructors for objects.
C++ is a general-purpose programming language while Objective C is a superset of C used for iOS and macOS development.
C++ is widely used for developing applications, games, and system software.
Objective C is mainly used for iOS and macOS development.
C++ supports both procedural and object-oriented programming paradigms.
Objective C is an object-oriented language with dynamic runtime features.
C++ has a larger community a...
Class container is a class that holds objects of other classes, while class composition is a way to combine multiple classes to create a new class.
Class container holds objects of other classes, acting as a collection or container.
Class composition combines multiple classes to create a new class with its own behavior and attributes.
In class container, the objects are typically stored in a data structure like an array o...
Divide the horses into groups of 5 and race them. Take the top 2 from each race and race them again. Finally, race the top 2 horses to determine the top 3.
Divide the horses into 3 groups of 5 and race them.
Take the top 2 horses from each race and race them again.
Finally, race the top 2 horses to determine the top 3.
Developing a real-time data processing system for a high-traffic e-commerce website
Implemented a distributed system architecture to handle large volumes of data
Optimized algorithms for efficient data processing and storage
Utilized caching mechanisms to improve system performance
Worked closely with cross-functional teams to troubleshoot and resolve issues
Example: Successfully reduced data processing time by 50% by imple
Seeking new challenges and opportunities for growth.
Looking for a more challenging role to further develop my skills
Interested in exploring new technologies and industries
Seeking better career advancement opportunities
Want to work in a more collaborative team environment
The width of a tree is the maximum number of nodes at any level in the tree.
To calculate the width of a tree, we can perform a level order traversal and keep track of the maximum number of nodes at any level.
We can use a queue data structure to perform the level order traversal.
At each level, we count the number of nodes in the queue and update the maximum width if necessary.
posted on 6 Apr 2022
I was interviewed before Apr 2021.
Round duration - 75 minutes
Round difficulty - Medium
This was an online coding round where I had 2 questions to solve under 75 minutes. Both the coding questions were of Medium to Hard level of difficulty.
Given two strings, S
and X
, your task is to find the smallest substring in S
that contains all the characters present in X
.
S = "abdd"
X = "bd"
Find the smallest substring in S that contains all characters in X.
Use a sliding window approach to find the smallest substring in S that contains all characters in X.
Keep track of the characters in X using a hashmap.
Move the window by adjusting the start and end pointers until all characters in X are found.
Return the smallest substring encountered.
Given a binary tree where each node contains an integer value, and a value 'K', your task is to find all the paths in the binary tree such that the sum of the node values in ...
Find all paths in a binary tree where the sum of node values equals a given value 'K'.
Traverse the binary tree using DFS and keep track of the current path and its sum.
At each node, check if the current sum equals 'K' and add the path to the result.
Continue traversal to the left and right child nodes recursively.
Return the list of paths that sum up to 'K'.
Round duration - 60 Minutes
Round difficulty - Medium
This round had 2 questions of DS/Algo to solve under 60 minutes and 2 questions related to Operating Systems.
You are provided with a binary tree containing 'N' nodes. Your task is to determine if this tree is a Partial Binary Search Tree (BST). Return t...
Validate if a binary tree is a Partial Binary Search Tree (BST) by checking if each node's left subtree contains nodes with data less than or equal to the node's data, and each node's right subtree contains nodes with data greater than or equal to the node's data.
Check if each node's left subtree follows BST property (data <= node's data) and right subtree follows BST property (data >= node's data)
Recursively che...
Given an array of integers with 'N' elements, determine the length of the longest subsequence where each element is greater than the previous element. This...
Find the length of the longest strictly increasing subsequence in an array of integers.
Use dynamic programming to solve this problem efficiently.
Initialize an array to store the length of the longest increasing subsequence ending at each index.
Iterate through the array and update the length of the longest increasing subsequence for each element.
Return the maximum value in the array as the result.
Processes are instances of a program in execution, while threads are lightweight processes within a process.
A process is a program in execution, with its own memory space and resources.
Threads are lightweight processes within a process, sharing the same memory space and resources.
Processes are independent of each other, while threads within the same process can communicate and share data.
Example: A web browser running ...
Different types of semaphores include binary semaphores, counting semaphores, and mutex semaphores.
Binary semaphores: Can only have two states - 0 or 1. Used for mutual exclusion.
Counting semaphores: Can have multiple states. Used for managing resources with limited capacity.
Mutex semaphores: Similar to binary semaphores but with additional features like priority inheritance.
Named semaphores: Can be shared between proc...
Round duration - 60 Minutes
Round difficulty - Hard
In this round, I was asked 3 coding questions out of which I had to implement the first two and for the last question I was only asked the optimal approach. The main challenge in this round was to implement the first two questions in a production ready manner without any bugs and so I had to spent some time thinking about some Edge Cases which were important with respect to the question.
You are given an array arr
of length N
. For each element in the array, find the next greater element (NGE) that appears to the right. If there is no such greater ele...
The task is to find the next greater element for each element in an array to its right, if no greater element exists, return -1.
Use a stack to keep track of elements for which the next greater element is not found yet.
Iterate through the array from right to left and pop elements from the stack until a greater element is found.
Store the next greater element for each element in a separate array.
If the stack is empty afte...
Given a sorted array of 'N' integers, your task is to generate the power set for this array. Each subset of this power set should be individually sorted.
A power set of a set 'ARR' i...
Generate power set of a sorted array of integers with individually sorted subsets.
Use recursion to generate all possible subsets by including or excluding each element in the array.
Sort each subset before adding it to the power set.
Handle base case when all elements have been considered to add the subset to the power set.
Ninja is learning about sorting algorithms, specifically those that do not rely on comparisons. Can you help Ninja implement the counting sort algorithm?
Implement counting sort algorithm to sort an array of integers without comparisons.
Count the frequency of each element in the input array.
Create a prefix sum array to determine the position of each element in the sorted array.
Iterate through the input array and place each element in its correct position based on the prefix sum array.
Time complexity of counting sort is O(n+k), where n is the number of elements and k is
Tip 1 : Must do Previously asked Interview as well as Online Test Questions.
Tip 2 : Go through all the previous interview experiences from Codestudio and Leetcode.
Tip 3 : Do at-least 2 good projects and you must know every bit of them.
Tip 1 : Have at-least 2 good projects explained in short with all important points covered.
Tip 2 : Every skill must be mentioned.
Tip 3 : Focus on skills, projects and experiences more.
based on 1 interview
2 Interview rounds
Software Engineer
142
salaries
| ₹0 L/yr - ₹0 L/yr |
Senior Software Engineer
68
salaries
| ₹0 L/yr - ₹0 L/yr |
Associate Software Engineer
47
salaries
| ₹0 L/yr - ₹0 L/yr |
Software Developer
30
salaries
| ₹0 L/yr - ₹0 L/yr |
Software Engineer2
27
salaries
| ₹0 L/yr - ₹0 L/yr |
Cadence Design Systems
Ansys Software Private Limited
National Instruments
Autodesk