This is a Next.js project designed for interview candidates to demonstrate their troubleshooting and Docker skills.
This application allows users to:
- Upload images to the server
- Retrieve and display a preview of the uploaded images
The project intentionally contains an issue that candidates need to identify and fix.
Feel free to modify any files in the project to resolve the issue. But the core functionality should behave as expected.
The final solution should ensure that image upload and preview work correctly both in development and when running the application in a Docker container.
First, clone the repository and install dependencies:
git clone <repository-url>
cd interview-project
npm installThen run the development server:
npm run devOpen http://localhost:3000 with your browser to see the application.
When running the application in development mode (npm run dev), everything works correctly. However, when running the application using Docker:
docker-compose upYou'll notice that image uploads works but the preview fails. Your task is to:
- Identify why image upload and preview work in development but fail in Docker
- Provide a fix to ensure both functionalities work in Docker
- Document your solution
app/page.tsx: Main application page image upload formsapp/api/upload-image/route.ts: API endpoint for uploading imagesDockerfile: Configuration for building the Docker imagedocker-compose.yml: Configuration for running the application with Docker Compose
- Image upload and preview should work in both development and Docker environments
- Uploaded files should persist even if the Docker container is restarted
Your solution will be evaluated based on:
- Correctly identifying the root cause of the issue
- Implementing an effective fix
- Clearly explaining your troubleshooting process and solution
You must not seek direct help from others or use pre-existing solutions. You are allowed to use any external resources, documentation, internet searches, etc. You are allowed to use AI tools or any AI-generated content as part of your research, but you must ensure that the final solution is your own work.
Fork this repository, implement your solution, and provide a link to your forked repository.
Please document your solution in a separate file named SOLUTION.md, including:
- The issue you identified
- The changes you made to fix it
- Any additional improvements you would recommend
- Commands used to test your solution
Good luck!