programming beginner 10 sample questions

Ci/cd Pipelines MCQ Practice Test

Automating testing and deployment using tools like Jenkins, GitLab CI, or GitHub Actions.

Q1. Your CI/CD pipeline uses a container registry to store Docker images. After a successful build, the pipeline fails to push the image to the registry. The error message indicates insufficient permissions. Which of the following is the MOST likely cause?

Explanation: CI/CD pipelines often rely on service accounts with specific permissions. If the service account used by the pipeline doesn't have the 'push' permission in the container registry, the image upload will fail. While the other options are possible causes of pipeline failure, insufficient permissions are the most likely explanation for a permission-related error.

Q2. In a CI/CD pipeline using AWS CodePipeline, you have a stage that builds a Docker image and pushes it to Amazon Elastic Container Registry (ECR). Which CodePipeline action would MOST likely be responsible for pushing the image to ECR?

Explanation: CodeBuild provides the build environment to execute commands, including the necessary authentication to push images to ECR. While a Lambda function could do this, it's not the standard or most efficient approach within a CodePipeline context. CodeDeploy handles deployments to compute environments, not image pushes to a registry. Manual pushing is not automated and defeats the purpose of a CI/CD pipeline.

Q3. In a CI/CD pipeline using AWS CodePipeline, you have a stage that deploys your application to an Amazon EC2 instance. The deployment fails due to insufficient permissions. Which AWS service is MOST likely responsible for managing the necessary permissions for this deployment stage?

Explanation: AWS Identity and Access Management (IAM) is responsible for managing access to AWS resources. The deployment stage needs appropriate IAM roles and policies to allow it to connect to and deploy to the EC2 instance.

Q4. In a CI/CD pipeline using AWS CodePipeline, your build stage successfully compiles your application but fails to deploy to an AWS Elastic Beanstalk environment due to insufficient permissions. Which of the following is the MOST likely cause of this deployment failure?

Explanation: AWS CodePipeline relies on IAM roles to grant it the necessary permissions to access other AWS services. If the role associated with the pipeline doesn't have the correct permissions to interact with Elastic Beanstalk (like deploying applications), the deployment will fail. While the other options are possible, insufficient permissions are the most common cause of this specific type of deployment failure in an AWS environment.

Q5. In a CI/CD pipeline using AWS CodePipeline, you have a stage that deploys your application to an Amazon EC2 instance. Which AWS service is MOST likely used to securely manage and rotate the EC2 instance's access keys used by the pipeline for deployment?

Explanation: AWS Secrets Manager is specifically designed for securely storing and managing sensitive data like database credentials, API keys, and in this case, EC2 access keys. While IAM handles user permissions and KMS manages encryption keys, Secrets Manager is the best fit for managing secrets directly used in the pipeline.

Q6. In a CI/CD pipeline using AWS CodePipeline, you have a stage that runs unit tests. The tests fail. What is the MOST likely immediate outcome?

Explanation: In most CI/CD setups, including AWS CodePipeline, a failed stage halts the pipeline's progress. This prevents faulty code from being deployed further. Manual intervention is usually required to fix the issue and restart the pipeline from the failed stage or a previous point.

Q7. Your CI/CD pipeline uses a cloud-based container registry (like Docker Hub or Google Container Registry) for storing your application's container images. After a successful build, which step MOST likely directly follows the image build process in your pipeline?

Explanation: Before the application can be deployed or tested, the newly built container image needs to be stored in a central repository (the container registry) that is accessible by other pipeline stages. Pushing the image is the direct next step after building it.

Q8. In a CI/CD pipeline using AWS CodePipeline, you have a stage that deploys your application to an Amazon EC2 instance. This deployment stage fails intermittently due to a lack of sufficient permissions. Which AWS service should be primarily configured to resolve this permission issue?

Explanation: IAM is responsible for managing access control in AWS. The deployment stage needs appropriate IAM roles and policies to allow it to interact with the EC2 instance (e.g., to connect via SSH and deploy files).

Q9. Your CI/CD pipeline uses a Docker image stored in Amazon ECR. After a successful build, the pipeline needs to deploy this image to an ECS cluster. Which AWS service is MOST directly responsible for handling the deployment of the Docker image to the ECS cluster?

Explanation: AWS CodeDeploy is specifically designed for deploying software to various compute services, including Amazon ECS. While Elastic Beanstalk can handle deployments, it's a higher-level service that manages more than just the deployment aspect. Lambda is for serverless functions, and S3 is for object storage.

Q10. In a CI/CD pipeline using AWS CodePipeline, you have a stage that runs unit tests. These tests consistently fail due to a missing environment variable. Where is the BEST place to configure this environment variable to ensure it's available during the unit test stage?

Explanation: Defining the environment variable within the CodePipeline action ensures it's securely passed to the unit test stage without hardcoding sensitive information in the code or relying on potentially inconsistent system-level settings. CodePipeline allows you to pass parameters to actions, making this the most robust and maintainable solution.

That was just a sample. Sign up to unlock the full question bank with timed tests and certificates.

Sign Up Free
Ci/cd Pipelines MCQ Practice Test | Mind Hustle