Courseiva
SDLC Automation →easyMultiple Choice

DOP-C02 SDLC Automation Practice Question

A developer is using AWS CodeBuild to compile code. The build takes a long time because dependencies are downloaded each time. What can the developer do to reduce build time?

⚠ Common exam trap

It's easy for candidates to confuse scaling compute resources (Option D) or parallelizing work (Option A) with solving a network-bound dependency download problem, failing to recognize that caching is the only option that directly eliminates redundant downloads.

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 caching in the build project to store dependencies in Amazon S3.

Enabling caching in AWS CodeBuild allows the build project to store frequently downloaded dependencies (e.g., Maven, npm, pip packages) in an Amazon S3 bucket. On subsequent builds, CodeBuild retrieves the cached dependencies from S3 instead of re-downloading them from the internet, which significantly reduces build time. This is the most direct and efficient solution for the described problem of repeated dependency downloads.

Answer analysis

Option-by-option breakdown

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

  • ✗

    Split the build into multiple parallel build actions.

    Why it's wrong here

    Splitting a build into parallel actions in a pipeline increases overall throughput by running independent stages concurrently, but it does not shorten the execution time of the sequential compilation steps within a single CodeBuild project. A typical compile has a dependency chain (configure, compile, link, test) that must execute in order; forcing parallelism would require decomposing the build into independently compilable modules, which is a major refactor and introduces overhead for artifact passing. Thus, it addresses pipeline throughput, not the specific slow build duration.

  • ✗

    Use multiple build environments to distribute the work.

    Why it's wrong here

    Configuring multiple CodeBuild environments does not distribute one build's workload; each environment is an isolated container for a separate build job per project. CodeBuild associates one environment with one build run, so spinning up several environments would simply create multiple independent builds rather than splitting the compilation of a single project. Multiple environments are intended for building for different platforms (e.g., Linux vs. Windows) or runtimes, not for partitioning one build's tasks, so it leaves the original slow build untouched.

  • ✓

    Enable caching in the build project to store dependencies in Amazon S3.

    Why this is correct

    Enabling S3 caching in a CodeBuild project stores the dependency cache (e.g., Maven's .m2, npm's node_modules, or Python's pip cache) in an Amazon S3 bucket between builds, so the build only downloads changed or missing packages instead of re-fetching the full dependency set each time. This directly reduces the time spent on network I/O, which is often the dominant cost for builds with many third-party libraries. By setting the 'cache' type to S3 and specifying a bucket, subsequent builds restore the cache at the start, making the compilation faster. This is the recommended approach because it targets the common bottleneck of dependency resolution.

  • ✗

    Use a larger compute type for the build project.

    Why it's wrong here

    Choosing a larger compute type (e.g., from 2 GB to 7 GB memory or more vCPUs) only increases CPU and memory resources, but if the build's primary bottleneck is downloading dependencies from the internet, the faster instance still saturates the same network bandwidth and provides negligible speedup. A larger instance may marginally speed up compilation via more cores, but it will not reduce the dependency download time that caching would. Additionally, it increases cost per minute without guaranteeing a corresponding reduction in build duration, making it an ineffective fix for dependency-heavy build times.

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

One of 1,298 original DOP-C02 practice questions on Courseiva, each with a full explanation and wrong-answer analysis — not exam dumps or protected exam content. Learn why practice questions differ from exam dumps →

How Courseiva writes practice questions · Editorial policy

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.