Code360 powered by Coding Ninjas X Naukri.com. Code360 powered by Coding Ninjas X Naukri.com
Tata Consultancy Services (TCS) interview experience Real time questions & tips from candidates to crack your interview

SDE - Intern

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

Interview preparation journey

expand-icon
Journey
I prepared by improving my skills and studying interview questions. I polished my resume, went online, and applied to jobs that matched my skills. I focused on clearly communicating my talents and interests during the interview. My planning and determination ultimately led to a job that I was happy to accept.
Application story
I discovered the TCS NQT (National Qualifier Test) on their official website. After registering, I dedicated time to preparing for the aptitude and technical sections. The NQT process provided a straightforward path to joining TCS.
Why selected/rejected for the role?
I believe I was selected because I performed well on the NQT, demonstrating strong aptitude and technical skills. During the interview, I effectively communicated my knowledge, enthusiasm for technology, and eagerness to learn.
Preparation
Duration: 9 months
Topics: Data Structures, DBMS, Computer Networks, OOPS, Pointers
Tip
Tip

Tip 1: Be confident in every situation.
Tip 2: Practice DSA questions.
Tip 3: Complete at least two good projects with a solid understanding of each.

Application process
Where: Company Website
Eligibility: 7 CGPA
Resume Tip
Resume tip

Tip 1: Have 2-3 good projects on your resume.
Tip 2: Your resume should show every skill you have.

Interview rounds

01
Round
Medium
Online Coding Interview
Duration180 minutes
Interview date10 Jul 2022
Coding problem2

The first round of my TCS NQT consisted of multiple-choice questions covering verbal ability, reasoning ability, and numerical ability. Additionally, there was a programming logic section with two coding questions. In this mcq's were medium to hard level. There were two coding questions ranging from 1- easy and 1 - medium level. There were batches assigned and every batch got there 3hr time for this round.

1. Search an Element in an Array

Easy
15m average time
80% success
0/40
Asked in companies
Tata Consultancy Services (TCS)OracleCurefit

You have given a sorted array 'A' of 'N' integers.

Now, you are given 'Q' queries, and each query consists of a single integer 'X'. Your task is to check whether 'X' is present in array 'A' or not for each query. If 'X' exists in array 'A', you need to print 1 else print 0.

Note :

The given array is sorted in non-decreasing order. 
Problem approach

It was a simple question where we just need put all the zeros to the end of array.
To solve this problem, I implemented a two-pointer approach. I used one pointer to scan through the array and another to keep track of the position where non-zero elements should be placed. As I iterated through the array, I moved all non-zero elements to the front, effectively pushing the zeros (empty packets) to the end. This solution had a time complexity of O(n) and didn't require extra space, making it efficient for large inputs.

Try solving now

2. Sort Array

Moderate
15m average time
85% success
0/80
Asked in companies
SprinklrTata Consultancy Services (TCS)BNY Mellon

You are given an array consisting of 'N' positive integers where each integer is either 0 or 1 or 2. Your task is to sort the given array in non-decreasing order.

Note :
1. The array consists of only 3 distinct integers 0, 1, 2.
2. The array is non-empty.
Problem approach

Tip 1: Analyze problems before coding.
Tip 2: Use elimination for tricky MCQs.
Tip 3: Manage time: quick solves first, flag difficult ones.

Try solving now
02
Round
Medium
Face to Face
Duration60 minutes
Interview date8 Aug 2022
Coding problem1

My second round was an in-depth technical interview. It began with two coding challenges: the 'Rat in a Maze' problem, which tests recursive backtracking skills, and a LinkedList question, likely focusing on data structure manipulation. I explained my approach and coded solutions for both.
The interviewer then probed my knowledge of computer networks, asking about key protocols and concepts. For SQL, I was asked to write and explain several queries, demonstrating my database skills.
We concluded by discussing my project. I outlined its purpose, my role, the technologies used, and the challenges I overcame. This allowed me to showcase my practical experience and problem-solving abilities in a real-world context.
Throughout the interview, I focused on clear communication and logical thinking, aiming to demonstrate both my technical skills and my ability to apply them practically.

