Questions and answers: Git, Linux & DevOps

Revise Git, Linux & DevOps: here is a selection of questions of every level, with the answer and an explanation. To test yourself without seeing the answers, play the quizzes.

Play the Git, Linux & DevOps quizzes

Easy

Which software project does Linus Torvalds start developing in 1991?

Answer : The Linux kernel

In 1991 Linus Torvalds announces the Linux kernel, the basis of the distributions that bear its name.

In which year did Linus Torvalds create Git?

Answer : 2005

Linus Torvalds created Git in 2005 to manage the development of the Linux kernel.

Which Git command creates a new branch?

Answer : git branch name

git branch name creates the branch; git switch name then lets you move onto it.

Which Git command records the staged changes in the local history?

Answer : git commit -m 'message'

git commit creates a commit from the changes staged with git add; push and pull concern the remote repository.

What is the .gitignore file for?

Answer : Telling Git which files and folders not to track

.gitignore lists the file patterns that Git does not track, such as generated files or dependency folders.

Which Linux command displays the path of the current directory?

Answer : pwd

pwd (print working directory) shows the absolute path of the directory you are in.

Which Linux distribution is derived from Debian?

Answer : Ubuntu

Ubuntu is based on Debian; Fedora, Arch Linux and Slackware have other origins.

Which Linux command searches for a pattern in the contents of a file?

Answer : grep

grep prints the lines that contain the pattern, for example grep error journal.txt.

Medium

What mainly distinguishes a container from a virtual machine?

Answer : The container shares the host kernel, whereas the VM runs its own kernel

A container shares the kernel of the host system, so it is lighter; a virtual machine embeds a complete operating system.

Which Dockerfile instruction sets the starting image?

Answer : FROM

FROM specifies the base image on which the Dockerfile adds its instructions.

What is a container, compared with its image?

Answer : A running instance of an image

An image is a read-only template; the container is a running instance of that image.

What is a Docker volume used for?

Answer : Keeping data beyond the lifetime of a container

A volume is managed by Docker and keeps data even after the container is deleted.

Which Docker tool describes and runs an application made of several containers from a single file?

Answer : Docker Compose

Docker Compose reads a compose.yaml file that describes the services, networks and volumes of the application.

What does a container image registry, such as Docker Hub, store?

Answer : Container images, which can be downloaded and published

Docker Hub is a public image registry, where images can be uploaded and downloaded; a registry can also be private.

What does continuous integration (CI) mean?

Answer : Integrating each developer's code frequently and testing it automatically

CI checks each change with automated tests; continuous delivery and deployment (CD) extend this principle to production.

In Jenkins, what is the name of the file that describes a pipeline and is stored with the code?

Answer : Jenkinsfile

The Jenkinsfile describes the pipeline steps; the Dockerfile describes an image, and the Makefile describes build tasks.

Hard

At which company was Kubernetes designed, inspired by the internal Borg system?

Answer : Google

Kubernetes is inspired by Borg, Google's internal orchestration system, and was released as open source in 2014.

What is the smallest deployable unit in Kubernetes?

Answer : The pod, a group of one or more containers

A pod groups one or more containers that share the same network and storage.

What is the name of the quantified reliability target that an SRE team sets for a service?

Answer : An SLO (Service Level Objective)

The SLO (Service Level Objective) sets the reliability target; the SLA is the contractual commitment to the customer.

Which Kubernetes object provides a stable address to reach a set of pods and spread traffic between them?

Answer : The Service

A Service tracks pods through their labels, even when they are recreated with new IP addresses.

What does the command kubectl get pods do?

Answer : Displays the list of pods in the current namespace

It lists the pods of the active namespace; kubectl get pods -A lists all of them, across all namespaces.

Which cloud model provides virtual machines, storage and networks that the customer configures itself?

Answer : IaaS

With IaaS, the customer manages the system and its applications; with SaaS, it uses ready-to-use software.

In AWS, which service stores objects, such as files accessible through a URL?

Answer : Amazon S3

Amazon S3 is object storage; EC2 provides virtual machines, Lambda functions and RDS managed relational databases.

Which strategy first exposes a small share of traffic to the new version, before extending the rollout?

Answer : Canary deployment

A canary sends part of the traffic to the new version, then extends it if all goes well; blue-green switches all the traffic at once.

Related themes

Play the Git, Linux & DevOps quizzes