Courseiva

PCA · domain

Promql

Practise Prometheus Certified Associate (PCA, CNCF/Linux Foundation) (PCA) Promql practice questions — original exam-style scenarios with answer choices, explanations, and analysis of common mistakes.

81 questions22 easy32 medium27 hard

Focused practice

Practice Promql questions

Scored sessions drawing only from this domain — pick a length below.

Start 20-question practice test →

What this domain covers

What to know about Promql

Promql questions test whether you can apply the concept in context, not just recognise a definition.

How the topic appears in realistic exam-style scenarios.

Which detail in the question changes the correct answer.

How to eliminate plausible but wrong options.

How to connect the question back to the wider exam objective.

Watch out for

Common Promql exam traps

  • Answering from memory before reading the full scenario.
  • Missing a constraint such as cost, availability, security, scope or command context.
  • Choosing a broad answer when the question asks for the most specific fix.
  • Ignoring why the wrong options are tempting.

Question index

All Promql questions (81)

Click any question to see the full explanation, or start a practice session above.

1

If you perform 'A / B' where A and B have different sets of labels, what happens?

Hard
2

Which THREE of the following functions can be used with counter metrics to calculate rates or increases? (Choose three)

Medium
3

Which TWO of the following statements about PromQL label matchers are correct? (Choose TWO)

Hard
4

You need to calculate the per-second rate of increase of http_requests_total over a 1-minute window. Why is using a 1-minute range window generally discouraged in production?

Medium
5

Which function should be used to smooth out short-term fluctuations in a gauge metric by calculating the rolling average over a 10-minute window?

Medium
6

You are joining two vectors where the left vector has labels {job="api", instance="host1"} and the right vector has labels {job="api", region="us-east"}. You use the query 'vector_a + ignoring(instance, region) vector_b'. What does the 'ignoring' modifier do?

Hard
7

What is the primary difference between an instant vector and a range vector in PromQL?

Easy
8

What is the difference between 'count' and 'count_values'?

Easy
9

You are troubleshooting a query and notice that label_replace is being used. What is the primary function of label_replace(v, dst_label, replacement, src_label, regex)?

Hard
10

Which THREE of the following are valid set operators in PromQL for combining instant vectors? (Choose THREE)

Medium
11

Which function evaluates the predictable linear extrapolation of a gauge metric over time to predict future values?

Medium
12

When writing a query with arithmetic operators, how does PromQL handle vector matching when both vectors have the exact same label sets?

Medium
13

Which TWO of the following statements regarding native histograms in Prometheus are correct? (Choose TWO)

Hard
14

You need to perform a binary operation between two vectors where the left vector has labels {job="api", instance="a"} and the right vector has labels {job="api"}. You want to match them using the job label while retaining the instance label from the left side. Which modifier configuration is correct?

Hard
15

Which of the following selectors matches metric names that start with 'http_'?

Easy
16

When performing vector matching between two vectors of different cardinalities, which THREE vector matching modifiers can be used? (Choose three)

Hard
17

A Prometheus selector includes a negative regex match for environment names: 'environment!="staging"'. Which selector operator achieves this using regular expressions instead of exact matching?

Easy
18

You are joining an instant vector of application versions with an instant vector of metrics using a many-to-one relationship. The application version vector has more labels than the metric vector. Which keyword must be appended to the matching modifier to include labels from the 'many' side?

Hard
19

Which TWO of the following are valid data types returned by PromQL queries? (Choose two)

Easy
20

A user executes an instant query for a metric without providing a range vector. What type of vector is returned by default?

Easy
21

Which operator performs a logical 'not' on a comparison?

Easy
22

An engineer executes topk(3, http_requests_total). What happens if there are fewer than 3 time series matching the selector?

Hard
23

You are using the 'predict_linear()' function to forecast disk space exhaustion based on the metric 'node_filesystem_free_bytes'. What type of input data does predict_linear require?

Medium
24

Which TWO of the following are valid aggregation operators in PromQL?

Medium
25

An operator writes a query to calculate error percentage: sum(rate(errors[5m])) / sum(rate(total[5m])) * 100. What happens if the denominator evaluates to zero or has no matching time series?

Medium
26

You are monitoring a counter metric 'errors_total' and need to calculate the total number of errors that occurred over the last 1 hour. Which function is most appropriate?

Medium
27

You need to calculate the ratio of successful HTTP requests (status 200) to total HTTP requests. Both metrics are counters named 'http_requests_total'. How do you construct this query to ensure proper label matching between status='200' and total requests?

Hard
28

You need to calculate the 99th percentile of request latency across all instances using a Prometheus histogram metric 'http_request_duration_seconds_bucket'. Which function and setup is correct?

Hard
29

What is the behavior of the clamp_max() function when applied to an instant vector?

Hard
30

A Prometheus administrator wants to query the current value of the metric 'http_requests_total'. Which of the following PromQL expressions should be used?

Easy
31

You are joining an instant vector of application metrics with a static configuration instant vector containing target metadata using 'on(instance) group_right'. What does the 'group_right' modifier achieve?

Hard
32

When should you use the 'absent()' function?

Medium
33

Which label matcher operator is used for exact equality in PromQL selectors?

Easy
34

When evaluating a PromQL query involving arithmetic operators, such as 'vector1 + vector2 * vector3', which operator has the highest precedence?

Medium
35

Which TWO of the following label matching operators are supported in Prometheus label selectors? (Choose two)

Easy
36

Which THREE of the following are valid time-range units in PromQL?

Hard
37

Which THREE of the following modifiers or keywords are used in PromQL binary vector matching? (Choose THREE)

