All Linux Foundation / CNCF exams

Free CBA practice test: 30 questions with answers

30 original questions for Certified Backstage Associate (CBA), drawn from every topic area. Answer each one to see whether you got it right and why. No sign-up.

Free questions
30
Full bank
112 questions
Real exam
90 min

CBA exam guide: topics, cost and format

All 30 CBA questions with answers

The same questions as the test above, grouped by exam topic. Open any question to see the answer and explanation.

Customizing Backstage (8 questions)

  1. Question 1

    Which kind of code belongs in a frontend plugin in Backstage?

    1. AReact components that render pages and cards in the user's browser
    2. BDatabase migration scripts that create the tables used by the catalog at startup
    3. CScheduled jobs that query databases and send results to external services on a timer
    4. DDockerfile instructions that define how the production image is built and tagged
    Show answer and explanation
    Correct answer: A

    Frontend plugins supply React components and pages that run in the browser. Scheduled jobs and migrations run on the server, and Dockerfile steps belong to the build pipeline, so those belong in backend plugins or infrastructure code.

  2. Question 2

    A plugin must call a company ticketing API using a secret key and keep the results available to other plugins. Where should this work be implemented?

    1. AIn a frontend plugin that stores the secret key in React state so it survives page reloads
    2. BIn a Material UI theme override that caches the ticketing results in the browser's memory
    3. CIn a backend plugin that holds the key and exposes an API the frontend can call
    4. DIn catalog annotations on each User entity, which the browser reads when the page loads
    Show answer and explanation
    Correct answer: C

    Backend plugins keep secrets on the server and expose data through their own routes, which the frontend and other plugins can call. Storing the key in frontend state or annotations would expose it to the browser, and a theme override is styling code rather than an integration layer.

  3. Question 3

    A team wants to change how an upstream Backstage plugin behaves without editing its source. Which approach is recommended?

    1. AEdit the files inside node_modules and commit the changes so the whole team receives them
    2. BDelete the plugin from the monorepo and paste in an unmaintained fork copied from a chat thread
    3. CCopy the plugin's entire source into a catalog Location entity so the catalog serves it
    4. DConfigure the plugin with its documented app-config options or compose its exported parts
    Show answer and explanation
    Correct answer: D

    Plugins are designed to be configured or composed without changing upstream code, which keeps upgrades manageable. Edits inside node_modules are overwritten on the next install, a copied unmaintained fork creates upgrade risk, and catalog entities are not a place to store plugin source.

  4. Question 4

    A team wants the entity page in the catalog to show an extra card with on-call details, while keeping the default cards. Which approach fits?

    1. AFork the entire catalog plugin and remove the default entity page so the new layout replaces it
    2. BAdd a custom card component to the entity page layout in app code, next to the existing cards
    3. CPut the on-call details in the repository README and rely on the catalog to show it on the page
    4. DRewrite the catalog backend so it renders the entity page from scratch on every request
    Show answer and explanation
    Correct answer: B

    The entity page is composed of cards, so adding a custom card in the app keeps the default content and avoids maintaining a fork. Forking the whole plugin creates upgrade work, a README is not shown as a card automatically, and the backend does not render page layouts.

  5. Question 5

    A component must update the screen whenever a value it displays changes. Which React feature is designed for this?

    1. AA plain module-level variable that React watches and reacts to automatically when it changes
    2. BState managed with a hook such as useState, so each change triggers a re-render
    3. CAn environment variable read once during the Docker build of the frontend bundle
    4. DAn HTML data attribute that the browser rereads each time the page is requested by a user
    Show answer and explanation
    Correct answer: B

    React re-renders a component when its state changes through the setter returned by useState. Plain variables do not trigger re-renders, data attributes are static markup, and build-time environment variables are fixed inside the bundle.

  6. Question 6

    A custom component calls the backend inside its render body, so every re-render sends another request and the page flickers. What is the standard fix?

    1. AMove the request into an effect hook such as useEffect, with a dependency list
    2. BAdd a comment that tells React not to re-render the component while the request is running
    3. CWrap the component in a multi-stage Dockerfile so the request runs during the image build
    4. DStore the response as a Template entity so the component reads it without any request at all
    Show answer and explanation
    Correct answer: A

    Side effects such as data fetching belong in useEffect, where the dependency list controls when the request runs. Comments do not affect rendering, Docker builds run before the app starts, and catalog templates are not a cache for runtime responses.

  7. Question 7

    A function component in a plugin needs to call the catalog API. Which Backstage pattern gives the component a client for that API?

    1. AReading the .env file directly from the browser when the component mounts
    2. BA global window object that the backend injects into every rendered page
    3. CThe useApi hook, passed the API reference for the catalog API
    4. DImporting the backend's database module directly into the component's file
    Show answer and explanation
    Correct answer: C

    Backstage frontends reach registered APIs through the useApi hook, which keeps plugins decoupled from how an API is implemented. Injecting globals, reading .env files in the browser, and importing server database code are not supported patterns, and they would leak internals.

  8. Question 8

    Which two statements about Material UI in Backstage plugins are accurate? (Choose two.)

    1. AMaterial UI components are React components, so they accept props and work with hooks
    2. BMaterial UI replaces React, so plugin components no longer need to be written as JSX
    3. CUsing theme palette and spacing values keeps colors and layout consistent across plugins
    4. DEach plugin should ship its own copy of the theme in its backend package for consistency
    Show answer and explanation
    Correct answer: A, C

    Material UI builds on React, so its components take props and work with hooks, and theme palette and spacing values keep plugins visually consistent. Material UI does not replace React or JSX, and theming is handled in the frontend rather than by copying the theme into each backend package.

