Code360 powered by Coding Ninjas X Naukri.com. Code360 powered by Coding
Ninjas X Naukri.com

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

Tata Consultancy Services (TCS)

2 rounds | 7 Coding
problems

Preparation

Duration: 2 Months

Topics: Data Structures, Python, Operating System, Algorithms, DBMS

Tip

Tip 1 : learn basics

Tip 2 : learn any oops language and practice.

Tip 3 : code as much as you can.

Application process

Where: Other

Eligibility: Above 7 cgpa

Resume tip

Tip 1 : short and precise. Upto the point.

Tip 2 : keep few things aside from resume

01

Round

Medium

Online Coding Test

Duration360 minutes

Interview date13 Jul 2019

Coding problem6

They give you 6 hr. For 6 question but the good part is that you need to complete atleast 1 question and you are good to go.

Round will be cleared only after attempting one question and rest of the questions are for improving your rank.

```
. * .
* * *
* . *
```

```
* * *
* * *
* * *
```

```
* * *
. * .
* * *
```

```
* * *
* . *
* * *
```

```
* . *
* . *
* * *
```

```
It is guaranteed that no two constellations are overlapping.
```

```
1. Day starts with hour 1 and ends with hour â€˜DAY_HOURSâ€™.
2. Each hour of the prime group should be in a different part of the day.
3. If there is no prime group then return zero.
4. â€˜DAY_HOURSâ€™ should be divisible by â€˜PARTSâ€™, meaning that the number of hours per part (DAY_HOURS/PARTS) should be a natural number.
```

```
Let â€˜DAY_HOURSâ€™ = 20 and â€˜PARTSâ€™ = 2
Hence the view of our day would be in the following format:
1 2 3 4 5 6 7 8 9 10 - Part 1
11 12 13 14 15 16 17 18 19 20 - Part 2
1-11 Not a prime group because 1 is not prime.
2-12 Not a prime group because 12 is not prime.
3-13 Because both 3 and 13 are prime, it is an equivalent prime group.
4-14 Not a prime group because 4 and 14 are not prime.
5-15 Not a prime group because 15 is not prime.
6-16 Not a prime group, because 6 and 16 are not prime.
7-17 Because both 7 and 17 are prime, it is an equivalent prime group.
8-18 Not a prime group, because 8 and 18 are, is not prime.
9-19 Not a prime group because 9 is not prime.
10-20 Not a prime group because both 10 and 20 are not prime.
Hence there are 2 equivalent prime groups in the above format which are 3-13 and 7-17.
```

```
Given 'N' : 5 (number of packets) and 'M' : 3 (number of students)
```

```
And chocolates in each packet is : {8, 11, 7, 15, 2}
All possible way to distribute 5 packets of chocolates among 3 students are -
( 8,15, 7 ) difference of maximum-minimum is â€˜15 - 7â€™ = â€˜8â€™
( 8, 15, 2 ) difference of maximum-minimum is â€˜15 - 2â€™ = â€˜13â€™
( 8, 15, 11 ) difference of maximum-minimum is â€˜15 - 8â€™ = â€˜7â€™
( 8, 7, 2 ) difference of maximum-minimum is â€˜8 - 2â€™ = â€˜6â€™
( 8, 7, 11 ) difference of maximum-minimum is â€˜11 - 7â€™ = â€˜4â€™
( 8, 2, 11 ) difference of maximum-minimum is â€˜11 - 2â€™ = â€˜9â€™
( 15, 7, 2 ) difference of maximum-minimum is â€˜15 - 2â€™ = 13â€™
( 15, 7, 11 ) difference of maximum-minimum is â€˜15 - 7â€™ = â€˜8â€™
( 15, 2, 11 ) difference of maximum-minimum is â€˜15 - 2â€™ = â€˜13â€™
( 7, 2, 11 ) difference of maximum-minimum is â€˜11 - 2â€™ = â€˜9â€™
Hence there are 10 possible ways to distribute â€˜5â€™ packets of chocolate among the â€˜3â€™ students and difference of combination (8, 7, 11) is â€˜maximum - minimumâ€™ = â€˜11 - 7â€™ = â€˜4â€™ is minimum in all of the above.
```

```
You canâ€™t decrease a number below 0.
```

```
You are given â€˜Kâ€™ = 5, and matrix
â€˜matâ€™ = [[1, 2, 3],
[4, 0, 5],
[2 , 7, 4]]
You can do 3 operations on element 7 and 2 operations on element 5. Then the sum of all submatrices will be 246.
```

```
Each pair should be sorted i.e the first value should be less than or equals to the second value.
Return the list of pairs sorted in non-decreasing order of their first value. In case if two pairs have the same first value, the pair with a smaller second value should come first.
```

02

Round

Easy

HR Round

Duration20 Minutes

Interview date3 Aug 2019

Coding problem1

What are your aspirations.

What is your biggest achievement.

Willing to relocate?

Here's your problem of the day

Solving this problem will increase your chance to get selected in this company

Suppose list1 is [2, 133, 12, 12], what is max(list1) in Python?

Choose another skill to practice

Start a Discussion

Similar interview experiences

Associate Software Engineer

2 rounds | 2 problems

Interviewed by Tata Consultancy Services (TCS)

4264 views

1 comments

0 upvotes

Associate Software Engineer

2 rounds | 3 problems

Interviewed by Tata Consultancy Services (TCS)

1772 views

0 comments

0 upvotes

Associate Software Engineer

2 rounds | 4 problems

Interviewed by Tata Consultancy Services (TCS)

847 views

0 comments

0 upvotes

Associate Software Engineer

3 rounds | 4 problems

Interviewed by Tata Consultancy Services (TCS)

122 views

0 comments

0 upvotes

Companies with similar interview experiences

Associate Software Engineer

4 rounds | 5 problems

Interviewed by Accenture

3258 views

0 comments

0 upvotes

Associate Software Engineer

3 rounds | 2 problems

Interviewed by Ernst & Young (EY)

1697 views

0 comments

0 upvotes

Associate Software Engineer

3 rounds | 15 problems

Interviewed by Ernst & Young (EY)

1704 views

0 comments

0 upvotes