{"id":20644013,"url":"https://github.com/adjust/react-and-rockets","last_synced_at":"2025-04-16T02:06:09.545Z","repository":{"id":43723796,"uuid":"401348181","full_name":"adjust/react-and-rockets","owner":"adjust","description":"React \u0026 Rockets - Challenge for Adjust Frontend Developer","archived":false,"fork":false,"pushed_at":"2023-05-22T12:33:12.000Z","size":122,"stargazers_count":4,"open_issues_count":0,"forks_count":7,"subscribers_count":45,"default_branch":"main","last_synced_at":"2025-04-07T07:33:48.076Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":false,"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/adjust.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}},"created_at":"2021-08-30T13:10:35.000Z","updated_at":"2023-06-30T08:02:41.000Z","dependencies_parsed_at":"2023-01-21T04:45:56.957Z","dependency_job_id":null,"html_url":"https://github.com/adjust/react-and-rockets","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/adjust%2Freact-and-rockets","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/adjust%2Freact-and-rockets/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/adjust%2Freact-and-rockets/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/adjust%2Freact-and-rockets/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/adjust","download_url":"https://codeload.github.com/adjust/react-and-rockets/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":249183102,"owners_count":21226141,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","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":"2024-11-16T16:14:32.235Z","updated_at":"2025-04-16T02:06:09.515Z","avatar_url":"https://github.com/adjust.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# React \u0026 Rockets\n\n**Description:** Challenge for Adjust Frontend Developer\n\n**Owner:** [adjust](https://github.com/adjust)\n\n**Contacts:** frontend-hiring@adjust.com\n\n---\n\n## Welcome to our little coding exercise! 👋\n\nHere you will be given the opportunity to play with JavaScript and Rockets in the same project. For this, we recommend you to block 2-3 hours of your time to complete it.\n\n**Please make sure you have read this page entirely, before starting the challenge**. If you have any doubts, please reach out to us by [opening an issue](https://github.com/adjust/react-and-rockets#how-to-request-help) as described at the bottom of this page.\n\n**Importantly**, we would like to give all candidates taking this test the same opportunity to solve the exercise in their own way. Because of this, **please do not fork or share this repo (nor your solution) with anybody 🙏🏻**\n\n\u003cimg align=\"center\" src=\"https://i.imgur.com/ekyJNd9.jpg\" width=\"600\"\u003e\n\n## Instructions\n\n1. You **MUST [clone this repo](https://docs.github.com/en/github/creating-cloning-and-archiving-repositories/cloning-a-repository-from-github/cloning-a-repository)** to a location of your choosing where you can work on your solution\n2. Write your solutions inside of the files contained in **`src/solutions`**, making sure the provided tests are green. **Please do not modify anything inside of `src/tests`**\n3. Push your solution to a **private repo** in your **personal Github account**\n4. When you are ready for us to take a look, please add [adjust-frontend-hiring][adjust-frontend-hiring] (GitHub user) as collaborator\n\n## Important rules\n\nYour challenge submission will be disqualified and automatically rejected if any of the following happens:\n\n- Your **repo was not properly cloned** as specified on step #1 of Instructions. [See how to clone a repository here](https://docs.github.com/en/repositories/creating-and-managing-repositories/cloning-a-repository). **Note:** If you cloned the repo properly, previous commits from this (original) repo, must be showing on your git history.\n- Your **tests are not passing** (green) as specified on step #2 of Instructions. **Note:** You can run tests with command `npm run test src` or `yarn test src` (according to the package manager you are using).\n- You **have modified any of the files inside of `src/tests`** as specified on step #2 of Instructions.\n- Your **repo visibility is not set to private** as specified on step #3 of Instructions. [See how to make a repository private here](https://docs.github.com/en/repositories/managing-your-repositorys-settings-and-features/managing-repository-settings/setting-repository-visibility).\n\n---\n\n## Exercise\n\n### TASK #1 - JavaScript\n\nImplement `prepareData` higher order function, which takes an object of filter params `{year, customerName}`, and returns a function that processes a list of missions, by only showing the ones that were launched in `year` and carried a payload belonging to `customerName`.\n\n**Observations:**\n\n- You can use any **utility** library you see fit\n- Missions should appear in inverse chronological order (sort), with the exception of those that carried more payloads should appear first.\n- Payloads are carried in the second stage of a rocket and they can belong to multiple customers.\n- It doesn't matter to which `customerName` 'program' each payload belongs to as long as `customerName` is the customer.\n\n**Example:**\n\nConsidering we have the list of missions from this [data fixture][data-fixture], and the following filter params:\n\n```js\n{\n  year: 2018,\n  customerName: \"NASA\"\n}\n```\n\nThe expected result should be:\n\n```js\n[\n  {\n    flight_number: 62,\n    mission_name: 'Iridium NEXT Mission 6',\n    payloads_count: 2,\n  },\n  {\n    flight_number: 72,\n    mission_name: 'CRS-16',\n    payloads_count: 1,\n  },\n  {\n    flight_number: 64,\n    mission_name: 'CRS-15',\n    payloads_count: 1,\n  },\n  {\n    flight_number: 60,\n    mission_name: 'TESS',\n    payloads_count: 1,\n  },\n  {\n    flight_number: 59,\n    mission_name: 'CRS-14',\n    payloads_count: 1,\n  },\n];\n```\n\n---\n\n### TASK #2 - React \u0026 Hooks\n\nImplement `RocketsList` component with the following specifications:\n\n1. It takes `filerParams` object (with shape described in [task #1][task-1]) as a prop\n2. It obtains a list of 'missions' from a [custom hook][custom-hook], which uses [global fetch][global-fetch] (`window.fetch`) to _GET_ **the whole list of missions** from [SpaceX API][spacex-api] and processes them with `prepareData` function (from [task #1][task-1]) and `filterParams` prop\n3. For each 'mission' obtained from the custom hook, it renders a string using [template literals][template-literals] with the following format: \"#`flight_number` `mission_name` (`payloads_count`)\"\n4. While 'missions' are being fetched from API, it renders `\"Loading...\"` to screen\n5. If no 'missions' are obtained from the custom hook, it renders `\"No data\"` to screen\n\n**Observations:**\n\n- Missions processing with `prepareData` must happen **inside** the custom hook\n- The list of missions should be re-processed if `filterParams` prop changes, **BUT no new API calls should happen** to [SpaceX API][spacex-api]\n- You are not allowed to use any of the filter parameters provided by the [SpaceX API docs][spacex-api-docs], just fetch all available data and process it with `prepareData` function\n- Only [global fetch][global-fetch] (`window.fetch`) can be used to make API requests\n\n**Example:**\n\nConsidering we pass the following `filterParams` as a prop:\n\n```js\n{\n  year: 2018,\n  customerName: \"NASA\"\n}\n```\n\nThe expected render should be:\n\n```txt\n#62 Iridium NEXT Mission 6 (2)\n#72 CRS-16 (1)\n#64 CRS-15 (1)\n#60 TESS (1)\n#59 CRS-14 (1)\n```\n\n## How to request help\n\nIf you have any doubts, you can reach out to us by simply [creating a GitHub issue](https://docs.github.com/en/issues/tracking-your-work-with-issues/creating-an-issue#creating-an-issue-from-a-repository) in your private repo.\n\nDescribe your question(s) and [mention](https://docs.github.com/en/github/writing-on-github/getting-started-with-writing-and-formatting-on-github/basic-writing-and-formatting-syntax#mentioning-people-and-teams) [adjust-frontend-hiring][adjust-frontend-hiring] in your comments (don't forget to add user as collaborator). We will then receive a notification and get back to you as soon as possible.\n\n## Helpful links\n\n- [SpaceX API Docs][spacex-api-docs]\n- [Inviting collaborators to a personal repository][github-collaborators]\n\n[spacex-api]: https://api.spacexdata.com/v3/launches/past\n[spacex-api-docs]: https://docs.spacexdata.com/?version=latest#fce450d6-e064-499a-b88d-34cc22991bcc\n[github-collaborators]: https://help.github.com/en/articles/inviting-collaborators-to-a-personal-repository\n[task-1]: https://github.com/adjust/react-and-rockets#task-1---javascript\n[template-literals]: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Template_literals\n[custom-hook]: https://reactjs.org/docs/hooks-custom.html\n[data-fixture]: https://github.com/adjust/react-and-rockets/tree/main/src/tests/__fixtures__/data.json\n[adjust-frontend-hiring]: https://github.com/adjust-frontend-hiring\n[global-fetch]: https://developer.mozilla.org/en-US/docs/Web/API/fetch\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fadjust%2Freact-and-rockets","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fadjust%2Freact-and-rockets","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fadjust%2Freact-and-rockets/lists"}