Screening Round
Questions:
-
Question 1: List the anagrams in a given list of input strings for each string in the query list.
- Input:
["abc", "cba", "def"]
- Query:
["bca", "fde"]
- Output:
[["abc","cba"],["def"]]
- Input:
-
Question 2: Move through a 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 jump parameter if there are no obstacles in the way. We have to find the minimum moves required to reach the destination.
Candidate's Approach
No approach provided.
Interviewer's Feedback
No feedback provided.
Round 1: Machine Coding Round
Questions: Question: Given a Package and Cargo classes implementing Ipackage and Ishipping methods respectively. The following methods need to be implemented in the Cargo class:
addPackage(Ipackage pack)
removePackage(int: id)
int calculatetotalShippingCost()
Map<String,Integer> packageList()
Map<String, List<Integer>> categoryList()
Total cost can be found using the following formula:
- For each package in the 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:
- weight < 5 => small
- 5 <= weight <= 10 => medium
- weight > 10 => large
packageList()
should return a map with package name and quantity.
categoryList()
should return a map with category name and List(package ids).
Candidate's Approach
The candidate got confused with the question and couldn't finish the code on time. They mentioned that time management is key and are not expecting to clear this round.
Interviewer's Feedback
No feedback provided.