# Free PCA practice questions

> 10 free PCA practice questions with the correct answer and an explanation.

Page: https://devopscodelab.com/exams/prometheus-pca/free-practice-questions/
Practice exams: https://devopscodelab.com/exams/prometheus-pca/

### Question 1 of 10 (choose 2)

A team runs Prometheus outside the cloud network and some targets sit behind a firewall that blocks inbound connections. Which TWO statements about push and pull models are accurate in this situation? (Choose two.)

- A. A Pushgateway is the recommended way to collect metrics from long-running services behind firewalls
- B. With pull, targets need outbound access to Prometheus but no listener of their own for metrics
- C. Push-based collection removes any need for service discovery or target health information
- D. Running Prometheus inside the restricted network, or in agent mode with remote write, avoids inbound connections from outside
- E. With pull, the Prometheus server must be able to open connections to the targets' metrics endpoints

**Answer:** D, E

**Explanation:** Pull means Prometheus connects to each target, so the network must allow that direction; deploying Prometheus or an agent inside the network and forwarding data out with remote write solves the firewall problem. Under pull, targets expose a listener and do not connect to Prometheus. Push models still need some notion of which senders are expected, and the Pushgateway is recommended only for service-level batch jobs, not as a general firewall workaround for long-running services.

### Question 2 of 10

A company's contract promises customers a service credit if monthly availability drops below 99.5%. Internally, engineers target 99.9%. Which statement is correct?

- A. Both figures are SLIs, because each of them is expressed as a percentage of successful requests per month
- B. The 99.5% commitment is an SLO, and the stricter 99.9% target is an SLA that engineers report to customers
- C. The 99.9% target is an error budget, and the 99.5% commitment is the burn rate that triggers credits
- D. The 99.5% commitment is an SLA, and the stricter 99.9% target is an SLO that leaves headroom

**Answer:** D

**Explanation:** An SLA is an external agreement with consequences such as credits, while an SLO is an internal reliability target; setting the SLO tighter than the SLA gives engineers warning before the contract is breached. Reversing the terms misplaces which one carries financial consequences. SLIs are the measurements, not targets, and error budgets and burn rates are derived from the SLO rather than being the targets themselves.

### Question 3 of 10

A security team asks whether Prometheus is suitable as the system of record for per-request billing data that must be 100% accurate. What is the BEST answer?

- A. No, Prometheus favours availability and may miss samples, so billing should use an event store
- B. Yes, if remote_write is enabled because the remote store guarantees exactly-once delivery of samples
- C. Yes, as long as the scrape interval is reduced to one second so every request is captured exactly
- D. No, because Prometheus cannot store counters larger than 2^32 and billing totals will overflow quickly

**Answer:** A

**Explanation:** The Prometheus documentation states that it values reliability of the monitoring system over 100% accuracy; samples can be missed during scrape failures and data is aggregated, so per-request billing belongs in a dedicated event or database system. A shorter scrape interval still samples aggregated counters rather than individual requests. Remote write does not provide exactly-once guarantees, and Prometheus stores samples as 64-bit floats, so a 32-bit overflow is not the limitation.

### Question 4 of 10

A global organisation runs one Prometheus server per data centre and wants a single server that holds a few aggregated, job-level series from each of them for a global overview. Which built-in Prometheus mechanism supports this?

- A. Remote read, letting each data-centre server query the global server's local storage on demand
- B. Hierarchical federation: scraping /federate with match[] selectors for aggregated series
- C. Enabling the TSDB snapshot API and copying the blocks to the global server daily
- D. Configuring every data-centre server as a target in each other's static_configs

**Answer:** B

**Explanation:** Hierarchical federation lets a global Prometheus scrape the /federate endpoint of each data-centre server, selecting only the needed (often pre-aggregated) series with match[] parameters. Remote read goes the other way and is for reading from external storage. Scraping each other's /metrics endpoint only collects the servers' own internal metrics, and copying snapshots is a backup technique that produces no live overview.

### Question 5 of 10

Which function predicts whether a disk will be full within the next 4 hours, based on the trend of node_filesystem_avail_bytes over the last 6 hours?

- A. rate(node_filesystem_avail_bytes[6h]) * 14400 < 0
- B. holt_winters(node_filesystem_avail_bytes[6h], 0.4, 14400) < 0
- C. deriv(node_filesystem_avail_bytes[4h]) * 6 < 0
- D. predict_linear(node_filesystem_avail_bytes[6h], 14400) < 0

**Answer:** D

