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

SDE - 1

42gearMobilitySystems
upvote
share-icon
3 rounds | 13 Coding problems

Interview preparation journey

expand-icon
Journey
During my first year, I started learning programming, specifically C++. In my second year, I learned DSA, which took about a year to master. In my final year, I studied other subjects like OS, DBMS, and networking.
Application story
I filled out the form sent by the Placement Cell, and after a few days, I received an email for the MCQs and coding assessment on September 5, 2022. The technical interview was scheduled for September 7, 2022, and after that, I received an email for the managerial interview on September 12, 2022. All interviews were conducted on Google Meet.
Why selected/rejected for the role?
I was rejected for this role, even though I was well-prepared and confident enough to pass both the online exam and the managerial interview. I answered all the questions they asked during the interview confidently, but I still wasn't able to succeed in the managerial interview.
Preparation
Duration: 8 months
Topics: Data Structures, Algorithms, OOPS, Database Management System, Networking, Aptitude
Tip
Tip

Tip 1: Start learning Data Structures at least a year before your placements.

Tip 2: Focus on OOP concepts, such as inheritance.

Tip 3: Make sure you learn everything about your project.

Application process
Where: Campus
Eligibility: Above 7 CGPA, 70%+ in intermediate
Resume Tip
Resume tip

Tip 1: Mention only the things you are familiar with.

Tip 2: You must have at least two good projects.

Interview rounds

01
Round
Medium
Online Coding Interview
Duration120 minutes
Interview date5 Sep 2022
Coding problem7

This round was conducted in two phases: the morning session was for the MCQ round, and the second session was for the coding assessment. The round took place in university computer labs.

TIP: Please remember the code you wrote during the programming round, as the questions may be asked again.

1. Puzzle

Seats for Mathematics, Physics and Biology in a school are in the ratio 5: 7: 8. There is a proposal to increase these seats by 40%, 50% and 75% respectively. What will be the ratio of increased seats?
2 : 3 : 4
6 : 7 : 8
6 : 8 : 9
None of these

Problem approach

Originally, let the number of seats for Mathematics, Physics and Biology be 5x, 7x and 8x respectively.

Number of increased seats are (140% of 5x), (150% of 7x) and (175% of 8x).

140 x 5x , 150 x 7x and 175 x 8x 
100 100 100
7x, 21x and 14x.
2
The required ratio = 7x : 21x : 14x
2
14x : 21x : 28x

2 : 3 : 4.

2. Puzzle

A clock is started at noon. By 10 minutes past 5, the hour hand has turned through:
145°
150°
155°
160°

Problem approach

Angle traced by hour hand in 12 hrs = 360°.

Angle traced by hour hand in 5 hrs 10 min. i.e., 31 hrs = 360 x 31 ° = 155°.

3. Puzzle

What is the port number of PoP?
35
43
110
25

Problem approach

110

4. Puzzle

What is the primary purpose of pseudocode?

A. To document algorithms in natural language

B. To compile and execute algorithms

C. To debug code

D. To optimize algorithms

Problem approach

Tip 1: Pseudocode is used to document algorithms in a way that is readable to humans, representing how a program will work without worrying about syntax.
Tip 2: Answer: To document algorithms in natural language

5. Longest Increasing Subsequence

Moderate
0/80
Asked in companies
GrabAmazonSamsung

Given an array arr[] of size N, the task is to find the length of the Longest Increasing Subsequence (LIS) i.e., the longest possible subsequence in which the elements of the subsequence are sorted in increasing order. Input: arr[] = {3, 10, 2, 1, 20}Output: 3Explanation: The longest increasing subsequence is 3, 10, 20Input: arr[] = {50, 3, 10, 7, 40, 80}Output: 4Explanation: The longest increasing subsequence is {3, 7, 40, 80}

Problem approach

int lisEndAtI(vector& arr, int i)
{
if (i == 0)
return 1;

int mx = 1;
for (int prev = 0; prev < i; prev++)
if (arr[prev] < arr[i])
mx = max(mx, lisEndAtI(arr, prev) + 1);
return mx;
}

int lis(vector& arr)
{
int n = arr.size();
int res = 1;
for (int i = 1; i < n; i++)
res = max(res, lisEndAtI(arr, i));
return res;
}

