Wayfair L2 Interview Experience
Anonymous User
1221

I applied on Instahyre and recruiter reached out to me and scheduled screening round via Hacker Rank.

HackerRank OA:
Q1: list the anagrams in given list of input strings for each string in the querylist.
ex: input = ["abc", "cba", "def"]
query = ["bca", "fde"]
output = [["abc","cba"],["def"]]
Q2: move through maze problem where each move from a source (0,0) can happen in all four directions (i+x,j)(i-x,j)(i, j-x)(i,j+x)) where x is a jum parameter if there are no obstacles in the way. we have to find minMoves required to reach destination.

Round 1: machine Coding round
This is little different we are given a description with all the methods to be implemented and formula(s) and conditions. The basic skeletal structure is given and we have to fill the methods.
Question: given a Package and Cargo classes implementing Ipackage and Ishipping methods respectively. the following methods needs to impelmented in the Cargo class.
-> addPackage(Ipackage pack)
-> removePackage(int: id)
-> int calculatetotalShippingCost()
->Map<String,Integer> packageList()
->Map<String, List> categoryList()

total cost can be found using the following formula.
for each package in package list => lwh = length * weight* height
cost for that package =>
lwh<=100000 : cost =10
100000<lwh<=50000: cost = 20
lwh>50000: cost = 30
Total cost = sum of calculated cost of all packages in the package list.

category can be determined based on the weight of the product. couldn't remember exact numbers but it is something like this
weight < 5 => small
5<=weight <=10 => medium
weight >10 => large

packagelist() -> should return a map with packagename,quantity
categorylist() -> should return a map with categoryname,List(packageids)

Waiting for the feedback. I got confused with the question and couldn't finish the code on time. Not expecting to clear this round as I couldn't finish coding. Time management is the key.

Hope this helps if anyone is preparing for the interview

Comments (3)