Medium
38

A Prometheus alert expression uses rate(http_requests_total[5m]) > 10. During a service restart, counter resets occur. How does the rate() function account for these counter resets?

Hard
39

Which THREE aggregation operators in PromQL support the 'by' and 'without' clause modifiers? (Choose three)

Medium
40

Which PromQL function is specifically designed to calculate the per-second average rate of increase of a time series over a given range vector?

Easy
41

When using 'irate', what is the impact of choosing a range vector that is too small (e.g., [10s])?

Hard
42

When evaluating a rule with offset, such as http_requests_total offset 1h, what exact time does Prometheus query?

Hard
43

Which TWO of the following are valid ways to modify or add labels to time series in PromQL? (Choose two)

Medium
44

You want to find the maximum value of a gauge metric across all instances over a 1-hour sliding window. Which function accomplishes this?

Hard
45

An administrator wants to aggregate CPU usage across all nodes, keeping the instance label while summing the values. Which aggregation clause should be used?

Medium
46

You want to find the top 3 jobs with the highest CPU usage using the metric 'process_cpu_seconds_total'. Which PromQL query structure is correct?

Medium
47

When evaluating a histogram metric, what does the special pseudo-label le represent in bucket time series?

Medium
48

Which aggregation operator would you use to calculate the total sum of a metric across all instances?

Medium
49

What is the purpose of the 'offset' modifier in a PromQL query?

Easy
50

Which PromQL aggregator should be used to count the total number of active time series matching a selector?

Easy
51

When calculating the 95th percentile from a histogram, why is histogram_quantile(0.95, sum(rate(http_duration_seconds_bucket[5m])) by (le)) the recommended pattern?

Hard
52

When writing a PromQL query involving a vector and a scalar, such as 'node_memory_free_bytes / (1024 * 1024)', how does Prometheus handle label matching?

Medium
53

Which TWO of the following are true regarding instant vectors?

Medium
54

Which TWO of the following conditions will cause the rate() function to return NaN or empty results? (Choose TWO)

Hard
55

You need to calculate the per-second rate of increase for a counter metric over the last 10 minutes. Which function is most appropriate?

Medium
56

Which THREE of the following are valid ways to modify a binary operation join?

Hard
57

Which selector syntax correctly matches all time series where the environment label does NOT equal production?

Easy
58

Which THREE of the following functions are specifically designed to be used with range vectors? (Choose THREE)

Medium
59

Which TWO of the following are valid metric types natively supported by Prometheus? (Choose TWO)

Easy
60

How does PromQL handle operator precedence between arithmetic operators like multiplication (*) and addition (+)?

Easy
61

Which THREE of the following are valid aggregation operators in PromQL? (Choose THREE)

Medium
62

Which regular expression matcher selects all time series where the status label begins with the digit 5?

Easy
63

Which TWO of the following statements about 'rate' vs 'irate' are correct?

Medium
64

How does Prometheus handle subqueries embedded within an instant query, such as rate(http_requests_total[5m])[30m:1m]?

Hard
65

Which THREE built-in functions in PromQL are designed specifically to analyze changes over time for gauge metrics? (Choose three)

Hard
66

Which TWO of the following statements regarding PromQL subqueries are correct? (Choose two)

Hard
67

Which function would you use to find the maximum value of a gauge metric 'node_cpu_load' over the past 30 minutes?

Easy
68

You need to calculate the 99th percentile HTTP request latency from a Prometheus histogram named http_request_duration_seconds. Which function is correct?

Medium
69

What is the purpose of the instant vector selector syntax http_requests_total{job="api-server"}?

Easy
70

Which function is best suited for identifying the 'top 5' instances with the highest value for a specific metric?

Medium
71

Which operator has higher precedence in PromQL: exponential (^), multiplication (*), or addition (+)?

Easy
72

An operator needs to find the rate of change of a counter using deriv(). Why is this considered a bad practice in Prometheus?

Hard
73

Which operator has the highest precedence in PromQL?

Medium
74

An operator needs to query the current, un-extrapolated rate of increase per second over the last 5 minutes for a counter metric named http_requests_total. Which function should they use?

Easy
75

What is the result of applying a range selector like [5m] to a gauge metric?

Easy
76

An operator writes the query sum(rate(http_requests_total[5m])) without any aggregation clauses. What is the output format?

Medium
77

When performing a vector-to-vector binary operation between two instant vectors of different label sets, which modifier allows matching on a subset of common labels?

Medium
78

An engineer needs to determine the total absolute increase in disk space consumed over the last 3 hours using a gauge metric node_disk_bytes_used. Which function is appropriate?

Medium
79

Which THREE of the following are valid label matchers?

Hard
80

When executing a subquery in PromQL, such as 'max_over_time(rate(http_request_total[5m])[30m:1m])', what does the resolution parameter ('1m') specify?

Hard
81

What is the primary operational difference between the 'rate()' and 'irate()' functions in PromQL?

Medium

Frequently asked questions

What does the Promql domain cover on the PCA exam?
Promql questions test whether you can apply the concept in context, not just recognise a definition.
How many questions are in this domain?
This page lists all 81 Promql questions in the PCA question bank. The actual exam draws from this domain proportionally to its weighting in the official exam blueprint.
What is the best way to practise this domain?
Start with a short focused session (10 questions) to identify gaps, then work through explanations. Repeat with a longer session once the weak areas feel solid.
Can I practise only Promql questions?
Yes — the session launcher on this page filters questions to this domain only. Choose any session length for inline explanations and scoring.
cncf-pca CNCF-PCA promql Practice Questions