Amazon interview question

Log processing algorithm