// Driver program 
int main()
{
vector arr = { 10, 22, 9, 33, 21, 50, 41, 60 };
cout << "Length of lis is " << lis(arr);
return 0;
}

output: Length of lis is 5

Try solving now

6. Cycle Detection in a Singly Linked List

Moderate
15m average time
80% success
0/80
Asked in companies
GrabThalesSterlite Technologies Limited

Cycle Detection in a Singly Linked List. You have given a Singly Linked List of integers, to determine if it forms a cycle or not.

Problem approach

A cycle occurs when a node's next points back to a previous node in the list. The linked list is no longer linear with a beginning and end—instead, it cycles through a loop of nodes.

The idea is to insert the nodes in the hashmap and whenever a node is encountered that is already present in the hashmap then return true.

class Node {
public:
int data;
Node* next;
Node(int new_data) {
this->data = new_data;
this->next = nullptr;
}
};

bool detectLoop(Node* head) {
unordered_set h_map;

while (head != nullptr) {


if (h_map.find(head) != h_map.end())
return true;

h_map.insert(head);

head = head->next;
}
return false;
}

int main() {

Node* head = new Node(10);
head->next = new Node(20);
head->next->next = new Node(30);
head->next->next->next = new Node(40);
head->next->next->next->next = new Node(50);
head->next->next->next->next->next = new Node(60);

head->next->next->next->next = head;

if (detectLoop(head))
cout << "Loop Found";
else
cout << "No Loop";

return 0;
}

Try solving now

7. Valid Parentheses

Easy
10m average time
80% success
0/40
Asked in companies
OracleAmerican ExpressPayPal

Given a string s containing just the characters '(', ')', '{', '}', '[' and ']', determine if the input string is valid. An input string is valid if: Open brackets must be closed by the same type of brackets. Open brackets must be closed in the correct order. Every close bracket has a corresponding open bracket of the same type.

Problem approach

Example 1:

Input: s = "()"
Output: true
Example 2:

Input: s = "()[]{}"
Output: true
Example 3:

Input: s = "(]"
Output: false


public class Solution {
public static boolean isValid(String s) {
while (true) {
if (s.contains("()")) {
s = s.replace("()", "");
} else if (s.contains("{}")) {
s = s.replace("{}", "");
} else if (s.contains("[]")) {
s = s.replace("[]", "");
} else {
// If the string becomes empty, it indicates all brackets are matched.
return s.isEmpty();
}
}
}
}

Try solving now
02
Round
Medium
Video Call
Duration40 minutes
Interview date7 Sep 2022
Coding problem3

This round was conducted online through Google Meet while I was sitting in my room. They asked questions such as:

  1. Your introduction (based on your resume)
  2. Details about your projects
  3. Follow-up questions on any of the projects
  4. Simple coding to check the basics (e.g., factorial using loops and then recursion)
  5. Rewriting the code performed in the programming round, explaining the logic, and discussing some alternative approaches
  6. Questions about the STL library

1. Standard Template Library

Why do we need STL when we can perform all the operations using a user-defined data structure and functions? (Learn)

Problem approach

We prefer STL over user-defined data structure and functions because:
It saves time spent writing code for user-defined data structures.
It is tried, efficient, and debugged code tested over a long period.
STL is the part of C++ Language Standard so it is easy to understand for other programmers.
STL allows us to parameterize the code with the required data type.

2. Time Complexity

What is the time complexity of insertion and deletion in vector?

Problem approach

Insertion: If the size of the vector is N, then the time complexity of insertion of an element in the vector is:

At the end: O(1)
At M index: O(N – M)
Deletion: If the size of the vector is N, then the time complexity of deletion of an element in the vector is:

At the end: O(1) 
At M index: O(N-M)

3. Simple coding to check the basics (factorial using loop then Recursion)

Problem approach

// C program to Find the Factorial Using for Loop

unsigned int factorial(unsigned int N) {
int fact = 1, i;
for (i = 1; i <= N; i++) {
fact *= i;
}

return fact;
}

int main() {
int N = 5;
int fact = factorial(N);
printf("Factorial of %d is %d", N, fact);
return 0;
}




// using recursion

unsigned int factorial(unsigned int n) {

if (n == 1) {
return 1;
}

return n * factorial(n - 1);
}

