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

SDE - 1

HCL Technologies
upvote
share-icon
2 rounds | 6 Coding problems

Interview preparation journey

expand-icon
Preparation
Duration: 3 months
Topics: Data Structures, Reasoning, OOPS, System Design, Algorithms, Aptitude
Tip
Tip

Tip 1 : Solve RS Aggarwal Aptitude and Problem Solving Books.
Tip 2 : Practice Coding questions from Geeks For Geeks.

Application process
Where: Campus
Eligibility: No criteria
Resume Tip
Resume tip

Tip 1 : Mark skills with Bold letters.
Tip 2 : Mention projects on resume

Interview rounds

01
Round
Easy
Online Coding Test
Duration60 minutes
Interview date14 Jun 2022
Coding problem5

- Morning time
- Environment was good.
- No
- Interviewer was good

1. Minimum steps to reach target by a Knight

Moderate
25m average time
60% success
0/80
Asked in companies
MicrosoftIntuitGroww

You have been given a square chessboard of size ‘N x N’. The position coordinates of the Knight and the position coordinates of the target are also given.

Your task is to find out the minimum steps a Knight will take to reach the target position.

alt text

Example:
knightPosition: {3,4}
targetPosition: {2,1}

alt text

The knight can move from position (3,4) to positions (1,3), (2,2) and (4,2). Position (4,2) is selected and the ‘stepCount’ becomes 1. From position (4,2), the knight can directly jump to the position (2,1) which is the target point and ‘stepCount’ becomes 2 which is the final answer. 

Note:

1. The coordinates are 1 indexed. So, the bottom left square is (1,1) and the top right square is (N, N).

2. The knight can make 8 possible moves as given in figure 1.

3. A Knight moves 2 squares in one direction and 1 square in the perpendicular direction (or vice-versa).
Problem approach

s1 : During the 1st journey and 3rd journey Alice goes over point 5.

s2 : During the 4th Alice goes over point 11.

s3 : During the 3rd and 4th journey Alice goes over point 7.

s4 : During the 1st, 2nd, and 4th journey Alice goes over point 9.

Try solving now

2. Magic Grid

Moderate
0/80
Asked in companies
HCL TechnologiesDunzoD.E.Shaw

You are given a magic grid A with R rows and C columns. In the cells of the grid, you will either get magic juice, which increases your strength by |A[i][j]| points, or poison, which takes away |A[i][j]| strength points. If at any point of the journey, the strength points become less than or equal to zero, then you will die.

You have to start from the top-left corner cell (1,1) and reach at the bottom-right corner cell (R,C). From a cell (i,j), you can only move either one cell down or right i.e., to cell (i+1,j) or cell (i,j+1) and you can not move outside the magic grid. You have to find the minimum number of strength points with which you will be able to reach the destination cell.

Problem approach

s1 - Given a grid of size 3*3
s2 - cell (1,1) and cell (3,3) are empty.
s3 - go to :(x+1,y) , (x-1,y), (x,y+1) , (x,y-1), (x+1,y+1) , (x-1,y-1).

Try solving now

3. Keys and Rooms

Moderate
30m average time
70% success
0/80
Asked in companies
AdobeDisney + HotstarMicrosoft

You are given some information about the rooms of a military camp. The rooms are numbered from 0 to 'N-1'. Each room contains keys to some other rooms. You can visit a room only if you have a key to that room. Your task is to determine whether each room can be visited or not.

Note:

1. Room 0 is the only room that is initially unlocked and doesn’t require any key to enter.

2. Any other room can be visited only if you have the key to that room.

3. More than one room can have keys to the same room.

4. You are allowed to visit rooms in any order.

5. You can visit any room multiple times.
Problem approach

Given array
s1 - If a person starts from a
s2 - Path would be , so person took 4 steps to reach room 1

s3 - Path would be , so person took 4 steps to reach room 1

s4 - Similarly, it would give a value 4 for each case, And this is the smallest valid value.,

Try solving now

4. Friends Pairing Problem

Easy
10m average time
90% success
0/40
Asked in companies
PhonePeHCL TechnologiesGoldman Sachs

