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

SDE - 2

Walmart
upvote
share-icon
3 rounds | 5 Coding problems

Interview preparation journey

expand-icon
Preparation
Duration: 3 Months
Topics: Data Structures, Algorithms, OOPs, DBMS, SQL, Web Development
Tip
Tip

Tip 1 : Do not rush into things. Learning takes time. Focus should be on the concepts and not just on leaving topics half-prepared. Devote 70% of both time and effort to DSA. I solved a total of around 500 questions on sites like GFG and Leetcode. Do not repeat similar questions just to increase the count of the number of questions

Tip 2 : Competitive Programming is a bonus and not a necessity, rather focus on core DSA based problems before trying CP. Do not pursue CP if you do not like it. Devote that extra time to core CS subjects and aptitude preparation.

Tip 3 : Projects play an important role too, do no ignore them. Try to get your hands dirty with a little bit of every field i.e., frontend, backend, and database.

Application process
Where: Campus
Eligibility: Above 7.5 CGPA in college
Resume Tip
Resume tip

Tip 1 : Try to make a single-page resume. Highlight skills, projects, and work experience more than CGPA. Ensure proper spacing and font to maintain professionalism.

Tip 2 : Does not lie on a resume. Everything written on your resume must be known by you in and out.

Interview rounds

01
Round
Medium
Video Call
Duration45 Minutes
Interview date6 Jul 2022
Coding problem1

MCQ Challenge was to test basic computer fundamentals. The quiz had 30 questions to be attempted in 25 minutes consisting questions related to Data structures and algorithm, OOPS, OS, DBMS and some questions to find the output of Java Program.

1. Maximum Depth Of A Binary Tree

Easy
15m average time
85% success
0/40
Asked in companies
FacebookTata Consultancy Services (TCS)Walmart

You are given the root node of a binary tree with N nodes, whose nodes have integer values. Your task is to find the maximum depth of the given Binary tree.

Depth of a binary tree is the same as its height. In simpler terms, you have to find the total number of nodes encountered while moving from the root node to the farthest leaf node, along the longest path of the binary tree.

Example:-

example

If we are given the above binary tree as input then moving from root node(5) to the farthest leaf node(50), the path formed will be [ 5->10->25->35->40->45->50 ]. The total number of nodes encountered is 7, therefore the maximum depth of the binary tree is 7.
Problem approach

You are given the root node of a binary tree with N nodes, whose nodes have integer values. Your task is to find the maximum depth of the given Binary tree.
Depth of a binary tree is the same as its height. In simpler terms, you have to find the total number of nodes encountered while moving from the root node to the farthest leaf node, along the longest path of the binary tree.

Try solving now
02
Round
Easy
Video Call
Duration45 Minutes
Interview date6 Jul 2022
Coding problem2

1. Maximum In Sliding Windows Of Size K

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

Given an array/list of integers of length ‘N’, there is a sliding window of size ‘K’ which moves from the beginning of the array, to the very end. You can only see the ‘K’ numbers in a particular window at a time. For each of the 'N'-'K'+1 different windows thus formed, you are supposed to return the maximum element in each of them, from the given array/list.

Problem approach

Given an array/list of integers of length ‘N’, there is a sliding window of size ‘K’ which moves from the beginning of the array, to the very end. You can only see the ‘K’ numbers in a particular window at a time. For each of the 'N'-'K'+1 different windows thus formed, you are supposed to return the maximum element in each of them, from the given array/list.

Try solving now

2. String Transformation

Moderate
23m average time
0/80
Asked in companies
WalmartSprinklrAccenture

Given a string (STR) of length N, you have to create a new string by performing the following operation:

Take the smallest character from the first 'K' characters of STR, remove it from STR and append it to the new string.

You have to perform this operation until STR is empty.

 Note:
The input string(STR) will not contain any spaces.

Assume that all characters in STR are lower case letters.

If characters less than 'K' remain, then append them in a sorted way to the new string.
Example:
Let the input string be "edcba" with K = 4.

