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

Associate Professional

TCS
upvote
share-icon
2 rounds | 3 Coding problems

Interview preparation journey

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

Tip 1 : Prepare from interview bit
Tip 2 : Practice as much as you can specially topics likes arrays and strings
Tip 3 : Learn theory of OOPS, DBMS and do atleast 2 projects

Application process
Where: Other
Eligibility: 60% in Graduation
Resume Tip
Resume tip

Tip 1 : Have some projects on your resume
Tip 2 : Have some certifications and be true to your resume

Interview rounds

01
Round
Medium
Online Coding Interview
Duration35 minutes
Interview date30 Sep 2021
Coding problem2

It was in the morning from 9 to 12
It was conducted in an online mode

1. Rotate array

Easy
25m average time
80% success
0/40
Asked in companies
Deutsche BankIBMSalesforce

Given an array 'arr' with 'n' elements, the task is to rotate the array to the left by 'k' steps, where 'k' is non-negative.


Example:
'arr '= [1,2,3,4,5]
'k' = 1  rotated array = [2,3,4,5,1]
'k' = 2  rotated array = [3,4,5,1,2]
'k' = 3  rotated array = [4,5,1,2,3] and so on.
Problem approach

import java.util.*;
public class Main
{
static int[] rotate(int nums[], int n, int k) {

if (k > n)
k = k % n;

int[] ans = new int[n];

for (int i = 0; i < k; i++) {
ans[i] = nums[n - k + i];
}

int index = 0;
for (int i = k; i < n; i++) {
ans[i] = nums[index++];
}
return ans;
}
public static void main(String[] args) {
int Array[] = { 1, 2, 3, 4, 5 };
int N = 5;
int K = 2;

int[] ans = rotate(Array, N, K);
for (int i = 0; i < N; ++i) {
System.out.println(ans[i]);
}
}
}

Try solving now

2. No Repeated Digits

Moderate
20m average time
80% success
0/80
Asked in companies
TCSTCS

Elon is a kid who just started learning about numbers, but he always gets afraid when he sees a number with repeated digits, as it becomes hard for him to remember it as it has the same digits repeating again.

So his teacher, knowing of his fear, gave him ‘N’ tasks to cheer him up, for each task Elon have to count the numbers that have no repeated digits in a given range of [‘L’, ‘R’]. The tasks are given by a 2d array ‘TASKS’.

But Elon is again afraid that while counting he may encounter a number with repeated digits, being his friend he asked you to help him. Can you help Elon to find the count of numbers having no repeated digits in the given range for each task?.

NOTE: Both ‘L’ and ‘R’ are included in the range.

Example :
Input: ‘N’ = 1, ‘TASKS = [ [1, 20] ]

Output: 19
For the first task, the given range consists of 20 numbers present out of which ‘11’ is the only number that has repeated occurrences of ‘1’ in its decimal representation.
Problem approach

import java.util.*;
public class Main
{
static int find(int n1, int n2) {
int count = 0;
for (int i = n1 ; i <= n2 ; i++) {
int num = i;

boolean[] visited = new boolean[10];

while (num > 0) {
if (visited[num % 10] == true)
break;
visited[num % 10] = true;
num /= 10;
}

if (num == 0)
count++;
}
return count;
}
public static void main(String[] args) {
int n1 = 101, n2 = 200;
System.out.println(find(n1, n2));
}
}

Try solving now
02
Round
Easy
HR Round
Duration10 minutes
Interview date4 Oct 2021
Coding problem1

1. Basic HR Questions

  • What are your strengths and weakness?
  • Why should we hire you?

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
2 rounds | 4 problems
Interviewed by TCS
0 views
0 comments
0 upvotes
Digital Technology Intern
2 rounds | 2 problems
Interviewed by TCS
845 views
0 comments
0 upvotes
Assistant System Engineer
3 rounds | 7 problems
Interviewed by TCS
953 views
0 comments
0 upvotes
TCS Ninja
3 rounds | 5 problems
Interviewed by TCS
1052 views
0 comments
0 upvotes
Companies with similar interview experiences
company logo
Associate Professional
3 rounds | 3 problems
Interviewed by CIS - Cyber Infrastructure
528 views
0 comments
0 upvotes
company logo
Associate Professional
4 rounds | 6 problems
Interviewed by CIS - Cyber Infrastructure
0 views
0 comments
0 upvotes
company logo
Associate Professional
3 rounds | 9 problems
Interviewed by CIS - Cyber Infrastructure
502 views
0 comments
0 upvotes