Pregunta de entrevista de Amazon

Whiteboard coding test - Write two methods. Method 1 - stores order data(customer id, product id) Method 2 - Returns product with maximum orders.

Respuesta de la entrevista

Anónimo

11 feb 2025

Method 1: Store the order list in a thread-safe dictionary with the productid as key and the value - number of times order was placed. Method 2: Return the key of the dictionary which has the highest value.