title: Can you suggest a approach for this system design question?
body: <p>was asked a design question for software engineer position. I couldn't get anywhere near the question, can you guys suggest a good solution for this question?</p>
  
  <p>Question:
  There are 10 Servers which has 5 parameters such as A,B,C,D,E. Each parameter is time stamped and written to a logfile. As a note all 10 devices write to a single log file. The format of the log will be device id, time stamp, parameter(A or B or C or D or E)
  eg</p>
  
  <pre><code>  device 1, 5 june , A=4
    device 5 ,6 june , C =3
    device 4 ,5 june , A =3
  </code></pre>
  
  <p>Design a logging mechanism where the user would query your API with device id and parameter he wants (A or B or C or D or E) with increasing timestamp and the single log file.</p>
  
  <p>I just wrote a function which would traverse the log file with priority queue for increasing timestamp and get the parameter, he screwed me by asking what if the same user queries the same parameter would you go through the log file again ? I said I can cache it . I ran out of time for this one but neverth less can you guys give me a good design for this ?</p>