1. Rat In A Maze

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

You are given a starting position for a rat which is stuck in a maze at an initial point (0, 0) (the maze can be thought of as a 2-dimensional plane). The maze would be given in the form of a square matrix of order 'N' * 'N' where the cells with value 0 represent the maze’s blocked locations while value 1 is the open/available path that the rat can take to reach its destination. The rat's destination is at ('N' - 1, 'N' - 1). Your task is to find all the possible paths that the rat can take to reach from source to destination in the maze. The possible directions that it can take to move in the maze are 'U'(up) i.e. (x, y - 1) , 'D'(down) i.e. (x, y + 1) , 'L' (left) i.e. (x - 1, y), 'R' (right) i.e. (x + 1, y).

Note:
Here, sorted paths mean that the expected output should be in alphabetical order.
For Example:
Given a square matrix of size 4*4 (i.e. here 'N' = 4):
1 0 0 0
1 1 0 0
1 1 0 0
0 1 1 1 
Expected Output:
DDRDRR DRDDRR 
i.e. Path-1: DDRDRR and Path-2: DRDDRR

The rat can reach the destination at (3, 3) from (0, 0) by two paths, i.e. DRDDRR and DDRDRR when printed in sorted order, we get DDRDRR DRDDRR.
Problem approach

First I implemented a naive approach and then I implemented a depth-first search (DFS) with pruning. Instead of checking all four directions at each step, I used a direction array to streamline movement choices. I also incorporated visited marking directly in the input matrix to save space.
To further optimize, I used a single string to build the path, appending and removing characters as I moved, rather than creating new strings for each path. This reduced memory usage.
For additional efficiency, I implemented early termination: if the rat reached a dead end, I immediately backtracked without exploring further. These optimizations improved both time and space complexity, making the solution more efficient for larger mazes.

Try solving now
03
Round
Easy
HR Round
Duration30 minutes
Interview date8 Aug 2022
Coding problem0

In the third round, I had a standard HR interview. The discussion covered my background, career goals, and reasons for choosing TCS. We talked about my understanding of the company's culture and values. The interviewer asked about my strengths, weaknesses, and how I handle challenges. We also discussed my expectations from the role and my long-term career plans. The conversation was professional yet relaxed, allowing me to express my enthusiasm for joining TCS and my fit with the organization.

Here's your problem of the day

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

What does ROLLBACK do in DBMS?

Join the Discussion
1 reply
profile
17 days ago
Edited

They are asking rat in a maze  and linked list questions in a TCS interview , wow , for what role you gave this interview, I mean digital or prime 

0 upvotes
0 replies
Reply
Similar interview experiences
company logo
SDE - Intern
2 rounds | 4 problems
Interviewed by Tata Consultancy Services (TCS)
1157 views
0 comments
0 upvotes
company logo
SDE - Intern
3 rounds | 3 problems
Interviewed by Tata Consultancy Services (TCS)
1003 views
0 comments
0 upvotes
company logo
SDE - Intern
3 rounds | 10 problems
Interviewed by Tata Consultancy Services (TCS)
794 views
0 comments
0 upvotes
company logo
SDE - Intern
3 rounds | 4 problems
Interviewed by Tata Consultancy Services (TCS)
760 views
0 comments
0 upvotes
Companies with similar interview experiences
company logo
SDE - Intern
2 rounds | 4 problems
Interviewed by Arcesium
3073 views
0 comments
0 upvotes
company logo
SDE - Intern
3 rounds | 5 problems
Interviewed by Arcesium
2042 views
0 comments
0 upvotes
company logo
SDE - Intern
3 rounds | 5 problems
Interviewed by BNY Mellon
1832 views
0 comments
0 upvotes