TCS interview experience Real time questions & tips from candidates to crack your interview

SDE - 1

TCS
upvote
share-icon
2 rounds | 2 Coding problems

Interview preparation journey

expand-icon
Preparation
Duration: 3 months
Topics: Data Structures, C++, JAVA, Divide & Conquer algorithm, Backtracking
Tip
Tip

Tip 1 : Clear basics as mostly they will ask related to it.
Tip 2 : Practice on the coding platform.
Tip 3 : Clear concept of java basics like strings & functions. specifically focused on the industry approach to complex problems.
Tip 4 : During final year or before interview try to develop at least 2 projects.

Application process
Where: Linkedin
Eligibility: Need hands on projects, and need to have above 7 CGPA.
Resume Tip
Resume tip

Tip 1 : Add your live projects at least 2 (if the project is live then do not forget to add the GitHub repository)
Tip 2 : Try to add a research paper.
Tip 3 : Try to add achievements if participated in a hackathon or ideation kind of thing.

Interview rounds

01
Round
Easy
Online Coding Interview
Duration20 minutes
Interview date10 Feb 2021
Coding problem1

Containing 10 MCQ + 10 Coding MCQ Questions.

1. Reverse Words In A String

Easy
10m average time
90% success
0/40
Asked in companies
Thought WorksFacebookApple

You are given a string 'str' of length 'N'.


Your task is to reverse the original string word by word.


There can be multiple spaces between two words and there can be leading or trailing spaces but in the output reversed string you need to put a single space between two words, and your reversed string should not contain leading or trailing spaces.


Example :
If the given input string is "Welcome to Coding Ninjas", then you should return "Ninjas Coding to Welcome" as the reversed string has only a single space between two words and there is no leading or trailing space.
Problem approach

def str_reverse(text):
Step1: ''' function to reverse the words in a string '''

Step2: split text on spaces and store in a list
lst = text.split(sep=' ')

Step3: step through the list in reverse order
rev = lst[::-1]

Step4: join the reversed list with a space between words to produce a final string
return ' '.join(rev)

print(str_reverse('Hello world'))

Try solving now
02
Round
Medium
Face to Face
Duration30 Minutes
Interview date8 Apr 2021
Coding problem1

It was around 40 minutes round. In that interview round, he asked me about the basics of data structure and algorithms then asked me some situation-based questions, and then provided me with some basic reverse string-based questions.

1. Missing Number

Moderate
30m average time
70% success
0/80
Asked in companies
SamsungFacebookApple

How to find the missing number in a given integer array of 1 to 100?

Problem approach

import java.util.Arrays;
import java.util.BitSet;

public class MissingNumberInArray {

public static void main(String args[]) {

// one missing number
printMissingNumber(new int[]{1, 2, 3, 4, 6}, 6);

// two missing number
printMissingNumber(new int[]{1, 2, 3, 4, 6, 7, 9, 8, 10}, 10);

// three missing number
printMissingNumber(new int[]{1, 2, 3, 4, 6, 9, 8}, 10);

// four missing number
printMissingNumber(new int[]{1, 2, 3, 4, 9, 8}, 10);

// Only one missing number in array
int[] iArray = new int[]{1, 2, 3, 5};
int missing = getMissingNumber(iArray, 5);
System.out.printf("Missing number in array %s is %d %n", 
Arrays.toString(iArray), missing);
}
/**
* A general method to find missing values from an integer array in Java.
* This method will work even if array has more than one missing element.
*/
private static void printMissingNumber(int[] numbers, int count) {
int missingCount = count - numbers.length;
BitSet bitSet = new BitSet(count);

for (int number : numbers) {
bitSet.set(number - 1);
}

System.out.printf("Missing numbers in integer array %s, with total number %d is %n",
Arrays.toString(numbers), count);
int lastMissingIndex = 0;

for (int i = 0; i < missingCount; i++) {
lastMissingIndex = bitSet.nextClearBit(lastMissingIndex);
System.out.println(++lastMissingIndex);
}

}

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

How do you remove whitespace from the start of a string?

Choose another skill to practice
Similar interview experiences
SDE - 1
3 rounds | 6 problems
Interviewed by TCS
1607 views
0 comments
0 upvotes
SDE - 1
2 rounds | 4 problems
Interviewed by TCS
0 views
0 comments
0 upvotes
SDE - 1
2 rounds | 3 problems
Interviewed by TCS
1260 views
0 comments
0 upvotes
SDE - 1
2 rounds | 10 problems
Interviewed by TCS
1294 views
0 comments
0 upvotes
Companies with similar interview experiences
company logo
SDE - 1
5 rounds | 12 problems
Interviewed by Amazon
115096 views
24 comments
0 upvotes
company logo
SDE - 1
4 rounds | 5 problems
Interviewed by Microsoft
58237 views
5 comments
0 upvotes
company logo
SDE - 1
3 rounds | 7 problems
Interviewed by Amazon
35146 views
7 comments
0 upvotes