In this interview, you will be tasked with developing a React Native application using Expo. The project involves integrating the PokéAPI to fetch and display Pokémon data. The candidate is expected to implement state management using Redux and handle asynchronous actions with Redux Thunk. Additional functionalities include search and sort features. The candidate will need to optimize performance, handle errors gracefully, and write unit tests. Finally, they are required to push the project to a GitHub repository, providing comprehensive instructions in the README. This question assesses the candidate's proficiency in React Native, state management, API integration, and overall application development skills.
- Initialize a new Expo project using
expo init PokeAPIApp. - Choose the "blank" template or any template that suits your needs.
- Set up the basic project structure and ensure it runs successfully using
expo start.
- Install necessary dependencies such as
axiosfor making API requests,react-reduxfor state management,redux-thunkfor handling asynchronous actions, and any additional packages for search and sort functionality.
- Create a service file to handle PokéAPI requests using Axios.
- Implement functions to fetch Pokémon data from the PokéAPI.
- Test the API calls and handle loading, success, and error states.
- Install Redux and set up the Redux store, actions, and reducers.
- Define actions for fetching Pokémon data and update the Redux store accordingly.
- Integrate Redux with the Expo React Native application.
- Install
redux-thunkmiddleware to handle asynchronous actions. - Implement Redux thunk for making asynchronous API calls to PokéAPI.
- Implement a search bar component that allows users to search for specific Pokémon by name or other relevant criteria.
- Connect the search functionality to the Redux store to filter and display the matching Pokémon.
- Implement sorting options (e.g., by name, type, or ID) for the list of Pokémon.
- Allow users to toggle between ascending and descending order.
- Update the Redux store accordingly to reflect the sorted order.
- Update existing or create new React Native components to display Pokémon data.
- Integrate the search and sort functionality into the components.
- Enhance error handling for API calls, search, and sort actions.
- Ensure the UI responds appropriately to loading, success, and error states.
- Optimize performance by memoizing components, using PureComponent, and implementing shouldComponentUpdate where necessary.
- Consider using FlatList for efficient rendering of lists.
- Write unit tests for Redux actions, reducers, and components, including tests for search and sort functionality.
- Ensure that the tests cover different scenarios, including success, error, and various search/sort criteria.
- Create a new GitHub repository for the Expo project.
- Initialize a git repository locally and connect it to the GitHub repository.
- Commit the initial project files and subsequent changes.
- Push the code to the GitHub repository. Please ensure your repository is not private and share back the repository to pssd_management@mywave.biz