**Explanation:** predict_linear fits a linear regression over the range and extrapolates the value the given number of seconds ahead, which is the standard disk-full prediction. deriv returns the per-second slope, and multiplying it by 6 does not estimate future value. rate is for counters and misbehaves on a gauge that rises and falls. holt_winters (renamed double_exponential_smoothing and placed behind a feature flag in Prometheus 3) takes smoothing factors between 0 and 1, not a time horizon.

### Question 6 of 10

Which expression returns the free-disk percentage for each filesystem, using node_filesystem_avail_bytes and node_filesystem_size_bytes, which share identical labels?

- A. node_filesystem_avail_bytes / 100 * node_filesystem_size_bytes
- B. 100 * node_filesystem_avail_bytes / node_filesystem_size_bytes
- C. 100 * node_filesystem_avail_bytes / on() node_filesystem_size_bytes
- D. 100 * sum(node_filesystem_avail_bytes) / node_filesystem_size_bytes

**Answer:** B

**Explanation:** Binary operators match series with identical label sets one-to-one, so dividing the two metrics directly and multiplying by 100 gives a percentage per filesystem. Summing the numerator removes its labels and leaves no match on the right-hand side. on() with an empty list makes every series match every other, which fails as a many-to-many match. The last expression's precedence multiplies the size back in instead of dividing by it.

### Question 7 of 10

A metric node_cpu_seconds_total has labels instance, cpu and mode. Which expression returns the fraction of time each instance's CPUs were busy (not idle) over the last 5 minutes?

- A. avg by (instance) (rate(node_cpu_seconds_total{mode="idle"}[5m]))
- B. sum by (cpu) (rate(node_cpu_seconds_total{mode!="idle"}[5m])) / count(node_cpu_seconds_total)
- C. 1 - max by (instance) (node_cpu_seconds_total{mode="idle"}) / 100
- D. 1 - avg by (instance) (rate(node_cpu_seconds_total{mode="idle"}[5m]))

**Answer:** D

**Explanation:** The idle rate per CPU is the fraction of each second spent idle; averaging across the instance's CPUs and subtracting from 1 gives the busy fraction. The average idle rate alone is the idle fraction, the opposite. Summing non-idle rates by cpu aggregates across instances and yields seconds per second per core rather than a per-instance fraction. The raw counter divided by 100 is a cumulative number of seconds, not a percentage.

### Question 8 of 10 (choose 2)

A developer is instrumenting a library that other teams embed in their services. Which TWO practices follow Prometheus instrumentation guidance? (Choose two.)

- A. Push the library's metrics directly to a Pushgateway from inside every request handler
- B. Prefix metric names with the library name to avoid collisions with application metrics
- C. Register metrics so the hosting application can expose them through its own registry
- D. Start a separate HTTP server inside the library to expose its metrics on a fixed port
- E. Attach the host application's version string as a label on every metric the library emits

**Answer:** B, C

**Explanation:** Libraries should instrument with the standard client library so metrics flow through the application's registry and endpoint, and should use a clear prefix to avoid name clashes. A library opening its own port conflicts with the host process and complicates deployment, pushing from request handlers misuses the Pushgateway, and repeating a version label on every metric is better handled by a single info metric in the application.

### Question 9 of 10

An alerting rule should fire only if the error ratio stays above 5% for at least 10 minutes, to avoid paging on short spikes. Which rule field provides this behaviour?

- A. for: 10m
- B. keep_firing_for: 10m
- C. interval: 10m
- D. group_wait: 10m

**Answer:** A

**Explanation:** The for clause keeps an alert in the pending state until the condition has been true for the given duration, and only then sends it as firing. keep_firing_for does the opposite: it keeps an alert firing for a while after the condition clears. interval sets the rule group's evaluation frequency, and group_wait is an Alertmanager routing setting that delays the first notification of a new group.

### Question 10 of 10

In which states can a Prometheus alerting rule's alert be, as shown on the Alerts page?

- A. Inactive, pending, and firing
- B. OK, warning, and critical
- C. Pending, silenced, and inhibited
- D. Open, acknowledged, and resolved

**Answer:** A

**Explanation:** Prometheus alerts are inactive when the expression returns nothing, pending while the for duration has not elapsed, and firing once it has. Acknowledged and resolved are incident-management states from tools such as PagerDuty. Silenced and inhibited are Alertmanager states for notifications, and OK/warning/critical are severity levels from Nagios-style systems.

Ready for a timed run? Take the free 15-question PCA mini exam: https://devopscodelab.com/app/exams/prometheus-pca/mini/

DevOpsCode Lab is not affiliated with CNCF. PCA and related names are trademarks of their owners. We write every question ourselves; these are not real exam questions.
