Essential GitLab CI/CD Fundamentals Quiz Quiz

Assess your understanding of core GitLab CI/CD concepts, pipelines, job configuration, and environment variables. This quiz is designed to help beginners strengthen their knowledge of continuous integration and continuous deployment workflows.

  1. Purpose of YAML in CI/CD

    Which file format is primarily used to define the configuration for pipelines in GitLab CI/CD?

    1. YAML
    2. CSV
    3. XML
    4. JSON

    Explanation: YAML is used for writing configuration files due to its simplicity and human readability. JSON and XML are also markup formats but are not used for defining pipelines in this context. CSV is a data format for tabular data, not configuration.

  2. Pipeline Triggering

    What typically triggers a pipeline to run in a Git-based CI/CD system when no manual interaction is required?

    1. Restarting your computer
    2. Changing your password
    3. Manually clicking on dashboard
    4. Pushing code to a repository

    Explanation: Pushing code to a repository automatically triggers the pipeline process in CI/CD by detecting new commits. Manually clicking on the dashboard is not automatic, and actions like restarting your computer or changing a password are unrelated to pipelines.

  3. Defining Jobs in a Pipeline

    In a typical pipeline configuration, what is a 'job'?

    1. A file storage location
    2. A single step with specific commands to execute
    3. An email notification
    4. A group of users

    Explanation: A job is a defined task or set of commands executed as part of a pipeline. It is not a group of users or an email notification, and has nothing to do with storage locations. Its purpose is to perform individual steps such as building or testing code.

  4. Stages in CI/CD

    What is the primary purpose of using 'stages' in a pipeline configuration file?

    1. To block unauthorized access
    2. To store user credentials
    3. To specify the order of job execution
    4. To increase server speed

    Explanation: Stages divide the pipeline into logical sections and enforce execution order, such as build, test, and deploy. They don't increase server speed, store credentials, or serve as access control mechanisms.

  5. Role of Environment Variables

    Why are environment variables commonly used in CI/CD pipelines?

    1. To backup personal documents
    2. To manage internet browsing history
    3. To store configuration values securely
    4. To track password expiration dates

    Explanation: Environment variables allow storage of confidential or environment-specific data securely, like API keys or tokens. They are not meant for backing up documents, managing browser history, or tracking password expiration dates, which are different use cases.

  6. Pipeline Visual Representation

    What is commonly used to visualize the flow and status of jobs across different stages in a CI/CD pipeline?

    1. A calendar
    2. A pipeline graph
    3. A chat window
    4. A search bar

    Explanation: A pipeline graph visually depicts job progression and stage completion, making it easy to understand the CI/CD workflow. Calendars manage dates, chat windows are for messaging, and search bars locate information, all unrelated to pipeline visualization.

  7. Artifacts in CI/CD

    What is an artifact in the context of CI/CD pipelines?

    1. A programming language
    2. A file or result saved from a job for later use
    3. A user’s profile photo
    4. An error message

    Explanation: Artifacts are files or result outputs generated by jobs and preserved for later stages or downloads, such as compiled binaries. A user's profile photo or an error message isn't considered an artifact, nor is a programming language.

  8. Automatic Job Execution

    Jobs within the same stage of a pipeline configuration will typically run in which manner by default?

    1. One after another
    2. Only after approval
    3. Once per month
    4. In parallel

    Explanation: By default, jobs within the same stage are executed in parallel to optimize speed. Running one after another refers to sequential execution, which is not standard within a stage. Triggering jobs only after approval or monthly is unrelated to default job execution behavior.

  9. Conditional Execution

    Which keyword is used in a pipeline job configuration to ensure a job runs only under specific conditions, such as only when certain files change?

    1. script
    2. image
    3. only
    4. path

    Explanation: The 'only' keyword is used to set conditions for job execution based on branches, tags, or file changes. 'Script' specifies which commands are run, 'image' defines the container image, and 'path' is not a recognized keyword for conditional execution.

  10. Shared Runners Usage

    What is a 'shared runner' in a CI/CD system?

    1. A build agent available to multiple projects
    2. A private company workstation
    3. A dual-monitor setup
    4. A grouped pipeline configuration file

    Explanation: A shared runner is a build agent or machine used for executing jobs in various projects, reducing the need for project-specific resources. It is not a workstation, nor is it a configuration file or hardware arrangement like dual-monitors.