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

TCS Ninja

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

Interview preparation journey

expand-icon
Preparation
Duration: 1 month
Topics: Arrays , Strings , Number Theory , Sorting , Searching , Aptitude , Reasoning.
Tip
Tip

Tip 1 : Atleast have 2 projects in your resume .
Tip 2 : Go Through Common HR Questions .
Tip 3 : Prepare well for Aptitude and Reasoning .

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

Tip 1 : Be Confident about things you have mentioned in your resume.

Tip 2 : Practicing 10 Questions for topics like Arrays , String , Number Theory , Sorting will be enough .

Interview rounds

01
Round
Easy
Online Coding Interview
Duration180 minutes
Interview date30 Aug 2021
Coding problem2

Section Number of Questions Duration

Numerical Ability 26 40
Verbal Ability 24 24 30
Reasoning Ability 30 50
Programming Logic 10 15
Hands-on Coding 1 15 15
Hands-on Coding 1 30 30

1. Toggle K bits

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

You are given a 32-bit integer ‘N’. Your task is to toggle the rightmost ‘K’ bits in the given integer and return the new integer.

For Example :
If ‘N’ = 12 and ‘K’ = 2:
The binary representation of 12 is ‘1100’, after toggling rightmost 2 bits, it becomes ‘1111’ i.e. 15. Hence, the answer is 15. 
Problem approach

Binary representation of 10 is 1010. After toggling the bits(1010), will get 0101 which represents “5”. Hence output will print “5”.


#include 
using namespace std;

int main()
{
int n; cin>>n;
int k=(1<<(int)floor(log2(n))+1)-1;
cout<<(n^k);
}

Try solving now

2. Program to find Nth term in the given Series

Find the nth term of the series.

1, 1, 2, 3, 4, 9, 8, 27, 16, 81, 32, 243,64, 729, 128, 2187 ….

This series is a mixture of 2 series – all the odd terms in this series form a geometric series and all the even terms form yet another geometric series. Write a program to find the Nth term in the series.

The value N in a positive integer that should be read from STDIN.
The Nth term that is calculated by the program should be written to STDOUT.
Other than value of nth term ,no other character / string or message should be written to STDOUT.
For example , if N=16, the 16th term in the series is 2187, so only value 2187 should be printed to STDOUT.
You can assume that N will not exceed 30.

Test Case 1

Input- 16
Expected Output – 2187
Test Case 2

Input- 13
Expected Output – 64

Problem approach

1, 1, 2, 3, 4, 9, 8, 27, 16, 81, 32, 243,64, 729, 128, 2187 can represented as :

2(0), 3(0),2(1), 3(1),2(2), 3(2),2(3), 3(3),2(4), 3(4),2(5), 3(5),2(6), 3(6) ….

There are two consecutive sub GP’s at even and odd positions

(GP-1) At Odd Positions (Powers of 2) – 1, 2, 4, 8, 16, 32, 64, 128
(GP-2) At Even Positions (Powers of 3) – 1, 3, 9, 27, 81, 243, 729, 2187
Clearly, for calculating Nth position value

If N is Even, Find (N/2) position in sub GP – 2
If N is Odd, Find (N/2 + 1) position in sub GP – 1

02
Round
Easy
Face to Face
Duration30 minutes
Interview date30 Sep 2022
Coding problem0

Interview was quite easy .
Topics asked to me : OOPS related questions, Strings , difference between a list and tuple in python , Classes and Object , different types of access modifiers , Technologies used to build projects , linear search vs binary Search etc

03
Round
Easy
HR Round
Duration15 minutes
Interview date2 Oct 2021
Coding problem0

Some common questions asked to me :

Tell me about yourself.
Why do you want to work for our company? 
What are your greatest strengths and weaknesses?
Why are you looking for a change? 
Tell me about the gap in your resume. 
How would you rate yourself on a scale of 1 to 10?

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
System Engineer
2 rounds | 2 problems
Interviewed by Tata Consultancy Services (TCS)
2956 views
0 comments
0 upvotes
company logo
SDE - Intern
3 rounds | 3 problems
Interviewed by Tata Consultancy Services (TCS)
5200 views
1 comments
0 upvotes
company logo
TCS Ninja
3 rounds | 5 problems
Interviewed by Tata Consultancy Services (TCS)
1446 views
0 comments
0 upvotes
company logo
TCS Ninja
2 rounds | 7 problems
Interviewed by Tata Consultancy Services (TCS)
48 views
0 comments
0 upvotes