Wayfair | Phone | Warehouse Manager
Anonymous User
2378
Jan 18, 2020
Jan 18, 2020
After the online coding challenge on codility, a technical phone screen was scheduled with on of their tech lead. This was the following question asked.
Specification:
Create a class WarehouseManager whose API includes the following methods:
class WarehouseManager {
/**
* Add a new product to the warehouse.
*
* @param productId The product’s ID. Unique to a product but there can be multiple copies of the same product in the warehouse
* @returns The number of those products currently in the warehouse
*/
public int addProduct(int productId) {
// todo
}
/**
* Ships the given order. This requires removing the products from the warehouse.
*
* @param products A list of product IDs
* @returns Whether or not we were able to ship the order. In order to ship an order, we must have all of the products in stock.
*/
public boolean shipOrder(List<Integer> products) {
// todo
}
}It was live coding session on codility. There were a couple of questions regarding the performance of the code and optimization.
Comments (1)