Backstage Development Workflow (8 questions)

  1. Question 9

    A developer clones a Backstage monorepo and wants to start the frontend and the backend together for local development with one command. Which action fits this goal?

    1. ABuild the Docker image first, then start the frontend and backend as separate containers
    2. BEdit app-config.production.yaml so the development server starts automatically
    3. CStart only the backend, then open the production static bundle in a browser
    4. DRun the root-level dev script, which starts frontend and backend together
    Show answer and explanation
    Correct answer: D

    The default Backstage repository provides a root-level dev script that runs the frontend and backend together for local work. Building a Docker image is a packaging step rather than a local dev session, editing the production config does not start any process, and starting only the backend leaves out the frontend.

  2. Question 10

    In a Backstage monorepo, where should a new npm dependency be declared if only the backend package imports it?

    1. AIn the root app-config.yaml, under a dependencies section that is read at startup
    2. BIn the backend package's own package.json, so the dependency belongs to that workspace only
    3. CIn the frontend package's package.json, so the browser bundle includes it for everyone
    4. DIn the catalog-info.yaml file that describes the backend component entity
    Show answer and explanation
    Correct answer: B

    Workspaces let each package declare the dependencies it actually uses, so a backend-only library belongs in the backend's package.json. The app-config.yaml file holds runtime settings rather than package dependencies, catalog-info.yaml is a catalog descriptor, and adding the library to the frontend package would add an unneeded dependency there.

  3. Question 11

    A teammate adds a new library to the frontend package and pushes the branch. After you pull it, the frontend fails with a module-not-found error for that library. What is the most likely cause?

    1. AThe software catalog needs a new Component entity for every npm library the frontend uses
    2. BBackstage frontend code cannot import third-party npm packages without a plugin wrapper
    3. CThe Docker image must be rebuilt on your machine before any frontend import can resolve
    4. DYour local copy has not installed the dependency declared in the updated package.json
    Show answer and explanation
    Correct answer: D

    The library is declared in package.json, but the new dependency is only fetched into node_modules when you run an install after pulling. Frontend code can import ordinary npm packages, Docker builds do not affect local module resolution, and catalog entities do not control what the code can import.

  4. Question 12

    A developer changes a function in a plugin so that it returns a number where a string is expected. The local dev server reloads without complaint, but the team's CI job fails on the same branch. Which step is most likely to catch the problem before CI?

    1. ARunning the repository's TypeScript type check, since the dev server skips type errors
    2. BDeleting node_modules and reinstalling so the function is compiled again from scratch
    3. CAdding a catalog annotation that declares the expected return type of the function
    4. DRestarting the local dev server with a longer reload delay so type errors have time to appear
    Show answer and explanation
    Correct answer: A

    The development server transpiles code quickly and skips full type checking, so type mismatches only appear when the type checker runs. Waiting longer on reloads, reinstalling packages, or adding catalog annotations would not reveal a mismatch in source code.

  5. Question 13

    Which statement about TypeScript in a Backstage project is correct?

    1. ATypes are checked at compile time and removed from the JavaScript that actually runs
    2. BTypes stay in the running code so the backend can validate every API response automatically
    3. CTypeScript replaces React, so every frontend component must be written as a class
    4. DTypeScript converts catalog YAML files into JSON before the catalog ingests them
    Show answer and explanation
    Correct answer: A

    TypeScript adds static type checks that happen during compilation, and the emitted JavaScript carries no type annotations. The other statements are wrong: runtime validation is a separate concern, React components are commonly written as functions, and TypeScript does not convert catalog YAML files.

  6. Question 14

    A platform engineer wants to package the Backstage backend as a container image for a production cluster. Which approach fits best?

    1. ABuild the backend bundle, then use a Dockerfile that copies only the built output and runtime dependencies
    2. BWrite the production database password as a plain ENV line in the Dockerfile so every container can connect
    3. CCopy the developer's local node_modules folder into the image so the container starts without installing packages
    4. DStart the image with the development script so the frontend reloads whenever a source file changes
    Show answer and explanation
    Correct answer: A

    A production image should contain the built backend and the runtime dependencies it needs, with secrets supplied at runtime. Copying a laptop's node_modules can bring platform-specific binaries, a password written into the Dockerfile is visible to anyone who can read the image, and the development script is meant for local work.

  7. Question 15

    Which two statements about the Backstage development and build workflow are true? (Choose two.)

    1. AProduction images should receive secrets at runtime through environment variables, not from files baked into the image
    2. BDeleting the lock file before every install is the recommended way to keep dependencies current
    3. CThe root dev script starts only the backend, so the frontend must be built separately before it runs
    4. DCommitting the lock file keeps dependency versions identical for developers and CI runs
    Show answer and explanation
    Correct answer: A, D

    Runtime secrets keep credentials out of image layers, and a committed lock file pins resolved dependency versions so installs match across machines. Deleting the lock file makes installs drift, and the root dev script starts both the frontend and the backend.

  8. Question 16

    A developer starts the Backstage app locally. The frontend loads, but every API request fails with a browser error about cross-origin access. The backend's configured app base URL does not match the address the browser uses. What should be fixed first?

    1. AAdd a Material UI theme override that sets the page background to match the frontend's origin in the browser
    2. BRebuild the Docker image so the browser caches the correct origin for every request it makes
    3. CDelete the catalog entities so the backend stops sending cross-origin responses to the browser
    4. DMake the backend's app.baseUrl match the address the frontend is served from in the browser
    Show answer and explanation
    Correct answer: D

    The backend accepts browser requests from the origin configured as its app base URL, so a mismatch leads the browser to block the responses. Theme overrides, deleting catalog entities, and rebuilding an image do not change which origins the backend accepts.

