Amazon AWS London | Virtual Interview | Most often visited sequence of 3 consecutive webpages
Anonymous User
1960

Hi all,

Here is what i got on my Amazon Virtual Interview (seconds stage in the recruitment process) for SDE2 (fully remote role) based in the UK.

HR Questions:

  • Introduce yourself
  • Why do you want to change your current job?
  • A couple of questions about one of the projects on my CV, including what my contribution was, how many poeple were on the team and the general architecture of the application we built.

Technical Question:
Given a list of logs of a web browsing history, find the most often visited sequence of 3 consequitive web pages. In examples, if user C1 visited pages A->B->C->D->E->F->G and user C2 visited pages E->V->B->C->D->S, the target output is B->C->D as it was visited by both users.

The input was presented as follows:
time, user_id, webpage
T01, C1, A
T01, C2, E
T02, C1, B
T02, C2, V
T03, C1, C
T03, C2, B
T04, C1, D
T04, C2, C
T05, C1, E
T06, C1, F
T06, C2, D
T07, C1, G
T07, C2, S

The format of the output was left for me to device, although the interviewer said either 'B->C->D' or 'BCD' are absolutely fine. I went with the latter.
I came up with a solution which would have solved the problem in O(N) linear time complexity, but definitely was not the most optimal solution out there.
Was asked to analyse the complexity and comment on improvements/simplifications that would be made.

Received an email in 2 days saying that they don't want to continue with my application.

Let me know if you have any questions, would be happy to help.

Comments (5)