Skip to content

Instantly share code, notes, and snippets.

@julien-duponchelle
Forked from dscottie/task.md
Last active October 21, 2022 14:32
Show Gist options
  • Save julien-duponchelle/a54d3a4c33d12b4e90bf004887601299 to your computer and use it in GitHub Desktop.
Save julien-duponchelle/a54d3a4c33d12b4e90bf004887601299 to your computer and use it in GitHub Desktop.
Coding Task

Coding Interview - The Task

You need to implement the following user story:

As a user, I want to see the trains that fit my travel schedule, So that I can decide what to buy

Steps

Step 1: Call an HTTP API

Write a function that will download schedules from 2 different train carrier API S1 and S2

Schedules can be retrieved from the following two endpoints (we need them both):

Step 2: Group the data

Merge the schedule s1 and s2 to a single schedule.

Step 3: Search for schedules

  • Create a function that will take one input: time in ISO 8601 format, e.g. 2011-12-03T10:15:30+01:00
  • The function should return the next 3 trains from the time provided
  • The time zone of the schedule is in UTC
  • The schedule loops around, i.e. if my input is close to midnight, it should include results from after midnight

Step 4: Expose it to the world

Expose this an HTTP API

Bonus

Notes

  • We don't need to persist the timetable
  • Their is no trap, we don't have an hidden S3 carrier that we will add later
  • If you take shortcut just tell us it's fine, the time is short
  • You can read all the documentation you need, google, copy paste like you do in real life. It doesn't matter if you have forgot
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment