# Walmart Interview Experience for SDE | On- Campus 2021 (Virtual)

Walmart Global Tech visited our campus in the month of August, to hire students for the Software Development Engineer role.

Initially, there was a CGPA based shortlisting, after which around 250 students were selected to attend the Online Assessment.

** Online Assessment: **The platform was HackerEarth, time duration was 1 hour

- 10 technical MCQs, belonging to OOPS, OS, DBMS, Networks, and SQL
- 2 coding questions of medium-hard level

Coding Questions were:

- You are given two strings A and B that are made of lowercase English alphabets. Find the number of different pairs ((i,j), (k,l)) such that the substrings A[i…j] and B[k…l] are equal and the value of j-i+1 is minimum.

## C++

`// Solution to Q1`

`int`

`smallest_common_substrings(string A, string B) {`

`char`

`freq[256] = {0};`

`for`

`(`

`char`

`c : A) {`

`freq++;`

`}`

`int`

`sum = 0;`

`for`

`(`

`char`

`c : B) {`

`sum += freq;`

`}`

`return`

`sum;`

`}`

- Given an array of N items a1,a2…..an

Given two integers K and X. Where K denotes the maximum number of jumps you can take in either direction that is from the position i, you can jump to position j in one step only if abs(j-i) <= K and 1<=j<=n.

Jumping from i to j and will cost X amount if a[i] = a[j].

Find minimum cost to reach position N from position 1.

## C++

`//Solution to Q2`

`#include <bits/stdc++.h>`

`using`

`namespace`

`std;`

`int`

`solve(vector<`

`int`

`> &arr,`

`int`

`n,`

`int`

`k,`

`int`

`x)`

`{`

`vector<`

`int`

`> dptable(n, INT_MAX);`

`dptable[0] = 0;`

`for`

`(`

`int`

`i = 0; i < n; i++)`

`{`

`for`

`(`

`int`

`j = max(0, i - k); j <= min(n - 1, i + k); j++)`

`{`

`if`

`(dptable[j] > dptable[i] + (arr[j] == arr[i] ? 0 : x))`

`{`

`dptable[j] = dptable[i] + (arr[j] == arr[i] ? 0 : x);`

`}`

`}`

`}`

`return`

`dptable[n - 1];`

`}`

`int`

`main()`

`{`

`ios_base::sync_with_stdio(0);`

`cin.tie(NULL);`

`int`

`n;`

`cin >> n;`

`vector<`

`int`

`> arr(n);`

`for`

`(`

`auto`

`&x : arr)`

`cin >> x;`

`int`

`k, x;`

`cin >> k >> x;`

`cout << solve(arr, n, k, x);`

`return`

`0;`

`}`

Was able to pass all test cases of both the problems, students with 1 total and 1 partial solution also made it to the next round.

33 were selected for the next round.

__Round 1(Techincal Interview 1): 45- 50 min__

- This round was a technical interview conducted over Zoom.
- The interviewer first introduced himself, he was an SDE 3(backend) and had 10 years of experience in the IT field and was working with Walmart for quite some time. I was not asked to code any problem in this round, it focused more on core CSE subjects.
- I was asked to introduce myself and then we went straight to the technical questions.

He gave me a google docs link which I could use to explain answers to him.

- There are 2 machines and the first machine wants to send a message to the other. Explain in detail how the communication takes place. I explained everything about the OSI and TCP/IP model, the working of each layer in transmitting data, 3-way handshaking protocol to establish connections. He was satisfied with my answer.
- Was about the implementation of STL, he asked me if I am given an unordered set of n numbers, how will I change it to an ordered set without using a sorting algorithm. I told him that we can make a BST of the given unordered set and then do inorder traversal of the tree to get an ordered set of the elements. I explained my approach on the google doc.

He was satisfied and didn’t ask me to code it. - Given a sorted array, with 1 repeating number find the number. I gave him the simple o(n) solution, after which he asked me to make my solution
**more complex(yes, more complex)**it was very odd and interesting at the same time for an interviewer to ask me to make my solution more complex, the interviewer was very polite and we had a good discussion on it. - Various questions on Threading, Paging and Segmentation were asked. The interview went for about 50 minutes, at the end he asked whether I had any questions for him, I asked about his day-to-day responsibilities at Walmart, which he answered in a very informative and polite manner.

25 were selected for the next round.

**Tips: Prepare the core subjects very well since they are equally as important as DSA and ask good and meaningful questions to the interviewer at the end of the interview.**

__Round 2(Technical Interview 2): 1 hour__

Conducted over zoom. The interviewer was a Senior Data Scientist at Walmart and he told me initially that this would be a coding round. Before moving on to the coding questions, we had a good discussion about my projects since my resume was primarily data science-based.

Few questions I was asked

- How is LSTM better than simple RNN? Explained about the vanishing gradient problem, explained the mathematics behind it, was satisfied.
- Why did you use Random Forest Algorithm in one of your projects? Explained the pros of Random Forest, its working, how is it different from a decision tree.
- What is relative feature importance and partial dependent plots? Had used it in one of my projects so explained it to him, was satisfied.
- What is the bias-variance trade-off and how can Random Forest be used to solve personalization problems? Then he moved onto the coding questions, he asked me to open my favorite IDE and code.
- Pattern printing question: https://practice.geeksforgeeks.org/problems/pascal-triangle0652/1. Identified that it was a pascal’s triangle, explained the logic to him, then he asked me to code it while sharing my screen.

The code ran successfully, he was satisfied. - Finding a loop in the linked list: https://practice.geeksforgeeks.org/problems/detect-loop-in-linked-list/1. Wasn’t asked to code this, only needed to explain the approach to him, gave him the brute force approach, then used maps to reduce the complexity, he was satisfied with O(n) time and O(n) space complexity (PS: it can be solved in O(1) space as well)
- Write a function that has an equal probability of printing YES and NO. Gave him the idea of rand() in C++, he then followed up by making the probability of printing YES as 25% and then 10%. Suggested some tweaks in the rand() function, he was satisfied.

The interview went for about 1 hour, at the end he asked whether I had any questions for him, I asked about his day-to-day responsibilities at Walmart as a Data Scientist, which he answered in a very informative and polite manner.

**Tips: Make sure you can stand up for everything you have written on your resume because the interviewer will go deep into your projects and internships.**

**Round 3(Hiring Manager/HR Round): 1 hr**

- I was asked to stay after my technical round and about 10 minutes later I had this round, I was informed it was my final round.
- The interviewer first asked me to introduce myself, he then asked some questions based on my resume, my experience about my first hackathon win, why did I do the ML certification which I stated in my resume.

He asked me what according to me what is the most important quality in a leader. - Then we had a good and long discussion about Walmart, innovations at Walmart, any recent technology which Walmart was working on.
- He also asked some technical questions like what is Cloud, what is the difference between Public and Private Clouds?
- I asked him about the various teams working at Walmart.
- All in all, we had a very good discussion, the interview went for about an hour, he then wished me luck and asked me to look out for any updates from my placement cell.

Results were announced the next day, 16 students were selected as FTEs, and 7 were selected as interns which could be converted to FTE based on performance.

I was selected as one of the FTEs ðŸ™‚

**Tips: Make sure you research everything about the company which you have applied for, use GFG for regular practice for DSA and also for the Core Subjects.**

## Please

Loginto comment...