{"id":9136,"date":"2020-01-22T06:02:12","date_gmt":"2020-01-22T06:02:12","guid":{"rendered":"https:\/\/www.devopsschool.com\/blog\/?p=9136"},"modified":"2025-07-12T05:41:46","modified_gmt":"2025-07-12T05:41:46","slug":"docker-interview-questions-and-answer-part-31","status":"publish","type":"post","link":"https:\/\/www.devopsschool.com\/blog\/docker-interview-questions-and-answer-part-31\/","title":{"rendered":"Docker Interview Questions and Answer Part \u2013 31"},"content":{"rendered":"\n<p><strong>What is the preferred way to deploy and manage a Docker Stack?<\/strong><\/p>\n\n\n\n<ul class=\"wp-block-list\"><li><strong>The declarative way via config files (Ans)<\/strong><\/li><li>The imperative way via commands<\/li><\/ul>\n\n\n\n<p><strong>Which of the following Docker Engine component is a Cloud Native Computing Foundation (CNCF) project?<\/strong><\/p>\n\n\n\n<ul class=\"wp-block-list\"><li><strong>containerd (Ans)<\/strong><\/li><li>The Docker Remote API<\/li><li>runc<\/li><li>The daemon<\/li><\/ul>\n\n\n\n<p><strong>Which components constitute the control plane aspects of a Docker UCP cluster?<\/strong><\/p>\n\n\n\n<ul class=\"wp-block-list\"><li>UCP\/Swarm minions<\/li><li>UCP\/Swarm workers<\/li><li><strong>UCP\/Swarm managers (Ans)<\/strong><\/li><\/ul>\n\n\n\n<p><strong>Which key combination will disconnect your shell from an interactive container, and return you to the shell of your Docker host without killing the container?<\/strong><\/p>\n\n\n\n<ul class=\"wp-block-list\"><li>Ctrl+Z<\/li><li>Ctrl+C<\/li><li>Ctrl+esc<\/li><li><strong>Ctrl+P+Q (Ans)<\/strong><\/li><\/ul>\n\n\n\n<p><strong>Which of the following network types would you choose if you needed your containers to be first class on one of your existing VLANs?<\/strong><\/p>\n\n\n\n<ul class=\"wp-block-list\"><li>Bridge<\/li><li>NAT<\/li><li><strong>MACVLAN (Ans)<\/strong><\/li><li>Overlay<\/li><\/ul>\n\n\n\n<p><strong>What type of storage takes care of a containers union filesystem\/union mount?<\/strong><\/p>\n\n\n\n<ul class=\"wp-block-list\"><li><strong>Graph driver (snapshotter) (Ans)<\/strong><\/li><li>Volume data<\/li><li>Copy-on-write (CoW)<\/li><li>Object storage<\/li><\/ul>\n\n\n\n<p><strong>What happens to the data in a volume when the last container it was connected to is deleted?<\/strong><\/p>\n\n\n\n<ul class=\"wp-block-list\"><li><strong>The data remains intact (Ans)<\/strong><\/li><li>The data is deleted along with the last container<\/li><\/ul>\n\n\n\n<p><strong>How can you inspect the unencrypted contents of a Docker secret?<\/strong><\/p>\n\n\n\n<ul class=\"wp-block-list\"><li>With the docker secret inspect command on the leader manager in a Swarm<\/li><li><strong>You cannot (Ans)<\/strong><\/li><li>With the docker secret inspect command<\/li><\/ul>\n\n\n\n<p><strong>Which of the following describes how Docker manages a deployed stack?<\/strong><\/p>\n\n\n\n<ul class=\"wp-block-list\"><li><strong>It constantly monitors the state of the stack via reconciliation loops and makes sure actual-state and desired-state match (Ans)<\/strong><\/li><li>Swarm checks the health of the stack every 60 seconds to make sure actual-state matches desired-state<\/li><li>Fire and forget. Once the stack is deployed, it must be monitored via external tools.<\/li><\/ul>\n\n\n\n<p><strong>What are some of the benefits Docker Trusted Registry (DTR) has over Docker Hub?<\/strong><\/p>\n\n\n\n<ul class=\"wp-block-list\"><li><strong>On premises, image promotions (Ans)<\/strong><\/li><li>Public and private repos<\/li><li>Image scanning<\/li><\/ul>\n\n\n\n<p><strong>Which Docker command lists all of the managers and workers in a Swarm?<\/strong><\/p>\n\n\n\n<ul class=\"wp-block-list\"><li>docker swarm info<\/li><li>docker swarm nodes<\/li><li><strong>docker node ls (Ans)<\/strong><\/li><li>docker swarm ls<\/li><\/ul>\n\n\n\n<p><strong>Which of the following is the default network a container will join of you don&#8217;t override with the &#8211;network flag?<\/strong><\/p>\n\n\n\n<ul class=\"wp-block-list\"><li>Overlay<\/li><li>MACVLAN<\/li><li><strong>Bridge (Ans)<\/strong><\/li><li>Wifi<\/li><\/ul>\n\n\n\n<p><strong>Which two docker container run flags are commonly used to create a container you can log-on to and interact with?<\/strong><\/p>\n\n\n\n<ul class=\"wp-block-list\"><li>-ahl<\/li><li><strong>-it (Ans)<\/strong><\/li><li>-ssh<\/li><li>-telnet<\/li><\/ul>\n\n\n\n<p><strong>Which of the following describes data that we need to keep long-term?<\/strong><\/p>\n\n\n\n<ul class=\"wp-block-list\"><li>Immutable<\/li><li><strong>Persistent (Ans)<\/strong><\/li><li>Ephemeral<\/li><li>Non-persistent<\/li><\/ul>\n\n\n\n<p><strong>Where does a container&#8217;s graph driver storage usually exist?<\/strong><\/p>\n\n\n\n<ul class=\"wp-block-list\"><li>\/etc\/docker (Linux) and C:\\ProgramData\\Docker\\windowsfilter (Windows)<\/li><li><strong>\/var\/lib\/docker (Linux) and C:\\ProgramData\\Docker\\windowsfilter (Windows) (Ans)<\/strong><\/li><li>\/var\/run\/docker (Linux) and C:\\Program Files\\Docker\\windowsntfs (Windows)<\/li><\/ul>\n\n\n\n<p><strong>Which of the following describe some of the OS-level constructs that each container gets?<\/strong><\/p>\n\n\n\n<ul class=\"wp-block-list\"><li><strong>Process trees, network stacks, and users (Ans)<\/strong><\/li><li>Virtual CPU and virtual RAM<\/li><li>Kernel modes<\/li><li>Kernel rung buffers and syscall tables<\/li><\/ul>\n\n\n\n<p><strong>How does the Docker Engine expose the Docker API?<\/strong><\/p>\n\n\n\n<ul class=\"wp-block-list\"><li><strong>As a versioned HTTP REST interface (Ans)<\/strong><\/li><li>gRPC on a Unix socket<\/li><\/ul>\n\n\n\n<p><strong>Which of the following describes a potential advantage a Hyper-V container has over a native Windows container?                       <\/strong><\/p>\n\n\n\n<ul class=\"wp-block-list\"><li><strong>You can run a different OS\/kernel for each container (Ans)<\/strong><\/li><li>They start faster<\/li><li>They implement open CNCF standards<\/li><li>You ran run more on a single Windows Docker host<\/li><\/ul>\n\n\n\n<p><strong>Which of the following best describes a Docker UCP cluster?<\/strong><\/p>\n\n\n\n<ul class=\"wp-block-list\"><li>A group of Swarm managers and Kubernetes minions<\/li><li>A group of Swarm managers and Kubernetes minions<\/li><li><strong>A cluster of Swarm-based manager and worker nodes (Ans)<\/strong><\/li><\/ul>\n\n\n\n<p><strong>What do Swarm managers and workers use their client certificates for?<\/strong><\/p>\n\n\n\n<ul class=\"wp-block-list\"><li>Role authorization and cluster join token<\/li><li><strong>Mutual authentication, role authorization, and transport encryption (Ans)<\/strong><\/li><li>Transport encryption<\/li><li>Mutual authentication and transport encryption<\/li><\/ul>\n\n\n\n<p><strong>How many processes does a Linux-based Docker container normally run?<\/strong><\/p>\n\n\n\n<ul class=\"wp-block-list\"><li>One per image layer<\/li><li><strong>One (Ans)<\/strong><\/li><li>Two<\/li><\/ul>\n\n\n\n<p><strong>How can you login to your local DTR so that you can push and pull images from it?<\/strong><\/p>\n\n\n\n<ul class=\"wp-block-list\"><li><strong>docker login  (Ans)<\/strong><\/li><li>dtr login <\/li><li>docker ucp login<\/li><\/ul>\n\n\n\n<p><strong>How can you make a Swarm service accessible from all nodes in a Swarm on the same port?<\/strong><\/p>\n\n\n\n<ul class=\"wp-block-list\"><li>Create enough replicas so that there is one on each Swarm node<\/li><li><strong>Map the service to a port with the -p flag (Ans)<\/strong><\/li><li>Create a global service<\/li><li>Create an external load balancer<\/li><\/ul>\n\n\n<div class=\"epyt-gallery\" data-currpage=\"1\" id=\"epyt_gallery_94449\"><iframe loading=\"lazy\"  id=\"_ytid_65607\"  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_94449\"  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>What is the preferred way to deploy and manage a Docker Stack? The declarative way via config files (Ans) The imperative way via commands Which of the following Docker Engine&#8230; <\/p>\n","protected":false},"author":1,"featured_media":9475,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_joinchat":[],"footnotes":""},"categories":[4862],"tags":[767,567,766,482],"class_list":["post-9136","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\/9136","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=9136"}],"version-history":[{"count":3,"href":"https:\/\/www.devopsschool.com\/blog\/wp-json\/wp\/v2\/posts\/9136\/revisions"}],"predecessor-version":[{"id":25011,"href":"https:\/\/www.devopsschool.com\/blog\/wp-json\/wp\/v2\/posts\/9136\/revisions\/25011"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.devopsschool.com\/blog\/wp-json\/wp\/v2\/media\/9475"}],"wp:attachment":[{"href":"https:\/\/www.devopsschool.com\/blog\/wp-json\/wp\/v2\/media?parent=9136"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.devopsschool.com\/blog\/wp-json\/wp\/v2\/categories?post=9136"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.devopsschool.com\/blog\/wp-json\/wp\/v2\/tags?post=9136"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}