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

SDE

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

Interview preparation journey

expand-icon
Preparation
Duration: 4 months
Topics: Data Structures, Pointers, OOPS, System Design, Algorithms, Dynamic Programming.
Tip
Tip

Tip 1 : Practice daily question of DS algo
Tip 2 : Prepare all your projects
Tip 3 : Daily practice of aptitude
Tip 4 : Practice previous years Company questions

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

Tip 1 : Resume should contains only those skills that you know
Tip 2 : Add good projects and add github link to it also
Tip 3 : Resume should not be too long

Interview rounds

01
Round
Medium
Online Coding Interview
Duration150 minutes
Interview date11 Oct 2020
Coding problem3

English MCQs
Quant + Aptitude Mcqs
Coding round (60 minutes)

1. Pair Difference K

Moderate
15m average time
85% success
0/80
Asked in companies
BarclaysTata Consultancy Services (TCS)Facebook

You are given a sorted array ARR of integers of size N and an integer K. You have to find whether it is possible to find a pair of integers having an absolute difference of K.

Note:

1. K is a non-negative integer.

2. Absolute Difference between two integers A and B is equal to the difference of maximumOf(A, B) and minimumOf(A, B).

3. Pair of integers should have different indices in the array.
Try solving now

2. Check if the door is open or closed

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

There are ‘N’ doors and ‘N’ people in a house. Each person and door has a unique ID ranging from 1 to ‘N’. A person can change the status of the door i.e, if the door is open then a person can close the door and vice versa. Initially, all the doors are closed and each person wants to change the status of all doors whose ID is a multiple of the ID of the person. You need to find out the final status of all the doors.

The answer should be given in a form of a binary string where ‘0’ represents the closed door and ‘1’ represents the open door. For example, the status “close open close” will form a binary string “010”.

Try solving now

3. Nth Fibonacci Number

Easy
0/40
Asked in companies
IBMSAP LabsAccenture

The n-th term of Fibonacci series F(n), where F(n) is a function, is calculated using the following formula -

    F(n) = F(n - 1) + F(n - 2), 
    Where, F(1) = 1, F(2) = 1


Provided 'n' you have to find out the n-th Fibonacci Number. Handle edges cases like when 'n' = 1 or 'n' = 2 by using conditionals like if else and return what's expected.

"Indexing is start from 1"


Example :
Input: 6

Output: 8

Explanation: The number is ‘6’ so we have to find the “6th” Fibonacci number.
So by using the given formula of the Fibonacci series, we get the series:    
[ 1, 1, 2, 3, 5, 8, 13, 21]
So the “6th” element is “8” hence we get the output.
Problem approach

In mathematical terms, the sequence Fn of Fibonacci numbers is defined by the recurrence relation 

Fn = Fn-1 + Fn-2
with seed values 

F0 = 0 and F1 = 1.

A simple method that is a direct recursive implementation mathematical recurrence relation

Try solving now
02
Round
Easy
Video Call
Duration20 minutes
Interview date7 Nov 2020
Coding problem2

1. String Palindrome

Easy
0/40
Asked in companies
Paytm (One97 Communications Limited)CIS - Cyber InfrastructureInnovaccer

Given a string, determine if it is a palindrome, considering only alphanumeric characters.

Palindrome
A palindrome is a word, number, phrase, or other sequences of characters which read the same backwards and forwards.
Example:
If the input string happens to be, "malayalam" then as we see that this word can be read the same as forward and backwards, it is said to be a valid palindrome.

The expected output for this example will print, 'true'.

From that being said, you are required to return a boolean value from the function that has been asked to implement.

Problem approach

Our approach will be that we will first convert the string to lowercase. Then, we will take two pointers i pointing to the start of the string and j pointing to the end of the string. Keep incrementing i and decrementing j while i < j and at every step check whether the characters at these pointers are same or not. If not then the string is not a palindrome else it is.

Try solving now

2. Algorithm to find best insert position in sorted array

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

You are given a sorted array 'arr' of distinct values and a target value 'm'. You need to search for the index of the target value in the array.


Note:
1. If the value is present in the array, return its index.
2. If the value is absent, determine the index where it would be inserted in the array while maintaining the sorted order. 
3. The given array has distinct integers.
4. The given array may be empty.



Example:
Input:  arr = [1, 2, 4, 7],  m = 6 

Output: 3

Explanation: If the given array 'arr' is: [1, 2, 4, 7] and m = 6. We insert m = 6 in the array and get 'arr' as: [1, 2, 4, 6, 7]. The position of 6 is 3 (according to 0-based indexing)


Problem approach

To optimize the above approach, the idea is to use Binary Search. Follow the steps below to solve the problem: 

Set start and end as 0 and N – 1, where the start and end variables denote the lower and upper bound of the search space respectively.
Calculate mid = (start + end) / 2.
If arr[mid] is found to be equal to K, print mid as the required answer.
If arr[mid] exceeds K, set high = mid – 1 Otherwise, set low = mid + 1.

Try solving now
03
Round
Easy
HR Round
Duration10 minutes
Interview date21 Nov 2020
Coding problem1

1. Basic HR Questions

Tell us about your projects.

Why do you want to join us?

What are your strengths and weaknesses?

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
2 rounds | 3 problems
Interviewed by Tata Consultancy Services (TCS)
1039 views
0 comments
0 upvotes
company logo
SDE
3 rounds | 6 problems
Interviewed by Tata Consultancy Services (TCS)
998 views
0 comments
0 upvotes
company logo
SDE
3 rounds | 5 problems
Interviewed by Tata Consultancy Services (TCS)
1003 views
0 comments
0 upvotes
company logo
SDE
2 rounds | 6 problems
Interviewed by Tata Consultancy Services (TCS)
2132 views
0 comments
0 upvotes
Companies with similar interview experiences
company logo
SDE
4 rounds | 6 problems
Interviewed by HashedIn
709 views
0 comments
0 upvotes
company logo
SDE
2 rounds | 4 problems
Interviewed by Cognizant
918 views
0 comments
0 upvotes
company logo
SDE
2 rounds | 4 problems
Interviewed by HCL Technologies
988 views
0 comments
0 upvotes