Object-Oriented Programming · Amazon · Easy
Requirements Design and implement an ad-click counter that processes a continuous stream of click events, each given as a pair (ad_id, time). The counter must accept incoming click events. It must also answer a query for a particular ad: report how many clicks that ad received during the last k minutes, measured back from the current time. The interview did not pin down the exact operation names, the unit of the timestamps, or whether an event sitting exactly on the edge of…