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

SDE - 1

Western Digital
upvote
share-icon
4 rounds | 6 Coding problems

Interview preparation journey

expand-icon
Journey
I started my coding journey in Class 11th in school, where I learned C++ and got a firm grasp. Then, in the first one and a half years of college, I mainly focused on the development side, like Android Development, Web Development, and Machine Learning, with little DSA on the side. Then, starting the fourth semester, I started giving all my attention to DSA & CP. I participated in a weekly coding contest. I also kept preparing for core subjects like OOPS, DBMS, OS, and CN.
Application story
The company visited our campus for placement in the month of August. They first took an online assessment round, and then further interview rounds happened after that.
Why selected/rejected for the role?
I was selected for the role because of my firm grasp of DSA, and I answered most questions correctly. Also, the projects on my resume were good and genuine, providing me with a bonus on top of the DSA questions.
Preparation
Duration: 8 months
Topics: Data Structures, Algorithms, OOPS, Operating System, DBMS, Computer Networks
Tip
Tip

Tip 1 : Practice DSA and give contests regularly.
Tip 2 : Try to participate in Competitive Programming contests.
Tip 3 : Revise core subjects like OOPS, DBMS, OS, CN thoroughly.

Application process
Where: Campus
Eligibility: 7 CGPA
Resume Tip
Resume tip

Tip 1 : Add your genuine projects and limit them to 3-4.
Tip 2 : Try to keep it simple and proofread your resume for any spelling or indentation mistakes.

Interview rounds

01
Round
Easy
Online Coding Interview
Duration60 minutes
Interview date25 Aug 2021
Coding problem2

1. Make It Palindrome

Easy
25m average time
70% success
0/40
Asked in companies
AmazonSAP LabsNagarro Software

You are given an array ‘A’ of length ‘N’ consisting only of positive integers. Your task is to make the given array a palindrome by using a minimum number of operations. In one operation, you can select two adjacent indexes and merge them by adding their values. After every operation, the length of the array decreases by one.

Note: An array of length ‘1’ is a palindrome.

For example:

Let’s say the array ‘A’ = [1, 2, 3, 4, 5], then after merging indexes 2 and 3, the array ‘A’ will look like [1, 5, 4, 5].
Problem approach

It was an easy question, but the only catch was that they expected the output only in the format that was provided.
We could just create a helper function where we get the start and end index, and we expand on both sides by decreasing the start and increasing the end till both sides have the same characters.
And in the main function, we can iterate over the string and call our function for each index twice, once for odd length, and once for even length.

Try solving now

2. Maximum AND Sum of Array

Hard
0/120
Asked in companies
HCL TechnologiesDeloitteWestern Digital

You are given an array of coins ‘COINS’ of length ‘N’ and there are ‘S’ number of slots numbered from 1 to S such that 2*S >= N.

You have to place all N coins into some slots so that no slot contains more than two coins. After placing the coins you will calculate the AND sum as the sum of all the values obtained by performing the bitwise AND operation between the slot number and the value of the coin placed in that slot number .

You have to find AND sum between the coins and the slots.

Problem approach

The problem is quite simple, there is just one observation we need to make, that the answer will always be the Yth number from starting in the sorted version of array A.

Try solving now
02
Round
Medium
Video Call
Duration60 minutes
Interview date26 Aug 2021
Coding problem1

First interview round. Apart from the one coding question I was also asked questions from OOPS, and Operating Systems.

1. Snake and Ladder

Moderate
30m average time
60% success
0/80
Asked in companies
OlaDunzoIntuit

You have been given a Snake and Ladder Board with 'N' rows and 'N' columns with the numbers written from 1 to (N*N) starting from the bottom left of the board, and alternating direction each row.

For example

For a (6 x 6) board, the numbers are written as follows:

6*6 Board

You start from square 1 of the board (which is always in the last row and first column). On each square say 'X', you can throw a dice which can have six outcomes and you have total control over the outcome of dice throw and you want to find out the minimum number of throws required to reach the last cell.
Some of the squares contain Snakes and Ladders, and these are possibilities of a throw at square 'X':
You choose a destination square 'S' with number 'X+1', 'X+2', 'X+3', 'X+4', 'X+5', or 'X+6', provided this number is <= N*N.
If 'S' has a snake or ladder, you move to the destination of that snake or ladder.  Otherwise, you move to S.
A board square on row 'i' and column 'j' has a "Snake or Ladder" if board[i][j] != -1. The destination of that snake or ladder is board[i][j].
Note :
You can only take a snake or ladder at most once per move: if the destination to a snake or ladder is the start of another snake or ladder, you do not continue moving - you have to ignore the snake or ladder present on that square.

