亚麻 onsite

说下记得的两题吧

第一题

Input is in <productId, timeStamp> format. So assume you have a list of productIDs and their timestamps which they were accessed:

[<product1, timestamp1>, <product2, timestamp2>, <product3, timestamp3>, …]

Find the top K products purchased in the last one hour.

第二题

Given a list of employees and their IDs as follows and the manager id is 0 for the CEO.

Such as:

Jeff, 0
John, 1
Lisa, 1
Jacob, 2
Jason, 2
David, 3

Then ask to print the following form according to the class relationship:

Jeff
     John
         Jacob
         Jason
     Lisa
         David