Docker Volumes MCQs with answers Page - 2

You will find multiple-choice questions (MCQs) related to #Docker Volumes here. Go through these questions to prepare effectively for your upcoming exams and interviews.

To view the correct answer for any question, simply click the "Show Answer" button.

Have a question to share? Click on "Add Question" to contribute!

A

Admin • 833.24K Points
Coach

Q. What happens if a container that uses a volume is deleted?

  • (A) The volume is also deleted
  • (B) The volume remains
  • (C) Data is lost
  • (D) Volume gets locked

A

Admin • 833.24K Points
Coach

Q. Which option is used with `docker run` to mount a volume?

  • (A) --mount-volume
  • (B) -mount
  • (C) -v or --mount
  • (D) --vol

A

Admin • 833.24K Points
Coach

Q. What is the benefit of using volumes over bind mounts?

  • (A) Slower performance
  • (B) Less secure
  • (C) Managed by Docker
  • (D) No portability

A

Admin • 833.24K Points
Coach

Q. Which of the following mounts is temporary and lost after container stop?

  • (A) Bind mount
  • (B) Named volume
  • (C) Anonymous volume
  • (D) Tmpfs mount

A

Admin • 833.24K Points
Coach

Q. Can you use the same volume with multiple containers?

  • (A) Yes
  • (B) No
  • (C) Only once
  • (D) Only if containers are linked

A

Admin • 833.24K Points
Coach

Q. What is an anonymous volume?

  • (A) Volume with a specific name
  • (B) Volume shared over the network
  • (C) Volume created without a name
  • (D) Volume not usable by Docker

A

Admin • 833.24K Points
Coach

Q. Which flag in `docker-compose.yml` defines volume usage?

  • (A) volume
  • (B) volumes
  • (C) mounts
  • (D) bind

A

Admin • 833.24K Points
Coach

Q. Which type of mount is suitable for sharing config files from the host?

  • (A) Tmpfs mount
  • (B) Docker volume
  • (C) Bind mount
  • (D) Named volume

A

Admin • 833.24K Points
Coach

Q. How do you remove all unused volumes?

  • (A) docker volume clean
  • (B) docker volume prune
  • (C) docker prune volumes
  • (D) docker volume remove-all

A

Admin • 833.24K Points
Coach

Q. What is the scope of a named volume?

  • (A) Limited to one container
  • (B) Global across all containers
  • (C) Only during container runtime
  • (D) Persistent and reusable
What's Tag

As you may know, questions are organized under broad categories. Each category can include various types of questions. For example, the "History" category might contain questions about the Revolt of 1857, Shivaji Maharaj, Ancient History, Buddhism, and more.

To further refine this organization, we've introduced tags, which act as sub-categories to group questions more specifically.

Verified users can add tags to any question. If you have any suggestions regarding this system, we'd love to hear from you. Contact Us

Learn More