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

Associate Software Engineer

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

Interview preparation journey

expand-icon
Preparation
Duration: 2 Months
Topics: Data Structures, Python, Operating System, Algorithms, DBMS
Tip
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
Resume tip

Tip 1 : short and precise. Upto the point.
Tip 2 : keep few things aside from resume

Interview rounds

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.

1. Constellation

Easy
10m average time
90% success
0/40
Asked in companies
Tata Consultancy Services (TCS)Samsung R&D Institute

Given a matrix ‘UNIVERSE’ with 3 rows and ‘N’ columns, with the characters { # , * , . } and these characters represent a cluster of stars and galaxies in space. Stars are represented by ‘*’ symbol. The ‘.’ symbol represents empty space.


We define a constellation as a 3x3 matrix which contains stars in the shape of vowels. A group of constellations is defined as a galaxy. Note that a galaxy may contain many stars but they will never be overlapping. Two galaxies are separated by a column of ‘#’.


Given the ‘UNIVERSE’ matrix, print a string which denotes all the vowels formed by stars and ‘#’ present in the matrix.


A looks like this :
. * .
* * *
* . *
E looks like this :
* * *
* * *
* * *
I looks like this :
* * *
. * .
* * *
O looks like this :
* * *
* . *
* * *
U looks like this :
* . *
* . *
* * *


Note :
It is guaranteed that no two constellations are overlapping.


Try solving now

2. Prime Time Again

Moderate
25m average time
60% success
0/80
Asked in companies
Tata Consultancy Services (TCS)InfosysTata Consultancy Services (TCS)

You have been given two integers ‘DAY_HOURS’ and ‘PARTS’. Where ‘DAY_HOURS’ is the number of hours in a day and a day can be divided into ‘PARTS’ equal parts. Your task is to find total instances of equivalent prime groups. Prime group refers to the group of elements (hours) which are prime and measure the same equivalent time since the start of the day.

For example, if we consider ‘DAY_HOURS’ to be 24 and ‘PARTS’ to be 2, then the day of total 24 hours is divided into 2 parts ( 1 - 12 ) and ( 13 - 24 ). 5 hours in the first part of the day is equivalent to 17, which is 5 hours into the second part of the day. And since 5 and 17 both are prime, they can be considered as a prime group.

Note:
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.

Example:

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.
Try solving now

3. Chocolate Problem

Moderate
15m average time
85% success
0/80
Asked in companies
AdobePaytm (One97 Communications Limited)JP Morgan

Given an array/list of integer numbers 'CHOCOLATES' of size 'N', where each value of the array/list represents the number of chocolates in the packet. There are ‘M’ number of students and the task is to distribute the chocolate to their students. Distribute chocolate in such a way that:

1. Each student gets at least one packet of chocolate.

2. The difference between the maximum number of chocolate in a packet and the minimum number of chocolate in a packet given to the students is minimum.

Example :

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

subsequence

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.
Try solving now

4. Minimise Sum

Hard
45m average time
60% success
0/120
Asked in companies
Tata Consultancy Services (TCS)Intuit

You are given a matrix of ‘N’ rows and ‘M’ columns and a non-negative integer ‘K’. You have to find the minimum possible sum of all elements in each submatrix after performing most ‘K’ decrements.

Note:
You can’t decrease a number below 0.
For example:
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.
Try solving now

5. Minimum Number of Platform Needed

Easy
23m average time
85% success
0/40
Asked in companies
IBMBarclaysThought Works

You are given the arrival and departure times of N trains at a railway station in a day. You need to find the minimum of platforms required for the railway station such that no train waits i.e No train should wait for the platform to be clear or free.

Try solving now

6. Pair Sum

Easy
15m average time
90% success
0/40
Asked in companies
OpenTextPhone PeGoogle

You are given an integer array 'ARR' of size 'N' and an integer 'S'. Your task is to return the list of all pairs of elements such that each sum of elements of each pair equals 'S'.

Note:

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.
Try solving now
02
Round
Easy
HR Round
Duration20 Minutes
Interview date3 Aug 2019
Coding problem1

1. Basic HR Questions

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

Skill covered: Programming

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

Choose another skill to practice
Start a Discussion
Similar interview experiences
company logo
Associate Software Engineer
2 rounds | 2 problems
Interviewed by Tata Consultancy Services (TCS)
4264 views
1 comments
0 upvotes
company logo
Associate Software Engineer
2 rounds | 3 problems
Interviewed by Tata Consultancy Services (TCS)
1772 views
0 comments
0 upvotes
company logo
Associate Software Engineer
2 rounds | 4 problems
Interviewed by Tata Consultancy Services (TCS)
847 views
0 comments
0 upvotes
company logo
Associate Software Engineer
3 rounds | 4 problems
Interviewed by Tata Consultancy Services (TCS)
122 views
0 comments
0 upvotes
Companies with similar interview experiences
company logo
Associate Software Engineer
4 rounds | 5 problems
Interviewed by Accenture
3258 views
0 comments
0 upvotes
company logo
Associate Software Engineer
3 rounds | 2 problems
Interviewed by Ernst & Young (EY)
1697 views
0 comments
0 upvotes
company logo
Associate Software Engineer
3 rounds | 15 problems
Interviewed by Ernst & Young (EY)
1704 views
0 comments
0 upvotes