{"id":9142,"date":"2020-01-22T07:11:19","date_gmt":"2020-01-22T07:11:19","guid":{"rendered":"https:\/\/www.devopsschool.com\/blog\/?p=9142"},"modified":"2025-07-12T05:41:46","modified_gmt":"2025-07-12T05:41:46","slug":"docker-interview-questions-and-answer-part-33","status":"publish","type":"post","link":"https:\/\/www.devopsschool.com\/blog\/docker-interview-questions-and-answer-part-33\/","title":{"rendered":"Docker Interview Questions and Answer Part \u2013 33"},"content":{"rendered":"\n<p><strong>Which of the following best decribes a Docker Image?<\/strong><\/p>\n\n\n\n<ul class=\"wp-block-list\"><li>A read-write template for starting one or more containers<\/li><li>A point-in-time snapshot of a container used for backups<\/li><li>A data volume that can be mounted inside of a container<\/li><li><strong>A read-only template for starting one or more containers (Ans)<\/strong><\/li><\/ul>\n\n\n\n<p><strong>You have two services running on a Swarm, but they cannot find each other by name. Which of the following could be the reason why?<\/strong><\/p>\n\n\n\n<ul class=\"wp-block-list\"><li><strong>They are on different overlay networks (Ans)<\/strong><\/li><li>They were not manually registered with the Swarm DNS when they were created<\/li><li>Service discovery only works on bridge\/NAT networks<\/li><li>You did not create the Swarm DNS<\/li><\/ul>\n\n\n\n<p><strong>Which of the following is a loose definition of a Docker container?<\/strong><\/p>\n\n\n\n<ul class=\"wp-block-list\"><li>A VM running a shared kernel with resource limits applied<\/li><li>A unikernel running on a hypervisor with resource limits applied<\/li><li><strong>An isolated area of an Operating System with resource limits applied (Ans)<\/strong><\/li><\/ul>\n\n\n\n<p><strong>What will happen if you start a new container or service and specify a volume that does not currently exist?<\/strong><\/p>\n\n\n\n<ul class=\"wp-block-list\"><li>You will be prompted to create the new volume<\/li><li>The command will complete but the container\/service will fail to start<\/li><li>The command will fail<\/li><li><strong>Docker will create the volume for you (Ans)<\/strong><\/li><\/ul>\n\n\n\n<p><strong>What are the base requirements to be able to use Docker Secrets?<\/strong><\/p>\n\n\n\n<ul class=\"wp-block-list\"><li>Swarm mode and an external CA<\/li><li>Swarm mode and self-encrypting disks for the cluster store<\/li><li><strong>Docker in Swarm mode (Ans)<\/strong><\/li><li>Docker<\/li><\/ul>\n\n\n\n<p><strong>Which of the following are top-level keys in a stack file (Compose v3 file)?<\/strong><\/p>\n\n\n\n<ul class=\"wp-block-list\"><li>Version, deployments, networks, volumes<\/li><li>Version and services<\/li><li><strong>Version, services, networks, volumes (Ans)<\/strong><\/li><li>Services, pods, networks, volumes<\/li><\/ul>\n\n\n\n<p><strong>Which of the following is an advantage of Multi-stage Builds?<\/strong><\/p>\n\n\n\n<ul class=\"wp-block-list\"><li>Multi-platform images<\/li><li>Better image documentation<\/li><li>Faster image builds<\/li><li><strong>Smaller images (Ans)<\/strong><\/li><\/ul>\n\n\n\n<p><strong>Which of the following is a recommended number of Swarm managers for high availability?<\/strong><\/p>\n\n\n\n<ul class=\"wp-block-list\"><li>4<\/li><li><strong>3 (Ans)<\/strong><\/li><li>2<\/li><\/ul>\n\n\n\n<p><strong>Which of the following best describes a Bridge (NAT on Windows) network in Docker?<\/strong><\/p>\n\n\n\n<ul class=\"wp-block-list\"><li>Token-ring<\/li><li>Multi-host overlay network<\/li><li><strong>A single-host network (Ans)<\/strong><\/li><\/ul>\n\n\n\n<p><strong>How does the HRM know how to route traffic to the correct service?<\/strong><\/p>\n\n\n\n<ul class=\"wp-block-list\"><li>iptables rules<\/li><li><strong>It inspects HTTP host headers (Ans)<\/strong><\/li><li>DNS labels<\/li><li>Custom load balancer rules<\/li><\/ul>\n\n\n\n<p><strong>By default, where are Docker daemon logs sent to on a Linux system running systemd?<\/strong><\/p>\n\n\n\n<ul class=\"wp-block-list\"><li>syslog<\/li><li>The Linux event viewer<\/li><li><strong>journald (Ans)<\/strong><\/li><\/ul>\n\n\n\n<p><strong>Which of the following is a major goal of Docker volumes?<\/strong><\/p>\n\n\n\n<ul class=\"wp-block-list\"><li>Data replication<\/li><li>Data encryption at-rest<\/li><li>Object storage<\/li><li><strong>Persistent data (Ans)<\/strong><\/li><li>RAID<\/li><\/ul>\n\n\n\n<p><strong>Which are the two major kernel building blocks that containers are built from?<\/strong><\/p>\n\n\n\n<ul class=\"wp-block-list\"><li>Capabilities and seccomp<\/li><li>Namespaces and kernels<\/li><li><strong>Namespaces and control groups (Ans)<\/strong><\/li><li>Capabilities and control groups<\/li><\/ul>\n\n\n\n<p><strong>Which of the following is a recommended best practice?<\/strong><\/p>\n\n\n\n<ul class=\"wp-block-list\"><li><strong>Keep your images small (Ans)<\/strong><\/li><li>Never use the latest image in a repo<\/li><li>Use large images containing lots of tools<\/li><li>Only use Docker Hub<\/li><\/ul>\n\n\n\n<p><strong>Where are Secrets mounted on Linux-based Docker hosts?<\/strong><\/p>\n\n\n\n<ul class=\"wp-block-list\"><li>An encrypted volume mounted at \/run\/secrets<\/li><li><strong>An in memory (tempfs) volume at \/run\/secrets (Ans)<\/strong><\/li><li>initramfs<\/li><li>Solid state volume<\/li><\/ul>\n\n\n\n<p><strong>How are Docker Secrets created on the command line?<\/strong><\/p>\n\n\n\n<ul class=\"wp-block-list\"><li><strong>docker secret create (Ans)<\/strong><\/li><li>docker swarm secret create<\/li><li>They cannot be created on the command line<\/li><\/ul>\n\n\n\n<p><strong>Which of the following is the best high-level description of a Swarm?<\/strong><\/p>\n\n\n\n<ul class=\"wp-block-list\"><li><strong>A secure cluster of Docker nodes (Ans)<\/strong><\/li><li>A tightly-coupled cluster of Docker container<\/li><li>A secure cluster of Docker containers<\/li><li>I tightly-coupled cluster of Linux nodes<\/li><\/ul>\n\n\n\n<p><strong>What is the atomic unit of scheduling in Docker?<\/strong><\/p>\n\n\n\n<ul class=\"wp-block-list\"><li>The service<\/li><li><strong>The container (Ans)<\/strong><\/li><li>The pod<\/li><li>The stack<\/li><li>The swarm<\/li><\/ul>\n\n\n\n<p><strong>Which of the following commands lets you deploy a Docker Stack called stack1 using a Compose file called myapp.yml?<\/strong><\/p>\n\n\n\n<ul class=\"wp-block-list\"><li>docker service deploy -c myapp.yml stack1<\/li><li><strong>docker stack deploy -c myapp.yml stack1 (Ans)<\/strong><\/li><li>docker stack deploy stack1 myapp.yml<\/li><li>docker service deploy stack1 myapp.yml<\/li><\/ul>\n\n\n<div class=\"epyt-gallery\" data-currpage=\"1\" id=\"epyt_gallery_97915\"><iframe loading=\"lazy\"  id=\"_ytid_81489\"  width=\"760\" height=\"427\"  data-origwidth=\"760\" data-origheight=\"427\" src=\"https:\/\/www.youtube.com\/embed\/?enablejsapi=1&#038;autoplay=0&#038;cc_load_policy=0&#038;cc_lang_pref=&#038;iv_load_policy=1&#038;loop=0&#038;rel=1&#038;fs=1&#038;playsinline=0&#038;autohide=2&#038;theme=dark&#038;color=red&#038;controls=1&#038;disablekb=0&#038;\" class=\"__youtube_prefs__  no-lazyload\" title=\"YouTube player\"  data-epytgalleryid=\"epyt_gallery_97915\"  allow=\"fullscreen; accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share\" referrerpolicy=\"strict-origin-when-cross-origin\" allowfullscreen data-no-lazy=\"1\" data-skipgform_ajax_framebjll=\"\"><\/iframe><div class=\"epyt-gallery-list\"><div>Sorry, there was a YouTube error.<\/div><\/div><\/div>","protected":false},"excerpt":{"rendered":"<p>Which of the following best decribes a Docker Image? A read-write template for starting one or more containers A point-in-time snapshot of a container used for backups A data volume&#8230; <\/p>\n","protected":false},"author":1,"featured_media":9473,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_joinchat":[],"footnotes":""},"categories":[4862],"tags":[767,567,766,482],"class_list":["post-9142","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-docker","tag-answer","tag-docker","tag-interview","tag-questions"],"_links":{"self":[{"href":"https:\/\/www.devopsschool.com\/blog\/wp-json\/wp\/v2\/posts\/9142","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.devopsschool.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.devopsschool.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.devopsschool.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.devopsschool.com\/blog\/wp-json\/wp\/v2\/comments?post=9142"}],"version-history":[{"count":2,"href":"https:\/\/www.devopsschool.com\/blog\/wp-json\/wp\/v2\/posts\/9142\/revisions"}],"predecessor-version":[{"id":25008,"href":"https:\/\/www.devopsschool.com\/blog\/wp-json\/wp\/v2\/posts\/9142\/revisions\/25008"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.devopsschool.com\/blog\/wp-json\/wp\/v2\/media\/9473"}],"wp:attachment":[{"href":"https:\/\/www.devopsschool.com\/blog\/wp-json\/wp\/v2\/media?parent=9142"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.devopsschool.com\/blog\/wp-json\/wp\/v2\/categories?post=9142"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.devopsschool.com\/blog\/wp-json\/wp\/v2\/tags?post=9142"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}