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

SDE

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

Interview preparation journey

expand-icon
Preparation
Duration: 3 Months
Topics: Data Structures, My SQL, OOPS, Database, Algorithms, Dynamic Programming, Operating System.
Tip
Tip

Tip 1 : Practice good number of questions.
Tip 2 : Do at least 2 projects.

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

Tip 1 : Have some good projects in your resume.
Tip 2 : Do not put false things on resume.

Interview rounds

01
Round
Medium
Online Coding Interview
Duration150 minutes
Interview date10 Aug 2021
Coding problem2

3 sections were there (Verbal Ability (15), Advanced Quantitative Aptitude (15), Coding (2))

1. Number of jumps for a thief to cross walls

A thief trying to escape from a jail. He has to cross N walls each with varying heights (every height is greater than 0). He climbs X feet every time. But, due to the slippery nature of those walls, every time he slips back by Y feet. Now the task is to calculate the total number of jumps required to cross all walls and escape from the jail.

Problem approach

I Iterated over the whole array and count the number of jumps required to cross that wall without using loop.

2. Encode the Message

Easy
18m average time
90% success
0/40
Asked in companies
MicrosoftAmazonWalmart

You have been given a text message. You have to return the Run-length Encoding of the given message.

Run-length encoding is a fast and simple method of encoding strings. The basic idea is to represent repeated successive characters as the character and a single count. For example, the string "aaaabbbccdaa" would be encoded as "a4b3c2d1a2".

Problem approach

a) Pick the first character from the source string. 
b) Append the picked character to the destination string. 
c) Count the number of subsequent occurrences of the picked character and append the count to the destination string. 
d) Pick the next character and repeat steps b) c) and d) if the end of the string is NOT reached.

Try solving now
02
Round
Easy
Face to Face
Duration20 - 30 minutes
Interview date15 Sep 2021
Coding problem1

I was asked questions based upon OOPS and JAVA related questions after that they gave me a coding problem then they asked me about my projects that i mentioned in my resume in detail.

1. Count Ways To Reach The N-th Stairs

Moderate
30m average time
80% success
0/80
Asked in companies
MicrosoftMorgan StanleyAdobe

You have been given a number of stairs. Initially, you are at the 0th stair, and you need to reach the Nth stair.


Each time, you can climb either one step or two steps.


You are supposed to return the number of distinct ways you can climb from the 0th step to the Nth step.

Note:

Note: Since the number of ways can be very large, return the answer modulo 1000000007.
Example :
N=3

Example

We can climb one step at a time i.e. {(0, 1) ,(1, 2),(2,3)} or we can climb the first two-step and then one step i.e. {(0,2),(1, 3)} or we can climb first one step and then two step i.e. {(0,1), (1,3)}.
Problem approach

The first method uses the technique of recursion to solve this problem.
Approach: We can easily find the recursive nature in the above problem. The person can reach nth stair from either (n-1)th stair or from(n-2)th stair. Hence, for each stair n, we try to find out the number of ways to reach n-1th stair and n-2th stair and add them to give the answer for the nth stair. Therefore the expression for such an approach comes out to be :
ways(n) = ways(n-1) + ways(n-2).

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
3 rounds | 6 problems
Interviewed by Tata Consultancy Services (TCS)
1583 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