Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Input and output don't seem to match #30

Open
david-santos opened this issue Nov 4, 2019 · 4 comments
Open

Input and output don't seem to match #30

david-santos opened this issue Nov 4, 2019 · 4 comments

Comments

@david-santos
Copy link

In the README.md file there's an example of an input and an example of an output.
Are those two related?
In other words, for the provided input example, the application is supposed to write the provided output example?

The reasons why I ask this are:

  • You mention a window size of 10 minutes but the provided output shows a window size of 14 minutes
  • Unless I'm missing something about the challenge itself, the average_delivery_time field of the last 3 lines of the example output don't seem to make sense according to the provided input.

Thanks for your help.

@JoaoVasques
Copy link
Contributor

Hi @david-santos !

The examples are correct. What is happening is that for every minute (from A to B) you need to calculate the average during for the last W minutes (W is window size and in this case is 10).

So happens is the following

minute A - contains average on the time [A - W, A]
minute A+1 - contains average on the time [A+1-W, A+1]
etc...

The 14 minutes are only the difference between the first and the last event. Hope this answers your question

@david-santos
Copy link
Author

Hi @JoaoVasques

Thanks for your input, but I'm sorry, I still don't understand.

My interpretation of "all translations for the past 10 minutes" is that I have to pick up all translation events which timestamp is inside the interval [(now - 10 minutes), now]. But from your input, it seams more like it's a sliding window of 10 minutes. Is this correct?
If so, when does the sliding of the window starts and stops?
It starts from the time of the first event and stops at the time of the last event?

Thanks for your help.

@david-santos
Copy link
Author

Hi @JoaoVasques

Never mind my last comment.
I think I got it!

Thanks for your time.

@JoaoVasques
Copy link
Contributor

Hi @david-santos !

Great! Glad I could help. Good luck!

JV

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants