Question 1,325 of 1,750
SDLC AutomationhardMultiple ChoiceObjective-mapped

Using Local Caching in AWS CodeBuild to Speed Up Builds by Eliminating Repeated Downloads

This DOP-C02 practice question tests your understanding of sdlc automation. The scenario asks you to isolate a root cause — eliminate options that address a different problem before choosing. After answering, compare your reasoning against the explanation and wrong-answer breakdown below. Once you have made your selection, read the full explanation to reinforce the concept and understand why each distractor is designed to mislead on exam day.

A DevOps engineer is troubleshooting a slow AWS CodeBuild project. The build is a Java application that compiles source code and runs tests. The build environment uses a general1.large compute type. The build duration has increased from 5 minutes to 15 minutes over the past month. The engineer notices that the build logs show 'Downloading...' messages for Maven dependencies for several minutes. What is the most cost-effective way to reduce the build time?

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 local caching in the CodeBuild project for dependencies

Option D is correct because enabling local caching in AWS CodeBuild allows the build environment to cache Maven dependencies in the local file system across builds. This eliminates the need to re-download dependencies from remote repositories each time, directly addressing the 'Downloading...' messages in the logs. It is the most cost-effective solution as it requires no additional AWS services or compute upgrades.

Key principle: Answer the scenario, not the keyword: identify the specific constraint before choosing the most familiar-sounding option.

Answer analysis

Option-by-option breakdown

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

  • Configure the build to use a VPC with a NAT gateway

    Why it's wrong here

    NAT gateway does not cache dependencies.

  • Use AWS CodeArtifact as a proxy for Maven dependencies

    Why it's wrong here

    CodeArtifact still requires downloading; caching is more cost-effective.

  • Change the compute type to general1.2xlarge

    Why it's wrong here

    More compute does not speed up network downloads.

  • Enable local caching in the CodeBuild project for dependencies

    Why this is correct

    Local caching stores dependencies across builds.

    Related concept

    Read the scenario before looking for a memorised answer.

Common exam traps

Common exam trap: answer the scenario, not the keyword

The trap here is that candidates often assume upgrading compute resources (Option C) or adding network components (Option A) will fix performance issues, when the actual bottleneck is repetitive network downloads that can be eliminated with caching.

Detailed technical explanation

How to think about this question

CodeBuild local caching stores build artifacts and dependencies in a cache directory (e.g., /root/.m2 for Maven) that persists between builds on the same build environment. The cache is stored in Amazon S3 under the hood, but the build agent mounts it locally, reducing network round trips. In real-world scenarios, this can cut build times by 50-80% for dependency-heavy projects, especially when combined with incremental compilation.

KKey Concepts to Remember

  • Read the scenario before looking for a memorised answer.
  • Find the constraint that changes the correct option.
  • Eliminate answers that are true in general but not in this case.

TExam Day Tips

  • Watch for words such as best, first, most likely and least administrative effort.
  • Review why wrong options are wrong, not only why the correct option is correct.

Key takeaway

Answer the scenario, not the keyword: identify the specific constraint before choosing the most familiar-sounding option.

Real-world example

How this comes up in practice

A startup's cloud architect reviews their monthly bill and notices costs are higher than expected for a long-running batch job. Switching from on-demand instances to Reserved Instances — or using Spot/Preemptible VMs — can reduce compute costs by up to 72 %. Questions like this test whether you understand the tradeoffs between commitment, flexibility, and cost across cloud pricing models.

What to study next

Got this wrong? Here's your next step.

Identify which exam domain this question belongs to, review the core concept, then practise similar questions from the same domain.

Related practice questions

Related DOP-C02 practice-question pages

Use these pages to review the topic behind this question. This is how one missed question becomes focused revision.

Practice this exam

Start a free DOP-C02 practice session

Short sessions build daily habit. Longer sessions build exam-day stamina. Try a timed session to simulate real conditions.

FAQ

Questions learners often ask

What does this DOP-C02 question test?

SDLC Automation — This question tests SDLC Automation — Read the scenario before looking for a memorised answer..

What is the correct answer to this question?

The correct answer is: Enable local caching in the CodeBuild project for dependencies — Option D is correct because enabling local caching in AWS CodeBuild allows the build environment to cache Maven dependencies in the local file system across builds. This eliminates the need to re-download dependencies from remote repositories each time, directly addressing the 'Downloading...' messages in the logs. It is the most cost-effective solution as it requires no additional AWS services or compute upgrades.

What should I do if I get this DOP-C02 question wrong?

Identify which exam domain this question belongs to, review the core concept, then practise similar questions from the same domain.

What is the key concept behind this question?

Read the scenario before looking for a memorised answer.

About these practice questions

Courseiva creates original exam-style practice questions with explanations and wrong-answer analysis. It does not publish real exam questions, exam dumps, or protected exam content. Learn why practice questions differ from exam dumps →

How Courseiva writes practice questions · Editorial policy

Same concept, more angles

2 more ways 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 company uses AWS CodeBuild to compile and test code. The build takes 30 minutes, but the team wants to reduce build time by caching dependencies. Which approach should be used?

medium
  • A.Remove unnecessary dependencies from the build specification.
  • B.Store dependencies in an S3 bucket and download them before each build.
  • C.Use AWS CodeArtifact to store dependencies and pull them during build.
  • D.Enable local caching in the build project configuration.

Why D: Option D is correct because AWS CodeBuild's local caching feature allows you to cache intermediate build artifacts (such as dependencies) in a local directory on the build instance, which persists across builds for the same build project. This eliminates the need to re-download dependencies from external sources for every build, significantly reducing build time. The cache is stored in a Docker volume or S3 bucket, but the key benefit is that it is automatically managed by CodeBuild without manual download steps.

Variation 2. 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?

easy
  • A.Split the build into multiple parallel build actions.
  • B.Use multiple build environments to distribute the work.
  • C.Enable caching in the build project to store dependencies in Amazon S3.
  • D.Use a larger compute type for the build project.

Why C: Option C is correct because 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.

Keep practising

More DOP-C02 practice questions

Last reviewed: Jul 4, 2026

Question Discussion

Share a tip, memory trick, or ask about the reasoning behind this question. Do not post real exam questions, leaked content, braindumps, or copyrighted exam material. Comments are moderated and may be removed without notice.

Loading comments…

Sign in to join the discussion.

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.