Skip to content
RED SAGSkills
easyMLOps Engineer interview question

What makes a good Docker image for a model-serving service?

What the interviewer wants to hear

  • Small, pinned base image and pinned dependencies
  • Layer order that caches dependency installs
  • No secrets or training data baked in
  • Runs as a non-root user with a health endpoint
  • Model loaded from a versioned registry or included with a recorded version

Model answer

I start from a small, pinned base image, such as a slim Python image with a specific version, and install pinned dependencies from a lock file. I copy the requirements file and install packages before copying the application code, so code changes do not reinstall everything. If packages need compilers, I use a multi-stage build so the final image only contains what runs. I never bake secrets or training data into the image; secrets are injected at runtime. The container runs as a non-root user and exposes health and readiness endpoints. For the model itself, I either download a specific version from the registry at startup or include it in the image and record the version, so every running container can be traced to an exact model. Finally I scan the image for vulnerabilities in CI and keep it as small as practical so it starts quickly.

Can you answer it under time pressure?

Take a timed easy round and get scored on every answer.

Start mock interview

More easy MLOps Engineer questions