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 - 1

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

Interview preparation journey

expand-icon
Preparation
Duration: 12
Topics: C++, Data Structure, Operating System, SQL, Algorithms, System Design
Tip
Tip

Tip 1: Practice at least 300 coding questions.
Tip 2: Be confident.
Tip 3: Don't tell lies in interviews.

Application process
Where: Campus
Eligibility: CodeVita
Resume Tip
Resume tip

Tip 1: Mention some good projects.
Tip 2: Don't put any false things.

Interview rounds

01
Round
Medium
Online Coding Interview
Duration90 minutes
Interview date9 Aug 2020
Coding problem2

CodeVita: CodeVita is an online coding contest that is conducted by TCS every year across the whole world for coders to showcase their programming skills. There are three rounds in CodeVita:

Pre Qualifier: Conducted Online
Qualifier: Conducted Online
Grand Finale: Conducted in India (offline) in TCS centers
In the Pre Qualifier round, there are 6 questions, and if you are able to solve at least 1 question and clear it’s all the test cases, there is a chance that you will get an interview call from TCS. For the safe side try to solve 2 questions or more completely.

1. Delete alternate nodes

Easy
20m average time
80% success
0/40
Asked in companies
Morgan StanleyTata Consultancy Services (TCS)Amazon

Given a Singly Linked List of integers, delete all the alternate nodes in the list.

Example:
List: 10 -> 20 -> 30 -> 40 -> 50 -> 60 -> null
Alternate nodes will be:  20, 40, and 60.

Hence after deleting, the list will be:
Output: 10 -> 30 -> 50 -> null
Note :
The head of the list will remain the same. Don't need to print or return anything.
Problem approach

This was a very easy question. We just need to traverse the whole link list. Set initial count to 0. Then go on printing the nodes when the count is even and visit the next node.

Try solving now

2. Two Sum

Easy
10m average time
90% success
0/40
Asked in companies
ThalesSamsung R&D InstituteNatwest Group

You are given an array of integers 'ARR' of length 'N' and an integer Target. Your task is to return all pairs of elements such that they add up to Target.

Note:

We cannot use the element at a given index twice.

Follow Up:

Try to do this problem in O(N) time complexity. 
Problem approach

The brute force approach is simple. Loop through each element x and find if there is another value that equals to target - x.

To improve our run time complexity, we need a more efficient way to check if the complement exists in the array. If the complement exists, we need to look up its index. What is the best way to maintain a mapping of each element in the array to its index? A hash table.

We reduce the look-up time from O(n) to O(1) by trading space for speed. A hash table is built exactly for this purpose, it supports fast lookup in near-constant time. I say "near" because if a collision occurred, a look-up could degenerate to O(n) time. But look up in hash table should be amortized O(1) time as long as the hash function was chosen carefully.

A simple implementation uses two iterations. In the first iteration, we add each element's value and its index to the table. Then, in the second iteration, we check if each element's complement (target - nums[i]) exists in the table. Beware that the complement must not be nums[i] itself.

Try solving now
02
Round
Easy
Video Call
Duration60 minutes
Interview date14 Aug 2020
Coding problem2

We were informed by the TCS a day before the interview about the time of our interview and all. As this year the whole process was online so a bunch of instructions was mentioned by TCS like the internet connectivity, important documents to present, and all. I joined the virtual lobby on time and my slot was from 3:30 PM to 6:30 PM, there were a few more candidates in the virtual lobby, and a lady started to speak. I was the first to give the interview and all other candidates were given different slots by that lady for their interviews.

1. General Questions

Tell me something about yourself and tell me about the approaches you used to solve the problems in the contest:

Problem approach

I introduced myself with confidence and tried to showcase my skills in the introduction because the flow of the whole interview depends very much upon the introduction. I explained to him the question and my approach. The question was basically to find whether a given string contains 3 palindrome sub-strings or not.
My approach for solving this question was: consider the first letter as the first sub-string and the second letter as the second sub-string and the remaining letters as the third sub-string and check these 3 sub-strings are palindromes or not. If yes, return true, or else keep on increasing the number of letters in the second sub-string and first sub-string.
Be ready to give answers to questions like any other better approach, time complexity of your solution, or can we use any other data structure which can improve the time complexity of our solution.

2. OOPS Questions

  1. In which language do you code?
  2. What are the four pillars of Object-oriented programming?
  3. What is Null pointer exception in java?
  4. What is serialisation and deserialisation in Java?
  5. What is a constructor?
  6. Can you use pointer to swap two numbers without using a third variable?
Problem approach

Four pillars of Object-oriented programming are Abstraction, Encapsulation, Inheritance, and Polymorphism. 

Serialization in Java is a mechanism of writing the state of an object into a byte-stream. The reverse operation of serialization is called deserialization where byte-stream is converted into an object.

I had read up these topics from GFG before.

03
Round
Easy
Video Call
Duration90 minutes
Interview date14 Aug 2020
Coding problem2

This interview directly started with questions.

 

1. General Questions

How has the covid-19 pandemic affected the IT industry?

Problem approach

I answered that the covid-19 pandemic has affected all the industries but not the IT industry where physical presence is not required . Work from home was easily implemented in this industry and the productivity of the company and employees was not affected that much. Companies, where physical presence is required, were most affected during the covid-19 nationwide lockdown.

2. General Questions

What is the contribution of the TATA group towards the betterment of our nation?

Problem approach

You have to do your research about the company so that interviewer will think that you are genuinely interested to join the company. I answered the question and told him about the charities which done by the TATA group and Ratan Tata (former chairman of Tata Sons).

04
Round
Easy
HR Round
Duration90 minutes
Interview date15 Aug 2020
Coding problem1

First, she introduced herself and then asked me to give my introduction. Then she asked behavorial and general questions.
 

1. General Questions

  1. Why TCS?
  2.  Whether I know about the TCS contract or not?
  3.  Whether I wanted to join TCS?
Problem approach

1 :  To answer this question, my research about TCS helped me. I told her TCS is a great company and I will learn a lot from my seniors and colleagues. And I also told her that you can take a study gap in TCS to complete your higher education.
2 : I said no. She then explained to me the contract.

3 :  I said yes ma’am with confidence and a smile on my face.

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
11 Jul 2023

are you serisous ? HR round with 3 question's and of 90 minute ? 

kuch bhi bologe kya ? 

0 upvotes
0 replies
Reply
Similar interview experiences
company logo
SDE - 1
3 rounds | 5 problems
Interviewed by Tata Consultancy Services (TCS)
1211 views
0 comments
0 upvotes
company logo
SDE - 1
3 rounds | 6 problems
Interviewed by Tata Consultancy Services (TCS)
1074 views
0 comments
0 upvotes
company logo
SDE - 1
3 rounds | 6 problems
Interviewed by Tata Consultancy Services (TCS)
708 views
0 comments
0 upvotes
company logo
SDE - 1
2 rounds | 7 problems
Interviewed by Tata Consultancy Services (TCS)
1103 views
2 comments
0 upvotes
Companies with similar interview experiences
company logo
SDE - 1
2 rounds | 3 problems
Interviewed by BNY Mellon
4809 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 | 5 problems
Interviewed by Infosys
3336 views
0 comments
0 upvotes