Write a one-file script that measures how long each step of a deploy takes.

IntermediateHands-onBash scripting tasks
Answer
step() {
  local name="$1"; shift
  local start=$SECONDS
  echo "--> $name"
  "$@"
  echo "<-- $name took $((SECONDS - start))s"
}

step "pull image"   docker pull myapp:1.4.2
step "run migrate"  docker run --rm myapp:1.4.2 ./migrate
step "restart"      systemctl restart myapp

Key trick → Wrapping commands in a function that takes "$@" gives you timing, logging and error handling in one place.

All Real-World Interview questions Roadmap: Interview readiness

More on Bash scripting tasks