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

Software Engineer

Tata Consultancy Services (TCS)
upvote
share-icon
3 rounds | 4 Coding problems

Interview preparation journey

expand-icon
Journey
I took admission in not so good college , so I knew that I have to work harder to get a good job. I started coding in my third semester and soon after that I started doing questions daily on Leetcode and codechef.
Application story
I got a message in my telegram group about the company visiting our campus for the hiring of Product Analyst. I was not so sure about that but I still applied and luckily I was selected.
Why selected/rejected for the role?
I was confident during the full interview process. Actually, I worked a lot on my communications skills and I think they were the main reasons for me getting par the selection process.
Preparation
Duration: 2 Months
Topics: Machine Learning, Statistics, Python, Data structures and algorithms, OOPs, Dynamic programming
Tip
Tip

Tip 1 : Have atleast one internship in Data science or ML domain...Will help you to gain exposure
Tip 2 : Do good practice of advanced data structures like Tries,graphs etc.
Tip 3 : Be good in your communication

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

Tip 1 : Keep your resume up to date and mention three or four good level projects which will give a good impression to the interviewer
Tip 2 : You should be well aware and knowledgeable about all the things that are mentioned in your resume.

Interview rounds

01
Round
Easy
Online Coding Test
Duration90 Minutes
Interview date2 Mar 2022
Coding problem1

1. Minimum Time To Solve The Problems

Hard
50m average time
50% success
0/120
Asked in companies
Tata Consultancy Services (TCS)BarclaysSprinklr

There are 'N' number of subjects and the ith subject contains subject[i] number of problems. Each problem takes 1 unit of time to be solved. Also, you have 'K' friends, and you want to assign the subjects to each friend such that each subject is assigned to exactly one friend. Also, the assignment of subjects should be contiguous. Your task is to calculate the maximum number of problems allocated to a friend is minimum. See example for more understanding.

For Example:
If N = 4, K = 2 and subjects = {50,100,300,400}
Assignment of problems can be done in the following ways among the two friends.
{} and {50,100,300,400}. Time required = max(0, 50+100+300+400) = max(0, 850) = 850
{50} and {100,300,400}. Time required = max(50, 100+300+400) = max(50, 800) = 800
{50, 100} and {300,400}. Time required = max(50+100, 300+400) = max(150, 700) = 700
{50,100,300} and {400}. Time required = max(50+100+300, 400) = max(450, 400) = 400
{50,100,300, 400} and {}. Time required = max(50+100+300+400, 0) = max(850, 0) = 850

So, out of all the above following ways, 400 is the lowest possible time.
Try solving now
02
Round
Easy
Online Coding Test
Duration60 Minutes
Interview date3 Mar 2022
Coding problem2

1. Maximum of All Subarrays of Size K

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

You are given an array “A” of N integers. Your task is to find the maximum element in all K sized contiguous subarrays from left to right.

For Example:
If A = [3, 2, 3], and K = 2.
Then max of [3, 2] = 3 and max of [2, 3] = 3
So, the answer will be [3, 3]

If A = [3, 2, 3, 5, 1, 7] and K = 3.
Then max of [3, 2, 3] = 3 
Then max of [2, 3, 5] = 5 
Then max of [3, 5, 1] = 5 
Then max of [5, 1, 7] = 7 
So  the answer will be [3, 5, 5, 7]
Follow Up :
Can you solve the problem in O(N) time complexity and O(K) space complexity?
Problem approach

1. Create a queue to store k elements.
2. Run a loop and insert till index less than k(window size) in the queue.
3. Then for an index greater than equal to k, check the greater element of the current queue and output it. And then to slide the window, dequeue the first element of the queue, and enqueue new element of the current index in the queue.
4. And when the loop completes, check the greater element of the queue outside the loop for the last window

Try solving now

2. Shortest Path in a Binary Matrix

Moderate
37m average time
65% success
0/80
Asked in companies
CIS - Cyber InfrastructureMakeMyTripGoldman Sachs

You have been given a binary matrix of size 'N' * 'M' where each element is either 0 or 1. You are also given a source and a destination cell, both of them lie within the matrix.

Your task is to find the length of the shortest path from the source cell to the destination cell only consisting of 1s. If there is no path from source to destination cell, return -1.

Note:
1. Coordinates of the cells are given in 0-based indexing.
2. You can move in 4 directions (Up, Down, Left, Right) from a cell.
3. The length of the path is the number of 1s lying in the path.
4. The source cell is always filled with 1.
For example -
1 0 1
1 1 1
1 1 1
For the given binary matrix and source cell(0,0) and destination cell(0,2). Few valid paths consisting of only 1s are

X 0 X     X 0 X 
X X X     X 1 X 
1 1 1     X X X 
The length of the shortest path is 5.
Problem approach

1. Initialize distances of all vertices as infinite.
2. Create an empty priority_queue pq. Every item of pq is a pair (weight, vertex). Weight (or distance) is used as the first item of pair as the first item is by default used to compare two pairs
3. Insert source vertex into pq and make its distance as 0. While either pq doesn't become empty
a) Extract minimum distance vertex from pq. Let the extracted vertex be u.
b) Loop through all adjacent of u and do following for every vertex v.
If there is a shorter path to v through u.
If dist[v] > dist[u] + weight(u, v)
(i) Update distance of v, i.e., do dist[v] = dist[u] + weight(u, v)
(ii) Insert v into the pq (Even if v is already there)

Try solving now
03
Round
Easy
HR Round
Duration30 Minutes
Interview date9 Mar 2022
Coding problem1

1. Basic HR Questions

Introduce yourself, why do you want to join the company, what do you know about the company etc.

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
Software Engineer
2 rounds | 2 problems
Interviewed by Tata Consultancy Services (TCS)
1640 views
0 comments
0 upvotes
company logo
Software Engineer
3 rounds | 3 problems
Interviewed by Tata Consultancy Services (TCS)
0 views
0 comments
0 upvotes
company logo
Software Engineer
3 rounds | 4 problems
Interviewed by Tata Consultancy Services (TCS)
1460 views
0 comments
0 upvotes
company logo
Software Engineer
3 rounds | 3 problems
Interviewed by Tata Consultancy Services (TCS)
1091 views
0 comments
0 upvotes
Companies with similar interview experiences
company logo
Software Engineer
4 rounds | 1 problems
Interviewed by Newgen Software
3195 views
2 comments
0 upvotes
company logo
Software Engineer
3 rounds | 6 problems
Interviewed by HashedIn
2574 views
0 comments
0 upvotes
company logo
Software Engineer
2 rounds | 2 problems
Interviewed by Ernst & Young (EY)
0 views
0 comments
0 upvotes