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

SDE - 1

Tata1mg
upvote
share-icon
3 rounds | 5 Coding problems

Interview preparation journey

expand-icon
Preparation
Duration: 3 months
Topics: OOPS , DBMS, Java , DSA, Dynamic Programming.
Tip
Tip

Tip 1 : Focus on resume
Tip 2 : Be confident
 

Application process
Where: Campus
Eligibility: 7 cgpa +no backlog
Resume Tip
Resume tip

Tip 1 : Be concise and crisp
Tip 2 : Only 1-2 page long

Interview rounds

01
Round
Medium
Online Coding Interview
Duration90 minutes
Interview date2 Dec 2021
Coding problem2

1. Box Stacking

Hard
25m average time
65% success
0/120
Asked in companies
DirectiMorgan StanleyJio Platforms Limited

You are given a set of ‘n’ types of rectangular 3-D boxes. The height, width, and length of each type of box are given by arrays, ‘height’, ‘width’, and ‘length’ respectively, each consisting of ‘n’ positive integers. The height, width, length of the i^th type box is given by ‘height[i]’, ‘width[i]’ and ‘length[i]’ respectively.

You need to create a stack of boxes that is as tall as possible using the given set of boxes.

Below are a few allowances:

You can only stack a box on top of another box if the dimensions of the 2-D base of the lower box ( both length and width ) are strictly larger than those of the 2-D base of the higher box. 

You can rotate a box so that any side functions as its base. It is also allowed to use multiple instances of the same type of box. This means, a single type of box when rotated, will generate multiple boxes with different dimensions, which may also be included in stack building.

Return the height of the highest possible stack so formed.

alt text

Note:
The height, Width, Length of the type of box will interchange after rotation.

No two boxes will have all three dimensions the same.

Don’t print anything, just return the height of the highest possible stack that can be formed.
Problem approach

) Generate all 3 rotations of all boxes. The size of rotation array becomes 3 times the size of the original array. For simplicity, we consider width as always smaller than or equal to depth. 
2) Sort the above generated 3n boxes in decreasing order of base area.
3) After sorting the boxes, the problem is same as LIS with following optimal substructure property. 
MSH(i) = Maximum possible Stack Height with box i at top of stack 
MSH(i) = { Max ( MSH(j) ) + height(i) } where j < i and width(j) > width(i) and depth(j) > depth(i). 
If there is no such j then MSH(i) = height(i)
4) To get overall maximum height, we return max(MSH(i)) where 0 < i < n

Try solving now

2. Count number of ways to cover a distance

Easy
15m average time
85% success
0/40
Asked in companies
OlaCIS - Cyber InfrastructureNagarro Software

Divyansh is in Dhanbad and wants to travel to different places. He can take one, two or three steps at max while travelling. He knows the distance and wants to find the number of ways to reach his destination. He is weak at calculations and wants your help in this. Given the distance from Dhanbad to his destination, count the total number of ways to cover the distance with 1, 2 and 3 steps.

Problem approach

For the recursive approach we will consider two cases. 

Consider the last element and now the required sum = target sum – value of ‘last’ element and number of elements = total elements – 1

Leave the ‘last’ element and now the required sum = target sum and number of elements = total elements – 1

Try solving now
02
Round
Medium
Video Call
Duration45 minutes
Interview date6 Dec 2021
Coding problem2

Was based on projects and dsa problems only

1. Subset Sum

Easy
0/40
Asked in companies
SAP LabsOlaAmazon

You are given an array 'nums' of ‘n’ integers.


Return all subset sums of 'nums' in a non-decreasing order.


Note:
Here subset sum means sum of all elements of a subset of 'nums'. A subset of 'nums' is an array formed by removing some (possibly zero or all) elements of 'nums'.


For example
Input: 'nums' = [1,2]

Output: 0 1 2 3

Explanation:
Following are the subset sums:
0 (by considering empty subset)
1 
2
1+2 = 3
So, subset sum are [0,1,2,3].
Problem approach

For the recursive approach we will consider two cases. 

Consider the last element and now the required sum = target sum – value of ‘last’ element and number of elements = total elements – 1

Leave the ‘last’ element and now the required sum = target sum and number of elements = total elements – 1

Try solving now

2. Minimum Jumps

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

Bob lives with his wife in a city named Berland. Bob is a good husband, so he goes out with his wife every Friday to ‘Arcade’ mall.

‘Arcade’ is a very famous mall in Berland. It has a very unique transportation method between shops. Since the shops in the mall are laying in a straight line, you can jump on a very advanced trampoline from the shop i, and land in any shop between (i) to (i + Arr[i]), where Arr[i] is a constant given for each shop.

There are N shops in the mall, numbered from 0 to N-1. Bob's wife starts her shopping journey from shop 0 and ends it in shop N-1. As the mall is very crowded on Fridays, unfortunately, Bob gets lost from his wife. So he wants to know, what is the minimum number of trampoline jumps from shop 0 he has to make in order to reach shop N-1 and see his wife again. If it is impossible to reach the last shop, return -1.

Try solving now
03
Round
Medium
Face to Face
Duration55 minutes
Interview date8 Dec 2021
Coding problem1

1. Dice Throws

Hard
35m average time
65% success
0/120
Asked in companies
MicrosoftDisney + HotstarShareChat

You are given D dice, each having F faces numbered 1 to F, both inclusive. The task is to find the possible number of ways to roll the dice together such that the sum of face-up numbers equal the given target S.

Note :
As the answer can be large, return your answer modulo 10^9  + 7.
Follow Up :
Can you solve this using not more than O(S) extra space?
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
SDE - 1
4 rounds | 8 problems
Interviewed by Tata1mg
1267 views
1 comments
0 upvotes
SDE - 1
4 rounds | 5 problems
Interviewed by Tata1mg
4932 views
0 comments
0 upvotes
SDE - 1
1 rounds | 3 problems
Interviewed by Tata1mg
1636 views
1 comments
0 upvotes
SDE - 1
4 rounds | 12 problems
Interviewed by Tata1mg
0 views
0 comments
0 upvotes
Companies with similar interview experiences
company logo
SDE - 1
5 rounds | 12 problems
Interviewed by Amazon
114579 views
24 comments
0 upvotes
company logo
SDE - 1
4 rounds | 5 problems
Interviewed by Microsoft
57824 views
5 comments
0 upvotes
company logo
SDE - 1
3 rounds | 7 problems
Interviewed by Amazon
34961 views
7 comments
0 upvotes