title: Amazon interview: Timestamp sorting: Find the three page subset sequence repeated maximum number of times
body: <p>The Amazon interview question is:</p>
  <blockquote>
  <p>Given a log file containing (User_Id, URL, Timestamp) user can navigate page from one to the other. Find the three page subset sequence repeated maximum number of times. Records are sorted by Timestamp.</p>
  </blockquote>
  <p>I found this question from <a href="http://www.reddit.com/r/cscareerquestions/comments/1vbl67/intern_impostor_syndrome_after_interview/" rel="nofollow noreferrer">this reddit thread</a>.</p>
  <p>The poster <a href="http://www.reddit.com/r/cscareerquestions/comments/1vbl67/intern_impostor_syndrome_after_interview/ceqtmk8" rel="nofollow noreferrer">wrote</a>:</p>
  <blockquote>
  <p>&quot;Given a log file containing (User_Id, URL, Timestamp) user can navigate page from one to the other. Find the three page subset sequence repeated maximum number of times. Records are sorted by Timestamp.&quot;</p>
  <p>(Although, I wasn't told until late in the interview the file is sorted by timestamp. One of the first things I had asked was if the log was sorted, and my interviewer said no.)</p>
  <p>I do think I gave it my all -- I seemed to have been on the right track using a hashmap. I always let my interview know what I was thinking and gave possible outcomes, time complexities, etc.</p>
  </blockquote>
  <p>I am not sure how to approach this problem. What does &quot;Find the three page subset sequence repeated maximum number of times&quot; mean? And if the question didn't say &quot;Records are sorted by Timestamp&quot; (as happened to the poster), then how would that affect the problem?</p>