You are given an integer ‘N’, which denotes there are ‘N’ friends. You are supposed to form some pairs them satisfying the following conditions:

1. Each friend can be paired with some other friend or remain single.

2. Each friend can be a part of at most one pair.

You are supposed to find the total number of ways in which the pairing can be done satisfying both conditions. Since the number of ways can be quite large, you should find the answer modulo 1000000007(10^9+7).

Note:
1. Return the final answer by doing a mod with 10^9 + 7.
2. Pairs {A, B} and {B, A} are considered the same.
Problem approach

s1 - In the first case, the data plans cost 10rs and 5rs, With the first data plan(10rs) we can invite 1st and the 3rd friend because in the binary representation of 10 (1010) the first and the third bit are set, and with the second data plan (5rs), we can invite 0th and the 2nd friend because in the binary representation of 5(101), the 0th and the 2nd bit is set

s2 - Now with all the data plans, we could invite the 0th, 1st,2nd, and 3rd friends, but if we remove any data plans, there will be a friend who will be left. Therefore the answer is 0rs

s3 - In the second case, the cost of all the data plans is the same, so if we remove any one data plan, we will still be able to invite all the friends we invited before. Therefore the answer is 9rs

Try solving now

5. Best Meeting Point

Easy
15m average time
85% success
0/40
Asked in companies
HCL TechnologiesAmdocs

Ninja, along with his family, moved to a new city, and Ninja has no friends. He started making new friends from his school. Now he has a number of friends. His friends decided to meet in the evening, but all are confused about where to meet?

Ninja is very busy doing some other works. Can you help Ninja find a place where Ninja and all his friends can meet such that the sum of distance traveled by Ninja and his friends is the minimum possible? Find the place and print the total sum of distances traveled by Ninja and his friends.

You are given the location of Ninja and his friends in the form of a matrix. In the matrix, wherever the value is 1, it means that there is a home at that point (Ninja’s home or the home of some of his friends). Ninja and his friends can meet at any possible coordinate in the matrix, not necessarily at the home of any of the friends.

Manhattan distance is used to calculate the distance between two points, i.e, distance(a, b) = |a.x - b.x| + |a.y - b.y|, (where a.x is the x coordinate of point ‘a’, a.y is the y coordinate of point ‘a’, b.x is the x coordinate of point ‘b’, b.y is the y coordinate of point ‘b’ respectively).

Problem approach

s1 - For test case 1:
Here, if we construct a road between city 1 and 2, it will cost .
If we construct another road between city 2 and 3, it will cost . 
The total minimum cost possible is 2 + 1 = 3.

s2 - For test case 2:
Here if we construct a road between city 1 and 2, it will cost .
The total minimum cost possible is 2.

Try solving now
02
Round
Easy
HR Round
Duration10 minutes
Interview date15 Jun 2022
Coding problem1

- Morning time
- Environment was good.
- No
- Interviewer was good

1. Basic HR Questions

What is the biggest challenge you’ve faced in your current position? 

How would your co-workers describe you? 

What skills would you bring to the job? 

How do you keep up with the latest industry trends?

Problem approach

Tip 1 : Communication is must
Tip 2 : Practice more and more

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
company logo
SDE - 1
4 rounds | 6 problems
Interviewed by HCL Technologies
0 views
0 comments
0 upvotes
company logo
SDE - 1
3 rounds | 5 problems
Interviewed by HCL Technologies
1496 views
4 comments
0 upvotes
company logo
SDE - 1
2 rounds | 6 problems
Interviewed by HCL Technologies
1950 views
0 comments
0 upvotes
company logo
SDE - 1
2 rounds | 4 problems
Interviewed by HCL Technologies
2260 views
0 comments
0 upvotes
Companies with similar interview experiences
company logo
SDE - 1
2 rounds | 3 problems
Interviewed by BNY Mellon
6365 views
3 comments
0 upvotes
company logo
SDE - 1
3 rounds | 6 problems
Interviewed by BNY Mellon
0 views
0 comments
0 upvotes
company logo
SDE - 1
3 rounds | 5 problems
Interviewed by CIS - Cyber Infrastructure
2197 views
0 comments
0 upvotes