Courseiva
SDLC Automation →easyMultiple Choice

DOP-C02 SDLC Automation Practice Question

A development team uses AWS CodeBuild to run unit tests on every commit to the develop branch. The tests take a long time because they download dependencies each time. What should the team do to reduce build time?

⚠ Common exam trap

It's easy for candidates to confuse caching with storage solutions like EFS or with scaling compute resources, failing to recognize that the core issue is repetitive network-bound dependency downloads, which only a cache mechanism can mitigate.

Answer choices

Why each option matters

Answer the question above first, then reveal the full breakdown to understand why each option is right or wrong.

Correct answer & explanation

✓

Enable the local cache feature in CodeBuild.

Enabling the local cache feature in CodeBuild allows the build environment to cache dependencies, such as Maven or npm packages, in a local directory that persists across builds. This avoids re-downloading unchanged dependencies on every commit, significantly reducing build time. The cache can be stored in an S3 bucket or locally on the build instance, and is automatically restored at the start of each build.

Answer analysis

Option-by-option breakdown

For each option: why learners choose it and why it is or isn't the right answer here.

  • ✓

    Enable the local cache feature in CodeBuild.

    Why this is correct

    Enabling the local cache feature in CodeBuild stores resolved dependencies (e.g., Maven, pip, npm packages) in a local directory or an S3-backed bucket between builds. On subsequent builds, CodeBuild restores this cache instantly, eliminating the need to re-download and re-resolve packages. This directly reduces the network I/O bottleneck that dominates unit-test build time, especially for frequently executed builds, and is the correct way to speed up dependency-heavy pipelines.

  • ✗

    Store dependencies in Amazon Elastic File System (EFS) and mount it during builds.

    Why it's wrong here

    Mounting Amazon EFS to the build environment does share dependencies across builds, but EFS is a network file system with NFS latency and lower throughput than the local instance store. Each file read triggers a network round-trip, so resolving dependencies from EFS can be slower than using CodeBuild's native local cache, which reads from a local disk. Additionally, EFS requires VPC configuration and incurs separate storage costs, adding complexity without delivering the speed advantage of a local cache.

  • ✗

    Increase the compute type of the build environment.

    Why it's wrong here

    Increasing the compute type adds more vCPUs and memory, but it does nothing to reduce the time spent downloading dependencies from the internet, which is the true bottleneck for a unit-test build. The build is I/O-bound rather than CPU-bound during the dependency resolution phase, so faster hardware will not meaningfully accelerate that step. You would pay for unused compute capacity while the build still waits on network responses.

  • ✗

    Use multiple builds in parallel for the same commit.

    Why it's wrong here

    Running multiple builds in parallel for the same commit does not make a single build's dependency download any faster; the same dependencies are fetched repeatedly in each parallel build, duplicating work and increasing overall load on the package repository. Parallel execution is only beneficial when you intentionally split a large test suite into independent shards or test different configurations simultaneously. For a single unit-test build, adding parallel builds merely adds cost and resource contention without shortening the critical path.

Quick reference

AWS S3 Storage Class Comparison

Storage ClassMin DurationRetrievalUse Case
S3 StandardNoneImmediateFrequently accessed data
S3 Standard-IA30 daysImmediateInfrequent access, rapid retrieval
S3 One Zone-IA30 daysImmediateNon-critical infrequent data
S3 Intelligent-TieringNoneImmediate–hoursUnknown or changing access patterns
S3 Glacier Instant90 daysMillisecondsArchive with instant retrieval
S3 Glacier Flexible90 daysMinutes–hoursArchive, flexible retrieval
S3 Glacier Deep Archive180 daysHoursLong-term compliance archive

About these practice questions

Courseiva writes every DOP-C02 question from scratch — 1,298 in total, each with an explanation and a wrong-answer breakdown. None are copied from real exams or dumps. Learn why practice questions differ from exam dumps →

How Courseiva writes practice questions · Editorial policy

Same concept, more angles

1 more way this is tested on DOP-C02

These questions test the same concept from different angles. Work through them to make sure you can recognise it however the exam phrases it.

Variation 1. A team uses AWS CodeBuild to run unit tests. They notice that builds are taking longer than expected. The build environment includes many dependencies that are downloaded every time. Which change would MOST reduce build time?

medium
  • A.Enable local caching for dependencies.
  • ✓ B.Store dependencies in an Amazon S3 bucket and configure CodeBuild to use S3 cache.
  • C.Increase the compute type to a larger instance.
  • D.Use Amazon EFS to share dependencies across builds.

Why B: AWS CodeBuild does natively support mounting an Amazon EFS file system into the build container (via the project's fileSystemLocations setting, which requires the CodeBuild project to run inside a VPC). However, it is not the best fix here: EFS mounts require VPC/ENI setup that adds startup latency to every build, and CodeBuild's purpose-built S3 cache (or local cache) is a simpler, natively integrated mechanism specifically designed to persist dependency directories between builds without the networking overhead of a shared file system. S3 caching remains the most direct way to cut repeated dependency downloads.

JA

Written by Johnson Ajibi, MSc IT Security

Senior Network & Security Engineer · founder of Courseiva

This DOP-C02 practice question is part of Courseiva's free Amazon Web Services certification practice question bank. Courseiva provides original exam-style practice questions with explanations, topic-based practice, mock exams, readiness tracking, and study analytics to help learners prepare for the DOP-C02 exam.