This skeleton project provides a foundation for building a RESTful API using Flask and containerizing it with Docker. It's designed to test your skills in web development, API design, machine learning integration, and containerization.
- Python 3.11
- Flask: A lightweight WSGI web application framework
- Gunicorn: A Python WSGI HTTP Server for UNIX
- Docker: A platform for developing, shipping, and running applications
- Docker installed on your local machine
project_root/
├── Dockerfile
├── gunicorn.conf.py
├── requirements.txt
├── app.py
└── README.md
- Implement the API in
app.py, including an inference endpoint for a machine learning model - Build and run the Docker container
- Make successful requests to your API
- Create an inference endpoint that accepts input data and returns predictions using a machine learning model of your choice
- Implement proper error handling and input validation
- Ensure the API follows RESTful principles
- Open
app.pyand implement the required endpoints and logic - Ensure your code follows PEP 8 style guidelines
- Add any necessary dependencies to
requirements.txt
docker build -t <image-name>:<version> .
docker run -p 50505:50505 <image-name>:<version>
Use curl or any API testing tool to make requests to your endpoints. For example:
curl http://localhost:50505
Your submission will be evaluated based on:
- Correctness of API implementation, including the ML inference endpoint
- Code quality, organization, and adherence to best practices
- Proper use of Docker
- API functionality and adherence to RESTful principles
- Error handling and input validation
While not required, implementing any of the following will be viewed favorably:
- JWT authentication
- Comprehensive logging
- API documentation (e.g., using Swagger/OpenAPI)
- Unit tests
- Data validation and sanitization
- Rate limiting
- Caching mechanisms
-
When ready, we will schedule a meeting with you to review your implementation.
-
During this meeting, you will have the opportunity to walk us through your code live. Be prepared to:
- Explain your design decisions
- Demonstrate the functionality of your API
- Discuss any challenges you faced and how you overcame them
- Answer questions about your implementation
-
This live review allows us to better understand your thought process and gives you a chance to showcase your communication skills and technical knowledge.
We look forward to seeing your implementation and discussing it with you!