Question d’entretien chez Amazon

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

Réponse à la question d'entretien

Utilisateur anonyme

11 févr. 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.