Let the new string to be formed is initially empty, newString = "".
The first set of 4 characters are, ('e', 'd', 'c', 'b')
Out of these 4 characters, the smallest one is 'b' and hence we add it to the newString and it becomes, 
newString = "b"

The next set of 4 characters are, ('e', 'd', 'c', 'a')
Out of these 4 characters, the smallest one is 'a' and hence we add it to the newString and it becomes, 
newString = "ba"

Now we are left with "edc" and since we can't get a window of size 4, we sort them in the increasing order and append them to the newString.

Hence, newString thus formed will be "bacde".
Problem approach

Given a string (STR) of length N, you have to create a new string by performing the following operation:
Take the smallest character from the first 'K' characters of STR, remove it from STR and append it to the new string.

Try solving now
03
Round
Easy
Video Call
Duration45 minutes
Interview date6 Jul 2022
Coding problem2

1. Maximum Number

Easy
15m average time
85% success
0/40
Asked in companies
FacebookWalmartJP Morgan

You are given an array of N elements. This array represents the digits of a number. In an operation, you can swap the value at any two indices. Your task is to find the maximum number by using operation at most once.

For Example :

Input array [1,3,2,7] so basically this array represents the number 1327.
All the possible combinations are :
1. [3 1 2 7] get by swapping indices 1 and 2.
2. [2 3 1 7] get by swapping indices 1 and 3.
3. [7 3 2 1] get by swapping indices 1 and 4.
4. [1 2 3 7] get by swapping indices  2 and 3.
5. [1 7 2 3] get by swapping indices 2 and 4.
6. [1 3 7 2] get by swapping indices 3 and 4.
Out of all the possible combinations, 3 give the maximum number as 7321, so we will return [7 3 2 1].

Note :

The input may have 0 before the most significant digit. e.g. [0,3,5,7] is a valid input and this represents number 357.
Problem approach

You are given an array of N elements. This array represents the digits of a number. In an operation, you can swap the value at any two indices. Your task is to find the maximum number by using operation at most once.

Try solving now

2. Equilibrium Index

Easy
0/40
Asked in companies
GoogleAmazonWalmart

You are given an array Arr consisting of N integers. You need to find the equilibrium index of the array.

An index is considered as an equilibrium index if the sum of elements of the array to the left of that index is equal to the sum of elements to the right of it.

Note:

1. The array follows 0-based indexing, so you need to return the 0-based index of the element.
2. Note that the element at the equilibrium index won’t be considered for either left sum or right sum.
3. If there are multiple indices which satisfy the given condition, then return the left-most index i.e if there are indices i,j,k…. which are equilibrium indices, return the minimum among them
4. If no such index is present in the array, return -1.
Problem approach

You are given an array Arr consisting of N integers. You need to find the equilibrium index of the array.
An index is considered as an equilibrium index if the sum of elements of the array to the left of that index is equal to the sum of elements to the right of it.

Try solving now

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 create a function in JavaScript?

Choose another skill to practice
Start a Discussion
Similar interview experiences
company logo
SDE - 2
3 rounds | 6 problems
Interviewed by Walmart
2086 views
1 comments
0 upvotes
company logo
SDE - 2
4 rounds | 4 problems
Interviewed by Walmart
1315 views
1 comments
0 upvotes
company logo
SDE - 2
4 rounds | 13 problems
Interviewed by Walmart
1499 views
0 comments
0 upvotes
company logo
SDE - 2
2 rounds | 7 problems
Interviewed by Walmart
877 views
1 comments
0 upvotes
Companies with similar interview experiences
company logo
SDE - 2
3 rounds | 5 problems
Interviewed by Amazon
5202 views
0 comments
0 upvotes
company logo
SDE - 2
6 rounds | 8 problems
Interviewed by Amazon
3706 views
0 comments
0 upvotes
company logo
SDE - 2
4 rounds | 7 problems
Interviewed by Dunzo
2465 views
0 comments
0 upvotes