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

SDE - 1

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

Interview preparation journey

expand-icon
Journey
My life has had many ups and downs, but I somewhat managed to get admission to the college where I took computer science as a subject. Then my coding journey started from here.
Application story
This company visited to my campus for the placements and I gave the first test that was provided to me in the college itself.
Why selected/rejected for the role?
I was rejected in the interview. I was asked a question involving permutation of string which I was not able to explain properly at that time.
Preparation
Duration: 4 Months
Topics: DSA, OOPS, OS, CN, Algorithms, DBMS, Dynamic Programming, Graphs
Tip
Tip

Tip 1 : Do DSA
Tip 2 : Do Extra Subjects
Tip 3 : Prepare some Projects

Application process
Where: Campus
Eligibility: 7 CGPA
Resume Tip
Resume tip

Tip 1 : Do Mention coding profiles in resume
Tip 2 : Do add summary of Projects

Interview rounds

01
Round
Medium
Online Coding Test
Duration50 minutes
Interview date13 Aug 2021
Coding problem2

2 coding questions
1st - Greedy
2nd - Recursion

1. Minimum Difference

Moderate
20m average time
80% success
0/80
Asked in companies
AmazonTata Consultancy Services (TCS)Jupiter Money

Goku is fighting Jiren in “Tournament of Power”. If Goku loses then Universe 7 will get destroyed by Zeno but if Jiren loses then Universe 11 will get destroyed and Universe 7 will survive. Both Goku and Jiren launched ‘N’ attacks towards each other. Each attack has some energy. Jiren has a special ability through which he can absorb the attacks of Goku. If Goku launches an attack with energy ‘A’ and Jiren launches an attack with energy ‘B’ then

If ‘A’ > ‘B’, then Goku’s attack will destroy Jiren’s attack but Jiren will absorb Goku’s attack and absorb energy = ‘A’ – ‘B’.

If ‘A’ < ‘B’, then Jiren’s attack will destroy Goku’s attack and Jiren will absorb the remaining energy of his attack which is equal to = ‘B’ – ‘A’.

If ‘A’ == ‘B’, then both Goku’s and Jiren’s attack will get destroyed and Jiren will not absorb any energy.

Goku finds out the energy of all attacks of Jiren and the order in which Jiren is going to attack with the help of Whis. As Jiren becomes powerful by absorbing energy, Goku wants to minimize the total energy absorbed by Jiren by rearranging the order of his attacks.

As Goku is busy fighting with Jiren, he called you for help.

The fate of Universe 7 lies in your hand.

Problem approach

It was a simple greedy question 
I have taken the minimum of all adjacent absolute differences and printed the minimum
T.C -> O(n)
S.C -> O(1)

Try solving now

2. Permutations of a String

Moderate
15m average time
85% success
0/80
Asked in companies
MakeMyTripDisney + HotstarTata Consultancy Services (TCS)

You are given a string 'STR' consisting of lowercase English letters. Your task is to return all permutations of the given string in lexicographically increasing order.

String A is lexicographically less than string B, if either A is a prefix of B (and A ≠ B), or there exists such i (1 <= i <= min(|A|, |B|)), that A[i] < B[i], and for any j (1 <= j < i) A[i] = B[i]. Here |A| denotes the length of the string A.

For example :

If the string is “bca”, then its permutations in lexicographically increasing order are { “abc”, “acb”, “bac”, “bca”, “cab”, “cba” }.
Note:
Given string contains unique characters.
Problem approach

using recursion and swapping it can be done.
T>C - > O(n*n!)

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

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

Choose another skill to practice
Similar interview experiences
company logo
SDE - 1
3 rounds | 5 problems
Interviewed by Tata Consultancy Services (TCS)
1842 views
0 comments
0 upvotes
company logo
SDE - 1
2 rounds | 7 problems
Interviewed by Tata Consultancy Services (TCS)
1283 views
0 comments
0 upvotes
company logo
SDE - 1
3 rounds | 6 problems
Interviewed by Tata Consultancy Services (TCS)
1473 views
0 comments
0 upvotes
company logo
SDE - 1
2 rounds | 7 problems
Interviewed by Tata Consultancy Services (TCS)
1595 views
3 comments
0 upvotes
Companies with similar interview experiences
company logo
SDE - 1
2 rounds | 3 problems
Interviewed by BNY Mellon
6240 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
2 rounds | 3 problems
Interviewed by Accenture
2487 views
0 comments
0 upvotes