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

Digital

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

Interview preparation journey

expand-icon
Journey
Hello, I am Omesh Balaji Padampalle. I started my coding journey in the second year of college. First, I began with the C language, then shifted to C++ because of competitive coding. By my fourth year, I had solved 400+ questions on Coding Ninjas. When the on-campus drive started, I was initially rejected by 3-4 companies. In January, the TCS on-campus drive was conducted, and I received a Digital offer.
Application story
TCS conducted an On-Campus drive. First, you have to clear the TCS NQT exam. Then, you receive an email regarding the profile you have been selected for, followed by an interview for your assigned role.
Why selected/rejected for the role?
I got selected for this role because of my problem-solving skills. I worked on a project that solves a real-world problem.
Preparation
Duration: 6 months
Topics: Data Structures, MySQL, OOPs, Operating Systems, React, Algorithms
Tip
Tip

Tip 1: Solve the Striver A to Z DSA Sheet.
Tip 2: Revision is very important.
Tip 3: Don't take rejection from companies too seriously.

Application process
Where: Campus
Eligibility: No active backlogs, Need the Above 6 CGPA (Salary: 7 LPA)
Resume Tip
Resume tip

Tip 1: Keep it short and simple.
Tip 2: Add only what you know; don't include extra stuff.
Tip 3: Also, add projects that solve real-world problems.

Interview rounds

01
Round
Medium
Online Coding Interview
Duration3 hours
Interview date20 Jan 2024
Coding problem2

The duration was 3 hours. The first section was for aptitude, and the second section consisted of 2 coding questions—one was medium, and the other was hard.

1. Maximum Product Subarray

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

You are given an array “arr'' of integers. Your task is to find the contiguous subarray within the array which has the largest product of its elements. You have to report this maximum product.

An array c is a subarray of array d if c can be obtained from d by deletion of several elements from the beginning and several elements from the end.

For e.g.- The non-empty subarrays of an array [1,2,3] will be- [1],[2],[3],[1,2],[2,3],[1,2,3]. 
For Example:
If arr = {-3,4,5}.
All the possible non-empty contiguous subarrays of “arr” are {-3}, {4}, {5}, {-3,4}, {4,5} and {-3,4,5}.
The product of these subarrays are -3, 4, 5, -12, 20 and -60 respectively.
The maximum product is 20. Hence, the answer is 20.
Follow Up:
Can you solve this in linear time and constant space complexity?
Problem approach

First Approach:
The idea is to traverse every contiguous subarray, find the product of each of these subarrays, and return the maximum product among all the subarrays.

Second Approach:
Create 3 variables: currMin, currMax, and maxProd, initialized to the first element of the array.
Iterate through the indices from 0 to N-1 and update the variables:
currMax = max(arr[i], currMax * arr[i], currMin * arr[i])
currMin = min(arr[i], currMax * arr[i], currMin * arr[i])
Update maxProd with the maximum value at each index.
Finally, return maxProd as the result.

Try solving now

2. Ninja And Matrix

Easy
15m average time
85% success
0/40
Asked in companies
PhonePeTata Consultancy Services (TCS)Virsoftech Private Limited

Ninja loves patterns and visuals and recently he learned about 2-dimensional matrices now he wants to use his pattern skills on it. He has been provided with a 2-dimensional matrix with a size of ‘N’x’N’ and he wants to print the matrix in a snake pattern. Formally speaking he wants to print every odd indexed row in reverse order(0-indexed) and even indexed row as it is on a single line.

EXAMPLE:
Input: 'N' = 2, ‘MAT’ = [[1, 2], [5, 6]]

Output: 1 2 6 5

 So the first row will be printed as it is and the second row will be printed in reverse order.
Problem approach

Traverse all rows.
For each row, check if it is even or odd.
If it is even, print from left to right; otherwise, print from right to left.

Try solving now
02
Round
Medium
Face to Face
Duration45 minutes
Interview date8 Feb 2024
Coding problem2

At 2 o’clock,
Good environment.
The interview was of medium difficulty. He asked me about pattern questions, swapping numbers without using a third variable, SQL queries, ACID properties, and all the functionalities of my project.

1. DBMS

Write an SQL query to list the STUDENT_IDs who did not receive a scholarship. Also, include the join queries.

Problem approach

Tip 1: Practice SQL queries regularly.
Tip 2: Practice on any platform.

2. Bubble Sort

Easy
10m average time
90% success
0/40
Asked in companies
CiscoOptumTata Consultancy Services (TCS)

Bubble Sort is one of the sorting algorithms that works by repeatedly swapping the adjacent elements of the array if they are not in sorted order.

You are given an unsorted array consisting of N non-negative integers. Your task is to sort the array in non-decreasing order using the Bubble Sort algorithm.

For Example:
Bubble Sort implementation for the given array:  {6,2,8,4,10} is shown below :-

Alt test

Problem approach

Start: Begin with the first element.

Compare: Compare the current element with the next one.

Swap: If the current element is greater than the next, swap them.

Move Forward: Move to the next element and repeat the comparison and swapping.

End of Pass: After each full pass, the largest element is placed in its correct position.

Repeat: Continue the process for the remaining unsorted part of the list.

Done: Stop when no swaps are needed in a full pass.

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

Which SQL keyword removes duplicate records from a result set?

Choose another skill to practice
Similar interview experiences
company logo
SDE - 1
2 rounds | 7 problems
Interviewed by Tata Consultancy Services (TCS)
1286 views
2 comments
0 upvotes
company logo
System Engineer
2 rounds | 2 problems
Interviewed by Tata Consultancy Services (TCS)
879 views
0 comments
0 upvotes
company logo
SDE - Intern
3 rounds | 3 problems
Interviewed by Tata Consultancy Services (TCS)
4733 views
1 comments
0 upvotes
company logo
Digital
2 rounds | 3 problems
Interviewed by Tata Consultancy Services (TCS)
93 views
0 comments
0 upvotes