PCA

Free PCA practice questions

10 questions from our PCA practice tests, each with the correct answer and a written explanation. Read them with the answers shown, or switch to quiz mode and answer first.

Back to the PCA practice exams

Question 1 of 10, Observability Concepts. 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.)

  1. AA Pushgateway is the recommended way to collect metrics from long-running services behind firewalls
  2. BWith pull, targets need outbound access to Prometheus but no listener of their own for metrics
  3. CPush-based collection removes any need for service discovery or target health information
  4. DRunning Prometheus inside the restricted network, or in agent mode with remote write, avoids inbound connections from outside Correct answer
  5. EWith pull, the Prometheus server must be able to open connections to the targets' metrics endpoints Correct answer

Answer and 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, Observability Concepts

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?

  1. ABoth figures are SLIs, because each of them is expressed as a percentage of successful requests per month
  2. BThe 99.5% commitment is an SLO, and the stricter 99.9% target is an SLA that engineers report to customers
  3. CThe 99.9% target is an error budget, and the 99.5% commitment is the burn rate that triggers credits
  4. DThe 99.5% commitment is an SLA, and the stricter 99.9% target is an SLO that leaves headroom Correct answer

Answer and 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, Prometheus Fundamentals

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?

  1. ANo, Prometheus favours availability and may miss samples, so billing should use an event store Correct answer
  2. BYes, if remote_write is enabled because the remote store guarantees exactly-once delivery of samples
  3. CYes, as long as the scrape interval is reduced to one second so every request is captured exactly
  4. DNo, because Prometheus cannot store counters larger than 2^32 and billing totals will overflow quickly

Answer and 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, Prometheus Fundamentals

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?

  1. ARemote read, letting each data-centre server query the global server's local storage on demand
  2. BHierarchical federation: scraping /federate with match[] selectors for aggregated series Correct answer
  3. CEnabling the TSDB snapshot API and copying the blocks to the global server daily
  4. DConfiguring every data-centre server as a target in each other's static_configs

Answer and 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, PromQL

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?

  1. Arate(node_filesystem_avail_bytes[6h]) * 14400 < 0
  2. Bholt_winters(node_filesystem_avail_bytes[6h], 0.4, 14400) < 0
  3. Cderiv(node_filesystem_avail_bytes[4h]) * 6 < 0
  4. Dpredict_linear(node_filesystem_avail_bytes[6h], 14400) < 0 Correct answer

Answer and 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, PromQL

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

  1. Anode_filesystem_avail_bytes / 100 * node_filesystem_size_bytes
  2. B100 * node_filesystem_avail_bytes / node_filesystem_size_bytes Correct answer
  3. C100 * node_filesystem_avail_bytes / on() node_filesystem_size_bytes
  4. D100 * sum(node_filesystem_avail_bytes) / node_filesystem_size_bytes

Answer and 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, PromQL

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?

  1. Aavg by (instance) (rate(node_cpu_seconds_total{mode="idle"}[5m]))
  2. Bsum by (cpu) (rate(node_cpu_seconds_total{mode!="idle"}[5m])) / count(node_cpu_seconds_total)
  3. C1 - max by (instance) (node_cpu_seconds_total{mode="idle"}) / 100
  4. D1 - avg by (instance) (rate(node_cpu_seconds_total{mode="idle"}[5m])) Correct answer

Answer and 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, Instrumentation and Exporters. Choose 2.

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

  1. APush the library's metrics directly to a Pushgateway from inside every request handler
  2. BPrefix metric names with the library name to avoid collisions with application metrics Correct answer
  3. CRegister metrics so the hosting application can expose them through its own registry Correct answer
  4. DStart a separate HTTP server inside the library to expose its metrics on a fixed port
  5. EAttach the host application's version string as a label on every metric the library emits

Answer and 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, Alerting & Dashboarding

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?

  1. Afor: 10m Correct answer
  2. Bkeep_firing_for: 10m
  3. Cinterval: 10m
  4. Dgroup_wait: 10m

Answer and 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, Alerting & Dashboarding

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

  1. AInactive, pending, and firing Correct answer
  2. BOK, warning, and critical
  3. CPending, silenced, and inhibited
  4. DOpen, acknowledged, and resolved

Answer and 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.