You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Understand what the interviewer is asking for by using test cases and questions about the problem.
What if the products list is empty?
In this case, return an empty list.
What if no products need to be restocked?
In this case you would also return an empty list.
What should my code do if an item quantity is exactly equal to the restock threshold?
In this case, consider the item stocked and do not include it in your output.
P-lan
Plan the solution with appropriate visualizations and pseudocode.
General Idea: Loop through each product, and make a list of any products with quantity below the threshold.
1) If products is empty, return an empty list
2) Restock list starts empty
3) For each product and quantity:
a) If quantity < threshold, add to restock list
4) Return restock list