Company: Salesforce/Tableau Stage: Onsite Position: MTS

Anonymous User
782
Dec 17, 2021
Dec 18, 2021

Got this question recently in the onsite round.

We are implementing a service for photo app, to track photo views and tell you which photo ids are most viewed. Ids are simple integers. Candidates need to implement this interface.

//Called when this photo id is viewed once
void hit(int photoId);

//return the M photo ids with the most views, in order.
List mostViewed(int M);

Comments (5)