CI/CD and Deployment - Quiz#

No.

Training Unit

Lecture

Training content

Question

Level

Mark

Answer

Answer Option A

Answer Option B

Answer Option C

Answer Option D

Explanation

1

Unit 2: CI/CD and Deployment

Lec2

CI Fundamentals

What does CI stand for in CI/CD?

Easy

1

B

Continuous Inspection

Continuous Integration

Code Integration

Container Integration

CI stands for Continuous Integration - the practice of frequently merging code changes into a shared repository with automated builds and tests.

2

Unit 2: CI/CD and Deployment

Lec2

CI Principles

Which is a key principle of Continuous Integration?

Easy

1

A

Developers commit code at least daily

Deployments happen weekly

Tests run manually

Builds are triggered monthly

A key CI principle is that developers commit code frequently (at least daily), and each commit triggers automated builds and tests.

3

Unit 2: CI/CD and Deployment

Lec2

CD Concepts

What is the main difference between Continuous Delivery and Continuous Deployment?

Medium

2

C

Delivery is faster than Deployment

Delivery doesn’t include testing

Delivery requires manual approval before production

Deployment requires manual approval before production

Continuous Delivery keeps code always deployable but requires manual approval for production. Continuous Deployment automatically deploys every change.

4

Unit 2: CI/CD and Deployment

Lec2

GitHub Actions

In GitHub Actions, what is a “workflow”?

Easy

1

D

A single command to run

A type of test

A GitHub repository

An automated process defined in a YAML file

A workflow is an automated process defined in a YAML file in the .github/workflows/ directory, triggered by repository events.

5

Unit 2: CI/CD and Deployment

Lec2

GitHub Actions

What is the purpose of the needs keyword in GitHub Actions?

Medium

2

B

To specify required environment variables

To define job dependencies

To list required secrets

To specify required permissions

The needs keyword defines job dependencies, ensuring a job waits for specified jobs to complete before running.

6

Unit 2: CI/CD and Deployment

Lec2

GitHub Actions

Where should GitHub Actions workflow files be stored?

Easy

1

A

.github/workflows/

.actions/

workflows/

.ci/

GitHub Actions workflow files must be stored in the .github/workflows/ directory with a .yml or .yaml extension.

7

Unit 2: CI/CD and Deployment

Lec2

Workflow Triggers

Which trigger runs a workflow on a schedule?

Easy

1

C

push

pull_request

schedule

workflow_dispatch

The schedule trigger uses cron syntax to run workflows on a schedule, e.g., schedule: - cron: '0 0 * * *' for daily runs.

8

Unit 2: CI/CD and Deployment

Lec2

Workflow Triggers

What does workflow_dispatch trigger allow?

Medium

2

D

Automatic deployment

Scheduled runs

PR comments

Manual workflow trigger from GitHub UI

The workflow_dispatch trigger allows you to manually run a workflow from the GitHub Actions UI with optional input parameters.

9

Unit 2: CI/CD and Deployment

Lec2

Matrix Builds

What is the purpose of matrix builds in CI/CD?

Medium

2

A

Test across multiple configurations simultaneously

Build multiple applications at once

Create multiple Docker images

Deploy to multiple servers

Matrix builds allow testing across multiple configurations (OS, language versions) simultaneously, running jobs in parallel.

10

Unit 2: CI/CD and Deployment

Lec2

Secrets

How should secrets be accessed in GitHub Actions?

Easy

1

B

Hardcoded in the workflow file

Using secrets.SECRET_NAME expression syntax

Stored in a .env file

Passed as command line arguments

Secrets should be stored in GitHub’s encrypted secrets storage and accessed using the secrets expression syntax in workflow files.

11

Unit 2: CI/CD and Deployment

Lec2

Caching

Why is dependency caching important in CI/CD pipelines?

Easy

1

C

To reduce security risks

To simplify configuration

To speed up builds by reusing cached dependencies

To enable parallel execution

Caching dependencies avoids re-downloading them on every build, significantly speeding up pipeline execution time.

12

Unit 2: CI/CD and Deployment

Lec2

Test Pyramid

According to the test pyramid, which type of tests should be most numerous?

Medium

2

A

Unit tests

Integration tests

E2E tests

Manual tests

The test pyramid recommends ~70% unit tests (fast, cheap), ~20% integration tests, and ~10% E2E tests (slow, expensive).

13

Unit 2: CI/CD and Deployment

Lec2

GitLab CI

In GitLab CI, what keyword is used to define services like PostgreSQL for tests?

Medium

2

B

dependencies

services

containers

databases

GitLab CI uses the services keyword to define supporting containers like databases that run alongside your test jobs.

14

Unit 2: CI/CD and Deployment

Lec2

Blue-Green Deployment

What is a key benefit of Blue-Green deployment?

Medium

2

D

Reduced infrastructure costs

Faster deployments

Less code to maintain

Zero-downtime deployment with instant rollback

Blue-Green deployment maintains two identical environments, allowing instant traffic switching and immediate rollback if issues occur.

15

Unit 2: CI/CD and Deployment

Lec2

Canary Deployment

What characterizes a Canary deployment strategy?

Medium

2

C

Deploying to all servers simultaneously

Using two identical environments

Gradually rolling out changes to a subset of users

Deploying only to development environments

Canary deployment gradually rolls out changes to a small percentage of users first, monitoring for issues before full deployment.

16

Unit 2: CI/CD and Deployment

Lec2

GitOps

What is the core principle of GitOps?

Medium

2

A

Git is the single source of truth for infrastructure

Using GitHub exclusively

All code must be reviewed

Automated testing only

GitOps uses Git as the single source of truth for both application and infrastructure state, with automated reconciliation.

17

Unit 2: CI/CD and Deployment

Lec2

Pipeline Design

Which principle states that quick checks should run first in a pipeline?

Easy

1

B

Parallel Execution

Fail Fast

Idempotency

Cache First

The Fail Fast principle ensures quick checks (lint, format) run first so failures are detected early, saving time and resources.

18

Unit 2: CI/CD and Deployment

Lec2

Security

Why should you pin action versions with SHA hashes in GitHub Actions?

Hard

3

C

To improve performance

To enable caching

To prevent supply chain attacks from compromised actions

To reduce storage usage

Pinning actions to specific SHA hashes ensures you use a known-good version, preventing potential supply chain attacks if an action is compromised.

19

Unit 2: CI/CD and Deployment

Lec2

ML Pipelines

What additional concern do ML pipelines have compared to traditional CI/CD?

Hard

3

D

Code formatting

Container building

Secret management

Model validation and performance regression testing

ML pipelines must validate model performance and catch accuracy regressions, in addition to traditional software testing concerns.

20

Unit 2: CI/CD and Deployment

Lec2

GitHub vs GitLab

In GitLab CI, where is the pipeline configuration stored?

Easy

1

A

.gitlab-ci.yml

.github/workflows/*.yml

gitlab-pipelines.yml

.ci/config.yml

GitLab CI configuration is stored in a single .gitlab-ci.yml file in the repository root.