Skip to content

LucaPaterlini/VF_LucaPaterlini

Repository files navigation

Story

There are over 100,000 flights a day, with millions of people and cargo being transferred around the world. With so many people and different carrier/agency groups, it can be hard to track where a person might be. In order to determine the flight path of a person, we must sort through all of their flight records.

Goal

To create a simple microservice API that can help us understand and track how a particular person's flight path may be queried. The API should accept a request that includes a list of flights, which are defined by a source and destination airport code. These flights may not be listed in order and will need to be sorted to find the total flight paths starting and ending airports.

Assumptions

Only a non-circular list of flights record is considered valid

e.g. ABC-> CDA, CDA-> ABC

It's not considered valid because without knowing the start and the order of the flights this person have taken it can be in either airports at the end.

Usage

Direct Usage

Assuming golang is installed, clone this repo and run the following command

go mod tidy
go run main.go

Docker Usage

clone this repo and enter the repo and run the following commands, depending on your system privileges on the host machine it may require to insert your credentials if you have access to sudo privileges or be restricted.

The second command will assign 4 cpu to the docker container and 50MB of ram

   docker build -t appvf:1.0 .
   docker run -d -p 8080:8080 -it --cpus="4" --memory=50m appvf:1.0

Api Documentation

POST /calculate

Body JSON Request [[string string]]

Body JSON Response [string string]

eg.

[["IND", "EWR"], ["SFO", "ATL"], ["GSO", "IND"], ["ATL", "GSO"]] => ["SFO", "EWR"]

Future Development

Depending on the scale and scenario the following topic are ideal for future development

  • distributed monitoring like Datadog
  • security code scanners like Snyk
  • e2e endpoint testing with NewMan

About

tech test for Volume Finance https://volume.finance/

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published