- Set up a React TypeScript project - you may use Create React App: https://create-react-app.dev/docs/getting-started
- Use the trivia API: https://opentdb.com/api.php?amount=10&category=17
- Use a query library, such as TanStack Query to fetch API data: https://tanstack.com/query/latest/docs/framework/react/installation
- Use the attached wireframes as a reference for how questions should be presented.
- Styling is optional and may differ entirely from what the wireframe looks like.
- Optionally, use any additional libraries you prefer.
- We do not expect you to spend more than 2 hours on the task. Don't worry too much about making it look pretty - we care more about how you think. If you can't finish everything, that's okay! Just think about how you would complete it, and we'll discuss your ideas during the interview.
- When displaying the possible answers for each question of type "multiple", the correct answer is randomly placed among the incorrect answers.
- For questions of type "boolean", the possible answers are always "Correct" and "Incorrect" in this order.
- The submit button is disabled until the user selects an answer for all questions.
- The api has a rate limit of 5 seconds between request (https://opentdb.com/api_config.php), so if the user tries to refetch questions in an interval lower than 5 seconds, a message will be displayed.
##3 Scripts
These are the main commands you'll need to execute to develop the application.
Command | Description |
---|---|
npm start |
Start a new local development server on http://localhost:3000 |
npm build |
Build the site for production |
npm test |
Run Jest |
npm run lint |
Run Eslint |
npm run format |
Run Prettier |