{"id":9102,"date":"2020-01-21T06:57:33","date_gmt":"2020-01-21T06:57:33","guid":{"rendered":"https:\/\/www.devopsschool.com\/blog\/?p=9102"},"modified":"2021-11-13T06:54:52","modified_gmt":"2021-11-13T06:54:52","slug":"docker-interview-questions-and-answer-part-22","status":"publish","type":"post","link":"https:\/\/www.devopsschool.com\/blog\/docker-interview-questions-and-answer-part-22\/","title":{"rendered":"Docker Interview Questions and Answer Part \u2013 22"},"content":{"rendered":"\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\n<p><strong>Which of the following open-source tools is the underlying technology for Docker Swarm?<\/strong><\/p>\n\n\n\n<ul class=\"wp-block-list\"><li>containerd<\/li><li><strong>SwarmKit (Ans)<\/strong><\/li><li>Kubernetes<\/li><li>InfraKit<\/li><li>The Docker daemon<\/li><\/ul>\n\n\n\n<p><strong>Docker UCP implements RBAC via Grants. Which of the following make up a Grant?<\/strong><\/p>\n\n\n\n<ul class=\"wp-block-list\"><li>Subjects, roles, and nodes<\/li><li><strong>Subjects, roles, and collections (Ans)<\/strong><\/li><li>Roles and collections<\/li><\/ul>\n\n\n\n<p><strong>Which of the following built-in Docker networks creates a single layer-2 container-only network across multiple Docker hosts that can be on different underlying networks?<\/strong><\/p>\n\n\n\n<ul class=\"wp-block-list\"><li>Bridge<\/li><li>MACVLAN<\/li><li><strong>Overlay (Ans)<\/strong><\/li><li>NAT<\/li><\/ul>\n\n\n\n<p><strong>Which Docker command shows the network ports that a container is exposed on?<\/strong><\/p>\n\n\n\n<ul class=\"wp-block-list\"><li>docker container ports<\/li><li><strong>docker port (Ans)<\/strong><\/li><li>docker network &#8211;port<\/li><\/ul>\n\n\n\n<p><strong>What happens when you perform a docker volume rm against a volume attached to a running container?<\/strong><\/p>\n\n\n\n<ul class=\"wp-block-list\"><li><strong>The command will fail (Ans)<\/strong><\/li><li>The volume will be deleted<\/li><li>The volume and the container will be deleted<\/li><li>You will be asked to confirm the command<\/li><\/ul>\n\n\n\n<p><strong>Which set of container-related Linux tools did Docker&#8217;s <code>libcontainer<\/code> replace?<\/strong><\/p>\n\n\n\n<ul class=\"wp-block-list\"><li>LXD<\/li><li>libc<\/li><li>AUFS<\/li><li><strong>LXC (Ans)<\/strong><\/li><\/ul>\n\n\n\n<p><strong>Which of the following is needed to deploy a Docker Stack?<\/strong><\/p>\n\n\n\n<ul class=\"wp-block-list\"><li>Compose v2 file format<\/li><li>Kubernetes<\/li><li><strong>Compose v3 file format (Ans)<\/strong><\/li><li>Docker Cloud<\/li><\/ul>\n\n\n\n<p><strong>What is the name of the configuration file that describes how to build a new Docker image with your app-code inside?<\/strong><\/p>\n\n\n\n<ul class=\"wp-block-list\"><li><strong>dockerfile (Ans)<\/strong><\/li><li>config.json<\/li><li>docker-file<\/li><li>dockerfile.json<\/li><\/ul>\n\n\n\n<p><strong>Which of the following is the worst number of managers for high availability?<\/strong><\/p>\n\n\n\n<ul class=\"wp-block-list\"><li>1<\/li><li>5<\/li><li><strong>2 (Ans)<\/strong><\/li><li>7<\/li><\/ul>\n\n\n\n<p><strong>Which command can you use to get a shell session inside of a container?<\/strong><\/p>\n\n\n\n<ul class=\"wp-block-list\"><li>docker container login<\/li><li><strong>docker container exec (Ans)<\/strong><\/li><li>docker container shell<\/li><li>docker container ssh<\/li><\/ul>\n\n\n\n<p><strong>Which Docker EE technology performs layer-7 (application layer) load balancing?<\/strong><\/p>\n\n\n\n<ul class=\"wp-block-list\"><li>The ingress network<\/li><li>The Service Mesh<\/li><li><strong>The HTTP Routing Mesh (HRM) (Ans)<\/strong><\/li><\/ul>\n\n\n\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<div class=\"epyt-gallery\" data-currpage=\"1\" id=\"epyt_gallery_91280\"><iframe loading=\"lazy\"  id=\"_ytid_25415\"  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_91280\"  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 is a recommended best practice? Keep your images small (Ans) Never use the latest image in a repo Use large images containing lots of tools Only&#8230; <\/p>\n","protected":false},"author":1,"featured_media":10444,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_joinchat":[],"footnotes":""},"categories":[4862],"tags":[767,567,766,482],"class_list":["post-9102","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\/9102","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=9102"}],"version-history":[{"count":2,"href":"https:\/\/www.devopsschool.com\/blog\/wp-json\/wp\/v2\/posts\/9102\/revisions"}],"predecessor-version":[{"id":25032,"href":"https:\/\/www.devopsschool.com\/blog\/wp-json\/wp\/v2\/posts\/9102\/revisions\/25032"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.devopsschool.com\/blog\/wp-json\/wp\/v2\/media\/10444"}],"wp:attachment":[{"href":"https:\/\/www.devopsschool.com\/blog\/wp-json\/wp\/v2\/media?parent=9102"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.devopsschool.com\/blog\/wp-json\/wp\/v2\/categories?post=9102"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.devopsschool.com\/blog\/wp-json\/wp\/v2\/tags?post=9102"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}