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

Trainee Technology

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

Interview preparation journey

expand-icon
Preparation
Duration: 3 months
Topics: Patterns, Pointers, Searching, Sorting, Basics of computer networking
Tip
Tip

Tip 1 : Have a good grasp on the project topics mentioned in the resume.
Tip 2 : Machine Learning projects are a big plus.
Tip 3 : Your "Tell me about yourself" should be impressive.

Application process
Where: Campus
Eligibility: Minimum 60% with no standing backlog and maximum academic gap of 24 months till the date of application.
Resume Tip
Resume tip

Tip 1 : Please only mention the things you really know about. It's very important.
Tip 2 : Machine learning projects in the resume is a big plus.

Interview rounds

01
Round
Easy
Online Coding Interview
Duration180 minutes
Interview date17 Oct 2020
Coding problem2

The exam was conducted from home via the software designed by TCS. The test consists of logical reasoning, Verbal Ability, Numerical Ability, Programming Logic questions. It was a medium level difficulty test. 

1. Reverse DLL nodes in groups

Moderate
10m average time
90% success
0/80
Asked in companies
AdobeTata Consultancy Services (TCS)Amazon

You are given a Doubly Linked List of integers and a positive integer 'K' representing the group size. Modify the linked list by reversing every group of 'K' nodes in the linked list.

A doubly linked list is a type of linked list that is bidirectional, that is, it can be traversed in both directions, forward and backward. 
Note:
If the number of nodes in the list or in the last group is less than K, just reverse the remaining nodes. 
Example:
Linked list: 8 9 10 11 12
K: 3 

Output: 10 9 8 12 11

We reverse the first K (3) nodes. Now, since the number of nodes remaining in the list (2) is less than K, we just reverse the remaining nodes (11 and 12).  
Problem approach

Step 1 : It was a variation of a standard rotating linked list problem.

Step 2 : I took the idea of the rotate linked list problem via iteration.

Step 3 : I used a temp variable to store the current node and previous node and using the loop, I iterated over all nodes of the doubly linked list.

Try solving now

2. Sort 0 1 2

Easy
22m average time
0/40
Asked in companies
AmazonFacebookMathworks

You have been given an integer array/list(ARR) of size 'N'. It only contains 0s, 1s and 2s. Write a solution to sort this array/list.

Note :
Try to solve the problem in 'Single Scan'. ' Single Scan' refers to iterating over the array/list just once or to put it in other words, you will be visiting each element in the array/list just once.
Problem approach

Step 1 : I used the two pointer approach.
Step 2 : I collected all the zero's on the left indices of the array and all the 1's on the right side of the array.
Step 3 : After iterating over all the elements of the array, my whole array was sorted in linear time complexity.

Try solving now
02
Round
Easy
Face to Face
Duration40 minutes
Interview date9 Nov 2020
Coding problem2

The interview was scheduled in the day. The interviewer asked some HR type questions although it was my technical interview. Salary expectations, work location choices, management questions, etc. formed a big part of the interview. Then typical questions around the concept of OOPS, networking, DBMS fill the remaining time. 
Questions like searching and sorting and projects were focused in the other half of the interview.

1. Merge Sort

Easy
15m average time
85% success
0/40
Asked in companies
Wells FargoThought WorksAccenture

Given a sequence of numbers ‘ARR’. Your task is to return a sorted sequence of ‘ARR’ in non-descending order with help of the merge sort algorithm.

Example :

Merge Sort Algorithm -

Merge sort is a Divide and Conquer based Algorithm. It divides the input array into two-parts, until the size of the input array is not ‘1’. In the return part, it will merge two sorted arrays a return a whole merged sorted array.

subsequence

The above illustrates shows how merge sort works.
Note :
It is compulsory to use the ‘Merge Sort’ algorithm.
Problem approach

Step1 : This is a standard divide and conquer problem.

Step2 : I explained the general idea behind the algorithm and coded as per the standard algorithm

Step3 : I also explained why it's one of the best sorting algorithms while coding my way.

Try solving now

2. Sorted Linked List to Balanced BST

Moderate
25m average time
70% success
0/80
Asked in companies
Samsung R&D InstituteMorgan StanleyApple

You have been given a singly linked list in which nodes are present in increasing order. Your task is to construct a Balanced Binary Search Tree with the same data elements as the given Linked List.

A Balanced BST is defined as a BST in which the height of two subtrees of every node differs no more than 1.

Problem approach

Practise questions like this

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

To make an AI less repetitive in a long paragraph, you should increase:

Choose another skill to practice
Similar interview experiences
company logo
SDE - 1
2 rounds | 7 problems
Interviewed by Tata Consultancy Services (TCS)
1595 views
3 comments
0 upvotes
company logo
System Engineer
2 rounds | 2 problems
Interviewed by Tata Consultancy Services (TCS)
2957 views
0 comments
0 upvotes
company logo
SDE - Intern
3 rounds | 3 problems
Interviewed by Tata Consultancy Services (TCS)
5201 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
Companies with similar interview experiences
company logo
Trainee Technology
2 rounds | 4 problems
Interviewed by HCL Technologies
4846 views
0 comments
0 upvotes