Google | Onsite | How many users are in the store (or max concurrent users online)?
Anonymous User
2031

Given a list of timestamps for people entering a store, and a list of timestamps of people exiting a store, write code to compute total number of people currently in the store at time t.

Also re-phrased as given a list of timestamps people logged on to a site, and a list of timestamps when people logged off of the site, write code to compute maximum concurrent users.

e.g.

listIn = [1,3,4,6,7,8,9,10,55,75,130]
listOut= [2,4,6,7,9,11,15,65,77,150]

return maximum numbers of users that were inside the store (or concurrently online) give the above lists. Each number represents a timestamp (could be hours, seconds or minutes). Length of the array is the time period being examined, could be day, week, month or year.

Comments (7)