This assignment evaluates your ability to:
- set up a small Python project to run reliably (locally + in Docker),
- pin dependencies for reproducible installs,
- write focused tests to reproduce a bug,
- implement a minimal, reviewable fix.
Create a Dockerfile so the project can run the test suite in a non-interactive, CI-style environment.
Requirements:
- requirements.txt exists and is used during build (pip install -r requirements.txt)
- pytest must be included/pinned in requirements.txt
- The image must run tests by default (use:
CMD ["python", "-m", "pytest", "-v"]). - The build must install dependencies from
requirements.txt.
Create a requirements.txt with pinned versions, using this format:
package==x.y.z
Update this README to include:
- how to run the tests locally,
- how to build and run tests with Docker.
There is a bug somewhere in this repository.
Your tasks:
- Identify the bug.
- Apply the smallest possible fix to make the tests pass.
- Keep the change minimal and reviewable (no refactors).
- Keep changes minimal and reviewable.
- Do not refactor unrelated code.
- Do not introduce extra tooling unless required.
- You may add tests and the smallest code change needed to fix the bug.
Create EXPLANATION.md (max 250 words) containing:
- What was the bug?
- Why did it happen?
- Why does your fix solve it?
- One realistic case / edge case your tests still don’t cover
- Install dependencies:
pip install -r requirements.txt- Run the test suite:
python -m pytest -v- Build the image:
docker build -t ai-assignment .- Run the tests:
docker run --rm ai-assignment- Submit a public GitHub repository URL containing your solution to the Google form link provided.