Tata Consultancy Services (TCS) interview experience Real time questions & tips from candidates to crack your interview

SDE

Tata Consultancy Services (TCS)
upvote
share-icon
2 rounds | 6 Coding problems

Interview preparation journey

expand-icon
Preparation
Duration: 2 months
Topics: Data Structures, Pointers, OOPS, Algorithms, Aptitude
Tip
Tip

Tip 1 : Practice RS Aggarwal book
Tip 2 : Ex- Do atleast1 projects

Application process
Where: Leetcode
Eligibility: No criteria
Resume Tip
Resume tip

Tip 1 : Mark your percentage 
Tip 2 : Mark your skill set

Interview rounds

01
Round
Medium
Online Coding Test
Duration60 minutes
Interview date7 Apr 2022
Coding problem5

- Morning time
- Environment was good.
- No activity
- Interviewer was good

1. Mohan and Magic Boots

Moderate
40m average time
70% success
0/80
Asked in companies
WalmartTata Consultancy Services (TCS)

Mohan is walking on a street, Assume he is walking on the X-Axis. He is currently at point ‘0’ and needed to reach a point ‘N’.

On the way, he found magic boots which have a special property, it makes him teleport either to point ‘X+2’ by a probability of ‘P/100’ or otherwise to point ‘X+3’ if he is currently on point ‘X’.

Now as he has some urgent work to do after reaching point ‘N’, he wants to calculate the probability of reaching point ‘N’, and if that probability is strictly greater than ‘X/100’ then it means he will reach the point ‘N’ earlier, otherwise walking without magic boots he will reach earlier.

Being his friend he asked you to help him to calculate the probability to reach point ‘N’ and help him decide if it's helpful to pick up the boots or not. If the probability is strictly greater than ‘X/100’ you say ‘1’ or else you say ‘0’. Can you help him?.

EXAMPLE :
Input: ‘N’ = 2, ‘P' = 30, ‘X’ = 29

Output: 1
In this case, 
The probability to reach point ‘2(=N)’ while wearing the magic boots is 
‘P/100’ = 30/100 = 0.30 i.e. 0.30 > (‘X/100’ = 29/100 = 0.29). Hence the output will be ‘1’.
Try solving now

2. Cube Sum Pairs

Easy
15m average time
85% success
0/40
Asked in companies
AdobeFreshworksTata Consultancy Services (TCS)

You are given a positive integer N, and you have to find the number of ways to represent N as a sum of cubes of two integers(let’s say A and B), such that:

N = A^3 + B^3.

Note:

1. A should be greater than or equal to one (A>=1).
2. B should be greater than or equal to zero (B>=0).
3. (A, B) and (B, A) should be considered different solutions, if A is not equal to B, i.e (A, B) and (B, A) will not be distinct if A=B.
Problem approach

step 1 - We know that any number m that satisfies the constraint will have two distinct pairs (let's say (a, b) and (c, d)).
step 2 - Since m < n, we can say that a, b, c, and d are less than n1/3. 
step 3 - Now for every distinct pair (x, y) formed by numbers less than the n1/3, store their sum x3 + y3 into a set. 
step 4- If two pairs with the same sum exist, print the sum.

Try solving now

3. Maximum Subarray Sum

Moderate
35m average time
81% success
0/80
Asked in companies
Expedia GroupSnapdealInfo Edge India (Naukri.com)

You are given an array 'arr' of length 'n', consisting of integers.


A subarray is a contiguous segment of an array. In other words, a subarray can be formed by removing 0 or more integers from the beginning and 0 or more integers from the end of an array.


Find the sum of the subarray (including empty subarray) having maximum sum among all subarrays.


The sum of an empty subarray is 0.


Example :
Input: 'arr' = [1, 2, 7, -4, 3, 2, -10, 9, 1]

Output: 11

Explanation: The subarray yielding the maximum sum is [1, 2, 7, -4, 3, 2].
Try solving now

4. Max Game

Easy
25m average time
70% success
0/40
Asked in companies
IntuitAdobeTata Consultancy Services (TCS)

You are given 'N' numbers and you have to play a game using them. In one move you have to pick any two numbers 'A' and 'B' and replace them by their sum 'A+B'. Doing this gives you a penalty of 'A+B'. Note that the count of elements reduces by 1 every time you take 2 numbers and replace them by their sum. The game ends when there is only one element left. Your task is to minimise the penalty during the game.

You need to return the minimum possible penalty you can have when the game ends.

Try solving now

5. DBMS Question

What is Deadlock?

Problem approach

Answer -
step 1-All the players are indicated by an line below the number, all the points which colored black above the number line is suitable for the team division, but we need to consider the only integer co-ordinates, so there are 4 {-2,-1,0,1}.

Note that while considering -2, we can decide which side we want to keep player at -2 and for division we will consider him on left.

step 2- Second test case:
Both the players are at 2, so the point we can choose is 2, we can decide to keep one player on left and one player on the right.

02
Round
Easy
HR Round
Duration15 minutes
Interview date9 Mar 2022
Coding problem1

- Morning time
- Environment was good.
- No significant activity
- Interviewer was very strict

1. Basic HR Questions

Tell me about yourself 

Where do you see yourself in five, 10 and 15 years? 

What do you like to do outside of work? 

What is your dream job? 

How do you handle stress?

Problem approach

Tip 1 : Speak as much as you can
Tip 2 : Practice in front of mirror
Tip 3 : Deep dive into answer should be hands on

Here's your problem of the day

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

Skill covered: Programming

To make an AI less repetitive in a long paragraph, you should increase:

Choose another skill to practice
Similar interview experiences
company logo
SDE
2 rounds | 3 problems
Interviewed by Tata Consultancy Services (TCS)
1039 views
0 comments
0 upvotes
company logo
SDE
3 rounds | 6 problems
Interviewed by Tata Consultancy Services (TCS)
1584 views
0 comments
0 upvotes
company logo
SDE
3 rounds | 6 problems
Interviewed by Tata Consultancy Services (TCS)
999 views
0 comments
0 upvotes
company logo
SDE
3 rounds | 5 problems
Interviewed by Tata Consultancy Services (TCS)
1004 views
0 comments
0 upvotes
Companies with similar interview experiences
company logo
SDE
4 rounds | 6 problems
Interviewed by HashedIn
710 views
0 comments
0 upvotes
company logo
SDE
2 rounds | 4 problems
Interviewed by Cognizant
918 views
0 comments
0 upvotes
company logo
SDE
2 rounds | 4 problems
Interviewed by HCL Technologies
989 views
0 comments
0 upvotes