# A sample coding question to use for helping folks prepare for an interview
Other resources they may find useful: https://app.codesignal.com/pre-screen-practice - create a Developer account and do some practise questions.
Otherwise, use a google doc or coder pad to run this.
We're working together for a company that processes long running transactions. Our program spits out a log file that looks like the following:
2023-01-01T00:01:53Z Transaction A Start
2023-01-01T00:02:53Z Transaction A End
2023-01-01T00:03:00Z Transaction B Start
2023-01-01T00:03:10Z Transaction C Start
2023-01-01T00:03:12Z Transaction B End
2023-01-01T00:03:20Z Doing things in transaction C
2023-01-01T00:03:24Z Transaction C End
2023-01-01T00:04:53Z Transaction D Start
We forgot to add metrics to our application! And now we need to take this log file and calculate the average elapsed time in seconds for all the completed transactions.
In the above example, the answer should be 28.666
rounded up to 29
seconds.
What's the worse cast computational and memory complexity?
What changes would you make to this application if you needed to handle a very large, 100GB stream of logs?
What would we do if we needed to calculate a moving average over time?