int main() {
int num = 5;
printf("Factorial of %d is %d", num, factorial(num));
return 0;
}

03
Round
Medium
Video Call
Duration70 minutes
Interview date12 Sep 2022
Coding problem3

This last round was online conducted through Google Meet by the manager.
I was sitting in my room around 5 pm.

1. Find Peak Element

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

Find the Peak Element in a 2D Array/Matrix.

Examples
Input: [[10 20 15], [21 30 14], [7  16 32]]
Output: 1, 1

Input: [[10 7], [11 17]]
Output: 1, 1

Problem approach

An element is a peak element if it is greater than or equal to its four neighbors, left, right, top and bottom. 
A Diagonal adjacent is not considered a neighbour. 
A peak element is not necessarily the maximal element. 
More than one such element can exist. 
There is always a peak element. 
For corner elements, missing neighbors are considered of negative infinite value.



vector findPeakGrid(vector > arr)
{
vector result;
int row = arr.size();
int column = arr[0].size();

for (int i = 0; i < row; i++) {
for (int j = 0; j < column; j++) {

if (i > 0)
if (arr[i][j] < arr[i - 1][j])
continue;

if (j < column - 1)
if (arr[i][j] < arr[i][j + 1])
continue;

if (i < row - 1)
if (arr[i][j] < arr[i + 1][j])
continue;

if (j > 0)
if (arr[i][j] < arr[i][j - 1])
continue;

result.push_back(i);
result.push_back(j);
break;
}
}
return result;
}


int main()
{
vector > arr = { { 9, 8 }, { 2, 6 } };
vector result = findPeakGrid(arr);
cout << "Peak element found at index: " << result[0]
<< ", " << result[1] << endl;
return 0;
}

Try solving now
Moderate
30m average time
80% success
0/80
Asked in companies
Goldman SachseBay42gearMobilitySystems

Efficiently compute sums of diagonals of a matrix

Examples
Input : 
4
1 2 3 4
4 3 2 1
7 8 9 6
6 5 4 3
Output :
Principal Diagonal: 16
Secondary Diagonal: 20

Input :
3
1 1 1
1 1 1
1 1 1
Output :
Principal Diagonal: 3
Secondary Diagonal: 3

Problem approach

const int MAX = 100;

void printDiagonalSums(int mat[][MAX], int n)
{
int principal = 0, secondary = 0;
for (int i = 0; i < n; i++) {
for (int j = 0; j < n; j++) {


if (i == j)
principal += mat[i][j];

if ((i + j) == (n - 1))
secondary += mat[i][j];
}
}

cout << "Principal Diagonal:" << principal << endl;
cout << "Secondary Diagonal:" << secondary << endl;
}


int main()
{
int a[][MAX] = { { 1, 2, 3, 4 }, { 5, 6, 7, 8 }, 
{ 1, 2, 3, 4 }, { 5, 6, 7, 8 } };
printDiagonalSums(a, 4);
return 0;
}

Try solving now

3. Project Related

Tell me about your projects and whether they asked follow-up questions on any of them.

Problem approach

Also, prepare for the following questions
Tip 1:Tell us about an incident where something went wrong in your project while you were managing it.
Tip 2:How do you facilitate an environment of collaboration on your team?
Tip 3: How do you define an ideal project?

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
MTS 1
3 rounds | 7 problems
Interviewed by 42gearMobilitySystems
1116 views
0 comments
0 upvotes
company logo
SDE - 1
3 rounds | 7 problems
Interviewed by OYO
4657 views
0 comments
0 upvotes
company logo
SDE - 1
2 rounds | 5 problems
Interviewed by Meesho
6450 views
0 comments
0 upvotes
company logo
SDE - 1
3 rounds | 9 problems
Interviewed by Salesforce
3452 views
0 comments
0 upvotes
Companies with similar interview experiences
company logo
SDE - 1
2 rounds | 3 problems
Interviewed by BNY Mellon
6261 views
3 comments
0 upvotes
company logo
SDE - 1
3 rounds | 6 problems
Interviewed by BNY Mellon
0 views
0 comments
0 upvotes
company logo
SDE - 1
3 rounds | 5 problems
Interviewed by CIS - Cyber Infrastructure
2160 views
0 comments
0 upvotes