The primary goals of this coding challenge are:
- Backend Setup: Create a backend service to fetch data from an external data source.
- Data Manipulation: Perform basic data manipulation on the fetched data.
- Frontend Implementation: Present the resulting data client side.
Tip
During the coding challenge, you are encouraged to articulate your thought process out loud. This helps us better understand your approach, decision-making, and problem-solving skills.
You are allowed to use any tools that you deem necessary to solve the coding challenge.
- Backend: Node.js with Express
- Frontend: React or Next.js with React (preferred options)
- Full-Stack Option: Next.js
-
Project Initialization:
- Set up a Node.js project with Express.
- Configure necessary dependencies and development tools (Nodemon or npm script using
node --watch
for automatic server restarts is recommended).
-
External Data Fetch
- Create a root endpoint (GET /) in your Express server.
- This endpoint should fetch data from https://jsonplaceholder.typicode.com/users/1 and return the response (unmodified).
-
Dynamic Data Aggregation Endpoint:
- Develop an endpoint (GET /users/:id/posts) that accepts a user ID as a URL parameter, fetches the user data and their posts from the JSONPlaceholder API (https://jsonplaceholder.typicode.com/users/:id and https://jsonplaceholder.typicode.com/posts?userId=:id), and returns them as a single JSON object.
-
Data Manipulation:
- Add a boolean field
hasEvenId
to each post indicating whether the post's ID is an even number.
- Add a boolean field
-
Frontend Implementation:
- Create a frontend using one of the specified options.
- Fetch and display the manipulated data from the backend.
- Bonus: Apply basic styling of your choice to enhance the presentation of data.
After you complete the challenge, we will review your code together. During the review, please be prepared to:
- Explain your solution and the choice of libraries.
- Discuss any challenges you encountered.
- Demonstrate your problem-solving approach and ability to write clean, maintainable code.
- Describe how you would test the endpoints and handle potential improvements or extensions to your solution if additional time was provided.
Good luck!