Katkat

Find returning users from access logs

AmazonSoftware Engineer · Onsite

Last updated

This question evaluates skills in time-series data processing, timestamp parsing and time-zone normalization, scalable stream or batch handling for logs that exceed memory, algorithmic complexity analysis, and test-case design for edge conditions such as midnight boundaries and duplicate events.

Given an unordered log of web access events, identify which users are returning (i.e., they have visited on at least two different calendar days). Each event is a tuple (user_id, timestamp_iso 8601). Output the set of user_ids that meet the criterion. Address:

  1. parsing and time-zone normalization;
  2. handling large logs that don't fit in memory;
  3. algorithmic complexity;
  4. test cases including edge cases near midnight and duplicate events.