The app in a container can't reach the database container: "could not translate host name db".

IntermediateHands-onLive debugging tasks
Answer
docker network ls
docker inspect api --format '{{json .NetworkSettings.Networks}}' | jq 'keys'
docker inspect db  --format '{{json .NetworkSettings.Networks}}' | jq 'keys'
docker network create appnet
docker network connect appnet api
docker network connect appnet db
docker exec api getent hosts db

Key trick → Container name DNS only works on user-defined networks, not the default bridge. Both containers must share a network (Compose creates one automatically).

All Real-World Interview questions Roadmap: Interview readiness

More on Live debugging tasks