For example, if the board is:
-1 1 -1
-1 -1 9
-1 4 -1
Let's say on the first move your destination square is 2  [at row 2, column 1], then you finish your first move at 4 [at row 1, column 2] because you do not continue moving to 9 [at row 0, column 0] by taking the ladder from 4.

A square can also have a Snake or Ladder which will end at the same cell.
For example, if the board is:
-1 3 -1
-1 5 -1
-1 -1 9
Here we can see Snake/Ladder on square 5 [at row 1, column 1] will end on the same square 5.
Problem approach

I have implement the functionality for the Snake and Ladder game, create the required classes and function (like, roll the dice, move player, handle snakes, handle ladders)

Try solving now
03
Round
Easy
Video Call
Duration90 minutes
Interview date26 Aug 2021
Coding problem2

It was the second round. Apart from one DSA and SQL question, I was also asked questions from my projects, previous internship, and CS fundamental questions also.

1. Find All Anagrams in a String

Easy
15m average time
85% success
0/40
Asked in companies
IntuitThought WorksAmerican Express

You have been given a string STR and a non-empty string PTR. Your task is to find all the starting indices of PTR’s anagram in STR.

An anagram of a string is another string which contains the same characters and is obtained by rearranging the characters.

For example: ‘SILENT’ and ‘LISTEN’ are anagrams of each other. ‘ABA’ and ‘ABB’ are not anagram because we can’t convert ‘ABA’ to ‘ABB’ by rearranging the characters of particular strings.

Note:

1. Both STR and PTR consist of English uppercase letters.
2. Length of string 'STR' will always be greater than or equal to the length of string ‘PTR’.
3. In case, there is no anagram substring, then return an empty sequence.
4. In case of more than one anagrams, return the indices in increasing order.
Problem approach

We can store the frequency of each character present in the string, and check if all characters have even frequency, apart from one character which can have odd frequency (for palindrome of odd length).

Try solving now

2. DBMS

Given two tables Customer and product, get the customer name, and product name order by first name

Problem approach

Tip 1 : Use Left Join for getting the particular records
Tip 2 : Use order by, for properly sorting the records.

SELECT Product.product_name, Customer.firstname, Customer.lastname
FROM Orders INNER JOIN
     Customers
     ON Product.id_customer=Customer.id
ORDER BY Customer.firstname;
04
Round
Easy
HR Round
Duration15 minutes
Interview date21 Aug 2021
Coding problem1

It was the third interview round and an HR round.

1. Basic HR Questions

Tell me about yourself.

Why do you want to join Western Digital?

Tell me your weaknesses and strengths.

Problem approach
  • I told the interviewer my basic introduction and my previous internship experience and skills.
  • I told him that I've always wanted to work in a big company and make a contribution to real-life projects.
  • I was honest and frank and told a few of both my weaknesses and strengths.

Here's your problem of the day

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

Skill covered: Programming

What is recursion?

Choose another skill to practice
Similar interview experiences
company logo
SDE - 1
3 rounds | 7 problems
Interviewed by OYO
4657 views
0 comments
0 upvotes
Senior Software Engineer
3 rounds | 7 problems
Interviewed by Western Digital
1385 views
0 comments
0 upvotes
company logo
SDE - 1
2 rounds | 5 problems
Interviewed by Meesho
6450 views
0 comments
0 upvotes
company logo
SDE - 1
3 rounds | 9 problems
Interviewed by Salesforce
3452 views
0 comments
0 upvotes
Companies with similar interview experiences
company logo
SDE - 1
5 rounds | 12 problems
Interviewed by Amazon
114579 views
24 comments
0 upvotes
company logo
SDE - 1
4 rounds | 5 problems
Interviewed by Microsoft
57825 views
5 comments
0 upvotes
company logo
SDE - 1
3 rounds | 7 problems
Interviewed by Amazon
34961 views
7 comments
0 upvotes