[ INFO ]category: Behavioral · Onsite difficulty: difficult freq: first seen: 2018-05-26
[DIFFICULT][ONSITE]OnsiteSWE I (Entry Level)Unknown
$catproblem.md
I recently interviewed for a Software Engineer position at Walmart Labs. The interview process consisted of five rounds:
Written Test: The first round was a 90-minute online test conducted on Hackerearth. It included 10 multiple-choice questions (MCQs) and three coding questions. The MCQs covered general aptitude, networking, and programming concepts and were relatively easy. The coding questions were:
Farida (Leetcode): This was a standard dynamic programming problem. (35 marks)
Employee Arrival and Departure: Given arrival and departure times of employees in an office, find the maximum number of chairs needed so that no employee has to stand. (30 marks)
2D Matrix Traversal: Given a 2D matrix of integers, find the number of ways a person can reach a destination from a source position, moving only north, south, east, or west, and only if the destination cell has a value less than the current cell. (25 marks)
Technical Interview: This round lasted for about an hour and involved three coding questions:
Bottom View of a Binary Tree: Given a binary tree, print its bottom view. I was asked to write the code on paper. (Leetcode)
Valid Sentences from a Character Array: Given a character array and a dictionary, find the number of valid sentences that can be made by putting spaces after any character in the array. A valid sentence is one where all the words are present in the dictionary. I was asked to write the code on paper. (Leetcode)
Maximum Length Consecutive Subsequence: Given an array of random integers, find the maximum length of a subsequence where the elements are consecutive. I presented a brute force O(n^2) solution and an O(n log n) solution, but the interviewer was looking for an O(n) dynamic programming solution.
Technical Interview: This round also lasted for about an hour and involved three questions:
Frog Jumping: Given an array and a frog that can hop at most k-1 times, find the minimum number of steps to reach a given destination 'D'. I converted the problem into a graph, where each node had connections to its next k-1 nodes and also to any node with a bridge or tunnel. I then applied BFS to find the shortest path. I was asked to write the code on paper. Complexity: O(n*k)
Detect Loop in Linked List: Given a linked list with a loop, detect the loop and return the starting point of the loop. (Leetcode)
Data Structure Design: The interviewer asked me to design a data structure using basic data structures that allows searching in O(1) time in 95% of cases and more than O(1) time in 5% of cases. The element to be searched could be an integer or a string. I suggested using a hash table with chaining and a balanced BST at the collision index to achieve minimum complexity (O(log n)). The interviewer then asked about memory efficiency if only 100 elements were stored initially and then 10^6 elements after a year. I suggested allocating memory for 100 elements initially and then allocating a new array of size 10^6 and copying the elements from the original array.
Managerial Round: This was a short round of about 10-15 minutes. The interviewer asked me to introduce myself, why I wanted to join Walmart, why I didn't want to pursue higher studies, the difference between a job and a career, and what I wanted (a job or a career). I was also asked about my goals for the next five years and to briefly describe a project mentioned in my resume.
HR Round: This was also a short round of about 5-10 minutes. The HR asked me to introduce myself, my hobbies, and why I wanted to join Walmart. I was also asked where I saw myself in two years, my interest in programming, and the websites I use for coding competitions. I mentioned Codeforces, Codechef, and Hackerrank. The HR then explained the work at Walmart and asked if I would prefer working on web development (front-end and back-end) or the back-end of logistics.
Advice:
Prepare all the data structures from GeeksforGeeks, as most of the questions were from there. Think aloud during the interview, and the interviewer will help by giving hints when you get stuck.