Backstage Infrastructure (7 questions)

  1. Question 17

    Which description best matches what Backstage is?

    1. AA hosted service that replaces your Git hosting provider and handles every code review for you
    2. BAn open-source framework for building an internal developer portal with plugins
    3. CA continuous integration runner that compiles container images for each commit pushed to a branch
    4. DA Kubernetes operator that manages node pools and autoscaling for production clusters
    Show answer and explanation
    Correct answer: B

    Backstage is a framework that teams use to build their own developer portal, combining a software catalog with a plugin system. It is not a hosted Git service, a CI runner, or a cluster operator, so those descriptions do not match its purpose.

  2. Question 18

    A platform team wants all engineering teams to share the same navigation, look, and catalog views, while each team adds its own custom pages and widgets. Which Backstage mechanism supports this without forking the core framework?

    1. ACopying the core packages into each team's repository and editing them locally to suit the team
    2. BStoring HTML page templates as Location entities so the catalog can serve them to each team
    3. CPlugins that register their own pages and components inside the shared app
    4. DRunning a separate Backstage instance per team with no components shared between them
    Show answer and explanation
    Correct answer: C

    Plugins are the extension mechanism for adding pages, cards, and APIs to a shared Backstage app, so the core stays common. Copying and editing the core creates a fork that is hard to upgrade, Location entities only point at where descriptors live, and separate instances give up the shared look the team wants.

  3. Question 19

    A developer wants to point their laptop's backend at a different database host without changing the shared configuration committed to Git. Which approach fits?

    1. AAdd the database host as an annotation on the backend's catalog-info.yaml file
    2. BEdit the shared app-config.yaml and commit the change so the whole team uses the new host
    3. CHard-code the database host inside a React component in the frontend package
    4. DCreate a git-ignored app-config.local.yaml file that overrides only the values the developer needs
    Show answer and explanation
    Correct answer: D

    Backstage merges configuration files, so a local file that Git ignores can override just the values a developer needs. Committing a personal host to the shared file affects everyone, hard-coded values in React code end up in the browser, and annotations are metadata for plugins rather than runtime settings.

  4. Question 20

    A production deployment needs a database password, but the team does not want the value stored in any file committed to Git. How does Backstage configuration handle this?

    1. AThe password is stored as an annotation on the backend's catalog entity so plugins can read it
    2. BThe password is placed in the README of the backend package where the deploy team looks for it
    3. CThe password is kept in a .env file that the frontend decrypts in the browser at load time
    4. DThe config file references an environment variable, substituted when the process starts
    Show answer and explanation
    Correct answer: D

    Backstage configuration supports environment variable substitution, so secrets come from the runtime environment instead of living in Git. Annotations, README files, and browser-side decryption all expose the secret in places it should never be kept.

  5. Question 21

    A team runs Backstage in production in a single container with a local SQLite file for storage. After each container restart, the catalog data disappears. Which change addresses this?

    1. AMove the backend to a PostgreSQL database that runs outside the container and keeps its data
    2. BIncrease the frontend bundle size limit so SQLite can cache more catalog entries
    3. CRemove the catalog plugin so that fewer records are written to the database at all
    4. DRun the development script inside the container so the database is recreated on each start
    Show answer and explanation
    Correct answer: A

    SQLite stored inside an ephemeral container is lost when the container is replaced, and SQLite is meant for local development. An external PostgreSQL database keeps data durable across restarts, while bundle limits, removing the catalog, or running the dev script do not preserve stored records.

  6. Question 22

    A plugin must call a third-party API that requires a secret token. Which design keeps the token safe?

    1. AThe token is written into app-config.yaml values that the build bundles into the static frontend files
    2. BThe React component calls the third-party API directly, with the token stored as a constant in its source code
    3. CThe backend plugin calls the external API with a configured token, and the frontend calls the backend
    4. DThe token is saved as an annotation on each User entity so the browser can read it when needed
    Show answer and explanation
    Correct answer: C

    Frontend code runs in the user's browser, and anything bundled there can be read, so secrets belong in the backend. The backend calls the external service with credentials from its own configuration and exposes only the data the frontend needs.

  7. Question 23

    How does Backstage differ from a finished, ready-to-use product?

    1. AIt is a hosted product that organizations use exactly as delivered, with no code, configuration, or plugins of their own
    2. BIt provides core building blocks and plugins, and each organization assembles and configures its own app
    3. CIt supplies its own managed database, so no storage configuration is ever needed by the organization
    4. DIt ships its own Git server that replaces company repositories and their existing access controls entirely
    Show answer and explanation
    Correct answer: B

    Backstage is a framework that supplies the catalog, core packages, and plugin system, and each organization builds an app that wires them together with its own configuration. It is not a hosted product, a managed database, or a Git server.

