{"id":47944204,"url":"https://github.com/dataiku/millenium-falcon-challenge","last_synced_at":"2026-04-04T08:20:46.435Z","repository":{"id":117869573,"uuid":"243014736","full_name":"dataiku/millenium-falcon-challenge","owner":"dataiku","description":"Developer Technical test @ Dataiku","archived":false,"fork":false,"pushed_at":"2025-06-10T13:07:41.000Z","size":21799,"stargazers_count":13,"open_issues_count":0,"forks_count":17,"subscribers_count":43,"default_branch":"master","last_synced_at":"2025-06-10T14:28:36.796Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":null,"has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/dataiku.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2020-02-25T14:06:14.000Z","updated_at":"2025-06-10T13:08:08.000Z","dependencies_parsed_at":null,"dependency_job_id":"6cb82dcd-4f85-4c29-a939-523054bbe332","html_url":"https://github.com/dataiku/millenium-falcon-challenge","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/dataiku/millenium-falcon-challenge","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dataiku%2Fmillenium-falcon-challenge","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dataiku%2Fmillenium-falcon-challenge/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dataiku%2Fmillenium-falcon-challenge/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dataiku%2Fmillenium-falcon-challenge/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/dataiku","download_url":"https://codeload.github.com/dataiku/millenium-falcon-challenge/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dataiku%2Fmillenium-falcon-challenge/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":31392731,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-04T04:26:24.776Z","status":"ssl_error","status_checked_at":"2026-04-04T04:23:34.147Z","response_time":60,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2026-04-04T08:20:45.791Z","updated_at":"2026-04-04T08:20:46.377Z","avatar_url":"https://github.com/dataiku.png","language":null,"readme":"# Developer Technical Test @ Dataiku\n\n## What are the odds?\n\n[A long time ago in a galaxy far away...](https://youtu.be/2EGHIxz-bwI)\n\nThe Death Star - the Empire's ultimate weapon - is almost operational and is currently approaching the Endor planet. The countdown has started.\n\nHan Solo, Chewbacca, Leia and C3PO are currently on Tatooine boarding on the Millennium Falcon. They must reach Endor to join the Rebel fleet and destroy the Death Star before it annihilates the planet.\n\nThe Empire has hired the best bounty hunters in the galaxy to capture the Millennium Falcon and stop it from joining the rebel fleet...\n\n### Routes\nThe Millennium Falcon has an onboard map containing the list of all planets in the galaxy, and the number of days it takes to go from one to the other using an Hyperspace jump.\n\n### Autonomy \u0026 Fuel\nHowever, the Millennium Falcon is not the newest ship of its kind. It's autonomy defines its maximum fuel tank capacity, measured in days of travel. Each hyperspace jump consumes an amount of fuel equal to its travel time. If the remaining fuel is insufficient for the next jump, the crew must refuel. Refueling takes 1 day and fills the tank back to its maximum capacity.\nFor example, if the ship's autonomy is 6 days and a 4-day jump was just completed, 2 days of fuel remain. To reach a planet that is 3 or more days away, the crew must first spend 1 day refueling to restore the tank to its full 6-day capacity.\n\n### Bounty Hunters\nThe rebel command center has also intercepted a communication and the rebels know the various locations and days where Bounty Hunter have planned to hunt the Millennium Falcon.\nIf the Millennium Falcon arrives on a planet on a day where Bounty Hunter are expected to be on this planet, the crew has 10% chance of being captured. Likewise, if the Millennium Falcon refuels on a planet on a day where Bounty Hunter are expected to be on this planet, the crew has 10% chance of being captured.\n\nHint: To avoid the Bounty Hunters, the Millennium Falcon can land on a planet with no bounty hunters (even if its tank is full) and wait for 1 or more days before pursuing its route.\n\nThe mathematical formula to compute the total probability of being captured is:\n\n$$ {1 \\over 10} + { 9 \\over 10^2 } + { 9^2 \\over 10^3 } + ... + { 9^{k-1} \\over 10^{k} } $$\n\n\nwhere k is the number of times the Bounty Hunter tried to capture the Millennium Falcon.\n\nFor example, the probability to get captured is:\n   - if the Millennium Falcon travels via 1 planet with bounty hunters:\n  \n$$ {1 \\over 10} = 0.1 $$\n   \n   - if the Millennium Falcon travels via 1 planet with bounty hunters and refuels on this planet:\n\n$$ {1 \\over 10} + { 9 \\over 10^2 } = 0.19 $$\n\n   - if the Millennium Falcon travels via 2 planets with bounty hunters:\n\n$$ {1 \\over 10} + { 9 \\over 10^2 } = 0.19 $$\n\n   - if the Millennium Falcon travels via 3 planets with bounty hunters:\n\n$$ {1 \\over 10} + { 9 \\over 10^2 } + { 9^2 \\over 10^3 } = 0.271 $$\n\n\n## The mission\n\nYour mission is to create a web application to compute and display the odds that the Millennium Falcon reaches Endor in time and saves the galaxy.\n\n![Never tell me the odds](https://github.com/dataiku/millenium-falcon-challenge/blob/master/resources/never-tell-me-the-odds.gif)\n\nYour web application will be composed of a backend (the Millennium Falcon onboard computer), a front-end (C3PO) and a CLI (command-line interface aka R2D2).\n\n### Back-end\n\nWhen it starts, the back-end service will read a JSON configuration file containing the autonomy, the path towards an SQLite database file containing all the routes, the name of the planet where the Millennium Falcon is currently parked (Tatooine) and the name of the planet that the empire wants to destroy (Endor).\n\n**millennium-falcon.json**\n```json\n{\n  \"autonomy\": 6,\n  \"departure\": \"Tatooine\",\n  \"arrival\": \"Endor\",\n  \"routes_db\": \"universe.db\"\n}\n```\n   - autonomy (integer): autonomy of the Millennium Falcon in days.\n   - departure (string): Planet where the Millennium Falcon is on day 0.\n   - arrival (string): Planet where the Millennium Falcon must be at or before countdown.\n   - routes_db (string): Path toward a SQLite database file containing the routes. The path can be either absolute or relative to the location of the `millennium-falcon.json` file itself.\n\nThe SQLite database will contain a table named ROUTES. Each row in the table represents a space route. Routes can be travelled **in any direction** (from origin to destination or vice-versa).\n\n   - ORIGIN (TEXT): Name of the origin planet. Cannot be null or empty.\n   - DESTINATION (TEXT): Name of the destination planet. Cannot be null or empty.\n   - TRAVEL_TIME (INTEGER): Number days needed to travel from one planet to the other. Must be strictly positive.\n\n| ORIGIN   | DESTINATION | TRAVEL_TIME |\n|----------|-------------|-------------|\n| Tatooine | Dagobah     | 4           |\n| Dagobah  | Endor       | 1           |\n\n### Front-end\n\nThe front-end should consists of a single-page application offering users a way to upload a JSON file containing the data intercepted by the rebels about the plans of the Empire and displaying the odds (as a percentage) that the Millennium Falcon reaches Endor in time and saves the galaxy.\n\n**empire.json**\n```json\n{\n  \"countdown\": 6, \n  \"bounty_hunters\": [\n    {\"planet\": \"Tatooine\", \"day\": 4 },\n    {\"planet\": \"Dagobah\", \"day\": 5 }\n  ]\n}\n```\n\n   - countdown (integer): number of days before the Death Star annihilates Endor\n   - bounty_hunters (list): list of all locations where Bounty Hunter are scheduled to be present.\n      - planet (string): Name of the planet. It cannot be null or empty.\n      - day (integer): Day the bounty hunters are on the planet. 0 represents the first day of the mission, i.e. today.\n\n\nThe web page will display the probability of success as a number ranging from 0 to 100%:\n- `0%` if the Millennium Falcon cannot reach Endor before the Death Star annihilates Endor\n- `x% (0 \u003c x \u003c 100)` if the Millennium Falcon can reach Endor before the Death Star annihilates Endor but might be captured by bounty hunters.\n- `100%` if the Millennium Falcon can reach Endor before the Death Star annihilates Endor without crossing a planet with bounty hunters on it.\n\n### CLI\n\nThe command-line interface should consist of an executable that takes 2 files paths as input (respectively the paths toward the `millennium-falcon.json` and `empire.json` files) and prints the probability of success as a number ranging from 0 to 100.\n```sh\n$ give-me-the-odds example2/millennium-falcon.json example2/empire.json\n81\n```\n\n## Examples\n\n### Example 1\n**[universe.db](examples/example1/universe.db?raw=true)** (click to download)\n| ORIGIN   | DESTINATION | TRAVEL_TIME |\n|----------|-------------|-------------|\n| Tatooine | Dagobah     | 6           |\n| Dagobah  | Endor       | 4           |\n| Dagobah  | Hoth        | 1           |\n| Hoth     | Endor       | 1           |\n| Tatooine | Hoth        | 6           |\n\n**[millennium-falcon.json](examples/example1/millennium-falcon.json?raw=true)** (click to download)\n```\n{\n  \"autonomy\": 6,\n  \"departure\": \"Tatooine\",\n  \"arrival\": \"Endor\",\n  \"routes_db\": \"universe.db\"\n}\n```\n**[empire.json](examples/example1/empire.json?raw=true)** (click to download)\n```\n{\n  \"countdown\": 7, \n  \"bounty_hunters\": [\n    {\"planet\": \"Hoth\", \"day\": 6 }, \n    {\"planet\": \"Hoth\", \"day\": 7 },\n    {\"planet\": \"Hoth\", \"day\": 8 }\n  ]\n}\n```\n\nThe application should display 0% as The Millennium Falcon cannot go from Tatooine to Endor in 7 days or less (the Millennium Falcon must refuel for 1 day on either Dagobah or Hoth).\n\n### Example 2\n**[universe.db](examples/example2/universe.db?raw=true)** same as above\n\n**[millennium-falcon.json](examples/example2/millennium-falcon.json?raw=true)**: same as above\n\n**[empire.json](examples/example2/empire.json?raw=true)** (click to download)\n```\n{\n  \"countdown\": 8, \n  \"bounty_hunters\": [\n    {\"planet\": \"Hoth\", \"day\": 6 }, \n    {\"planet\": \"Hoth\", \"day\": 7 },\n    {\"planet\": \"Hoth\", \"day\": 8 }\n  ]\n}\n```\n\nThe application should display 81% as The Millennium Falcon can go from Tatooine to Endor in 8 days with the following plan:\n- Travel from Tatooine to Hoth, with 10% chance of being captured on day 6 on Hoth.\n- Refuel on Hoth with 10% chance of being captured on day 7 on Hoth.\n- Travel from Hoth to Endor\n\n### Example 3\n**[universe.db](examples/example3/universe.db?raw=true)** same as above\n\n**[millennium-falcon.json](examples/example3/millennium-falcon.json?raw=true)**: same as above\n\n**[empire.json](examples/example3/empire.json?raw=true)**\n```\n{\n  \"countdown\": 9, \n  \"bounty_hunters\": [\n    {\"planet\": \"Hoth\", \"day\": 6 }, \n    {\"planet\": \"Hoth\", \"day\": 7 },\n    {\"planet\": \"Hoth\", \"day\": 8 }\n  ]\n}\n```\n\nThe application should display 90% as The Millennium Falcon can go from Tatooine to Endor in 9 days with the following plan:\n- Travel from Tatooine to Dagobath.\n- Refuel on Dagobah\n- Travel from Dagobah to Hoth, with 10% chance of being captured on day 8 on Hoth.\n- Travel from Hoth to Endor\n\n### Example 4\n**[universe.db](examples/example4/universe.db?raw=true)** same as above\n\n**[millennium-falcon.json](examples/example4/millennium-falcon.json?raw=true)**: same as above\n\n**[empire.json](examples/example4/empire.json?raw=true)**\n```\n{\n  \"countdown\": 10, \n  \"bounty_hunters\": [\n    {\"planet\": \"Hoth\", \"day\": 6 }, \n    {\"planet\": \"Hoth\", \"day\": 7 },\n    {\"planet\": \"Hoth\", \"day\": 8 }\n  ]\n}\n```\n\nThe application should display 100% as The Millennium Falcon can go from Tatooine to Endor in 10 days and avoid Bounty Hunters with the following plans:\n- Travel from Tatooine to Dagobah,  refuel on Dagobah\n- Wait for 1 day on Dagobah\n- Travel from Dagobah to Hoth\n- Travel from Hoth to Endor\n\nor\n\n- Wait for 1 day on Tatooine\n- Travel from Tatooine to Dagobah, refuel on Dagobah\n- Travel from Dagobah to Hoth\n- Travel from Hoth to Endor\n\n\n## Final note\nThere is absolutely no constraint on the technological stack that you might choose to achieve this,\neither in the backend or frontend. Choose whichever you think is best suited for the task.\n\nWe are looking for high quality code: typically something that you would put into production and be proud of.\n\nBy the way, we know you might be going to use AI, and that's a good thing. However, we ask that you mention in your submission what tool you used to help you and why.\n\n\nHave fun!\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdataiku%2Fmillenium-falcon-challenge","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdataiku%2Fmillenium-falcon-challenge","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdataiku%2Fmillenium-falcon-challenge/lists"}