Backstage Catalog (7 questions)

  1. Question 24

    A team owns a microservice that other teams should discover in the catalog. The entry should show who owns it, its lifecycle stage, and its type. Which entity kind should the team define?

    1. ALocation, which describes a list of files the catalog should scan for entity definitions
    2. BComponent, which describes a piece of software with an owner, a lifecycle, and a type
    3. CTemplate, which describes a scaffolding recipe that creates new projects from a form
    4. DGroup, which describes the team that owns a component and its members in the organization
    Show answer and explanation
    Correct answer: B

    The Component kind describes software such as a service or website and carries fields like owner, lifecycle, and type. Location points at where entity files live, Group describes the owning team rather than the software itself, and Template drives the scaffolder to create new projects.

  2. Question 25

    A database that several services depend on needs its own entry in the catalog, linked to those services. Which entity kind fits best?

    1. AResource, which represents infrastructure such as a database or a storage bucket
    2. BAPI, which represents an interface that a component exposes to other callers and consumers
    3. CUser, which represents a person who signs in and can own catalog entities over time
    4. DSystem, which groups related components and resources into one logical product
    Show answer and explanation
    Correct answer: A

    Resource is the catalog kind for infrastructure that components depend on, such as databases and buckets. API describes an interface, User represents a person, and System groups components and resources into a product rather than standing in for a single database.

  3. Question 26

    A team wants the GitHub plugin to show recent pull requests for its service on the catalog page. The repository is github.com/acme/billing-api. Which change to catalog-info.yaml enables this?

    1. AAdd a label named github that holds the team's chat channel name under metadata.labels
    2. BAdd the annotation github.com/project-slug set to acme/billing-api in metadata.annotations
    3. CChange spec.type to github-repository so the catalog treats the entity as a repository
    4. DRename the entity kind from Component to GitHub so the plugin recognizes the entity
    Show answer and explanation
    Correct answer: B

    Plugins read annotations to link an entity to external tools, and the GitHub integration uses the project-slug annotation to find the repository. Labels identify entities rather than linking tools, and changing spec.type or the kind does not connect the entity to pull requests.

  4. Question 27

    A team has a catalog-info.yaml file in its Git repository and wants the entity added right away, without waiting for an automated scan. What should they do?

    1. AAdd the YAML file to the backend's Dockerfile so it is copied into the image at build time
    2. BPaste the YAML contents into a React component in the frontend package as a constant
    3. CRegister the file's URL as a location through the catalog's registration flow or its API
    4. DRestart the frontend so the browser scans every repository in the organization it can access
    Show answer and explanation
    Correct answer: C

    A manually registered location points the catalog at a specific file so it can ingest that entity immediately. Hard-coding YAML in React or baking it into a Docker image does not register it with the catalog, and restarting the frontend does not trigger a repository scan.

  5. Question 28

    Which two causes most often explain why a registered catalog entity never appears in the catalog? (Choose two.)

    1. AThe entity's kind is not permitted by the catalog rules for the location that supplied it
    2. BRequired metadata such as the entity name is missing or invalid, so validation rejects it
    3. CThe primary color in the Material UI theme differs from the team's brand color guidelines
    4. DThe description field under metadata is written as more than one sentence of plain text
    Show answer and explanation
    Correct answer: A, B

    The catalog checks each entity against its rules and required fields, so a disallowed kind or a missing name keeps it from being ingested. Theme colors and the length of a description have no effect on whether an entity is ingested.

  6. Question 29

    Which mechanism lets the catalog discover catalog-info.yaml files across a whole GitHub organization on a schedule, without someone registering each repository by hand?

    1. AA manually registered location added to app-config.yaml for each repository in the organization
    2. BA Docker volume mounted into the frontend container that holds copies of the YAML files for every repository
    3. CA static HTML index page that lists the repository names for the catalog to read on a schedule
    4. DA catalog provider configured for GitHub that scans the organization's repositories on a schedule
    Show answer and explanation
    Correct answer: D

    Catalog providers, such as a GitHub discovery provider, scan configured sources on a schedule and ingest matching descriptor files automatically. Manual locations need one entry per file, while a volume or a static HTML page does not make the catalog discover anything on its own.

  7. Question 30

    A team creates a catalog entry for its new reporting website. Which field most directly records which team is responsible for answering questions about it?

    1. Ametadata.labels, which holds a free-text owner email address for the team's shared inbox
    2. Bspec.owner, which references a Group or User entity in the catalog
    3. Cspec.lifecycle, which records the name of the team that operates the website in production
    4. Dmetadata.namespace, which must be set to the exact name of the owning team every single time
    Show answer and explanation
    Correct answer: B

    The spec.owner field references a Group or User entity, which lets the catalog show who to contact. Labels hold free text rather than entity references, lifecycle records a stage such as production or deprecated, and namespace is a grouping setting rather than an owner field.