DevOps.Academy
CoursesCurriculumInterview prepPricing
◔My learningSign in
DevOps.Academy

Free, hands-on DevOps lessons. Made with care in India.

System status

Learn

All coursesLinux roadmapCurriculumInterview questionsCheat sheetsMy learning

Academy

PricingCertificates

Legal

PrivacyTermsContact

devops.rajeev.pro

Monitoring · interview practice

Monitoring interview questions

Answer each one out loud first, then tap it to check yourself against a model answer and the lesson behind it.

Observability basics 4Prometheus 6Grafana 4Alerting 5Logs 3Tracing 3Kubernetes monitoring 4SLOs & on-call 3Hosted tools 2

Observability basics

Q1What is the difference between monitoring and observability?junior

Monitoring watches for problems you already know about, such as disk above 90% or an error rate above 1%. Observability is being able to answer a question you didn't plan for without shipping new code, and it depends on metrics, logs and traces being linked, for example by a shared trace ID.

Read the lesson: Metrics, logs and traces →
Q2Checkout is slow and calls five services. Which signal do you open first, and why not the others?junior

A trace, because it times every hop of one request and the slow span stands out. Metrics would tell me that checkout is slow and since when, and logs would tell me what happened to one request, but neither shows where the time went across services.

Read the lesson: Metrics, logs and traces →
Q3Name the four golden signals and give an example of each.junior

Latency (p95 checkout time), traffic (requests per second), errors (share of 5xx responses) and saturation (disk 92% full or a database pool at 48 of 50). I track latency of successful and failed requests separately, because fast error pages make the average look better than reality.

Read the lesson: Metrics, logs and traces →
Q4Why do you report latency as p95 or p99 instead of an average?mid

An average hides the slow tail: 99 requests at 100 ms and one at 10 seconds average about 200 ms and look fine. The p95 or p99 is the time most requests finish within, and that is where unhappy users show up. The trade-off is that percentiles from histograms are estimates bounded by the bucket edges.

Read the lesson: Metrics, logs and traces →

Prometheus

Q5Prometheus pulls metrics instead of having servers push them. What does pull give you, and where does it fall short?junior

Because Prometheus knows every target it expects, a failed scrape becomes up = 0, so a dead server is a number you can alert on rather than a silence. The weak spot is short batch jobs that can finish between two scrapes; those push their final numbers to the Pushgateway, which Prometheus scrapes.

Read the lesson: Prometheus and PromQL →
Q6Why do you always wrap a counter like node_cpu_seconds_total in rate() before graphing it?junior

A counter only goes up since the process started, so its raw value is a rising line that says nothing about now. rate(x[5m]) gives the average per-second increase over the window and handles counter resets on restart. I keep the window at least four times the scrape interval so the rate isn't jumpy.

Read the lesson: Prometheus and PromQL →
Q7A PromQL division returns an empty result, but both sides return data on their own. What is the likely cause?mid

Binary operators pair series whose label sets match exactly. If one side still has job and env and the other was aggregated with count by (instance), nothing pairs up. Adding on (instance) after the operator tells PromQL to match on that label only.

Read the lesson: Prometheus and PromQL →
Q8How do you get a p95 latency from a Prometheus histogram, and what is the common mistake?mid

Take the rate of the _bucket series, sum by (le), then pass that to histogram_quantile(0.95, ...). The common mistake is aggregating away the le label, which leaves the function nothing to work with. The result is an estimate that is only as precise as the bucket boundaries.

Read the lesson: Prometheus and PromQL →
Q9A Prometheus server keeps running out of memory after a new service was added. What do you check first?senior

Cardinality. Every unique label combination is a new series, so a label holding user IDs, emails or full URLs, or relabeling that keeps too much discovery metadata, can create millions of series. I check prometheus_tsdb_head_series, find the offending label and drop it with relabel_configs.

Read the lesson: Prometheus and PromQL →
Q10When would you add a recording rule, and how would you name it?senior

When an expensive query runs constantly, such as a CPU average used by many dashboard panels and alerts. The rule evaluates it once per evaluation interval and stores the result as a small new series, named level:metric:operations, for example instance:node_cpu_utilisation:rate5m.

Read the lesson: Prometheus and PromQL →

Grafana

Q11Grafana runs in Docker and you set the Prometheus data source URL to localhost:9090. Why does Save & test fail?junior

With the default Server (proxy) access, the URL is resolved by the Grafana server, not the browser. Inside the Grafana container, localhost is the container itself, so the URL has to be the Prometheus name on the shared network, such as http://prometheus:9090.

Read the lesson: Grafana dashboards →
Q12Why should a dashboard variable be used with =~ in queries rather than =?mid

When someone picks several values or All, Grafana fills the variable with a regex like (web-1|web-2). An = matcher would treat that as a literal value and match nothing, while =~ matches each server. The cost is a regex match on every query, which is fine at dashboard scale.

Read the lesson: Grafana dashboards →
Q13One panel on a dashboard says "No data" while the others work. How do you debug it?mid

Copy the panel's query into Explore and run it there, because Grafana only draws what the data source returns. Usually the query itself is wrong, often a label mismatch in a division that needs on (instance), or a variable value that doesn't exist for that metric.

Read the lesson: Grafana dashboards →
Q14How do you make Grafana rebuildable if the server is lost?senior

Provision data sources and dashboards from files in Git: a datasources YAML with a fixed uid and a dashboard provider pointing at a folder of exported JSON. Hand-made UI changes become drafts that must be exported back to Git. Grafana's own database still holds users and settings, so use PostgreSQL or MySQL if several servers share it.

Read the lesson: Grafana dashboards →

Alerting

Q15What does the for field on a Prometheus alert rule do?junior

The expression must stay true for that long before the alert moves from pending to firing. If the condition clears while pending, nobody is told, so a 30-second spike never pages. The trade-off is built-in delay: every minute of for is a minute later that a real outage reaches you.

Read the lesson: Alerting with Alertmanager →
Q16A target died and the page arrived 97 seconds later. Where did that time go?mid

About 7 seconds until the next scrape failed and up became 0, 60 seconds of for: 1m in pending, and 30 seconds of Alertmanager group_wait before the first notification. The resolved message took about 4 minutes because Alertmanager only sends group updates every group_interval.

Read the lesson: Alerting with Alertmanager →
Q17What is the difference between grouping, inhibition and a silence in Alertmanager?mid

Grouping batches related alerts, so 40 down node_exporters become one message. Inhibition mutes some alerts while another fires, such as memory tickets for an instance that is already TargetDown. A silence mutes matching alerts for a fixed time, usually planned work, and needs an author, a comment and an end time.

Read the lesson: Alerting with Alertmanager →
Q18Why is "disk above 90%" a weak alert, and what would you use instead?senior

A fixed percentage fires too late on a small disk and far too early on a 10 TB one. I alert on predict_linear(node_filesystem_avail_bytes[1h], 4 * 3600) < 0 with a for of about 15 minutes, which gives hours of warning at any size. It can be noisy on spiky usage, which is why the for matters.

Read the lesson: Alerting with Alertmanager →
Q19How do you find out that the alerting pipeline itself is broken?senior

Run a Watchdog alert with expr: vector(1) that always fires and route it to a dead man's switch service that pages when the Watchdog stops arriving. I also run amtool config routes test in CI, because a typo in a matcher silently sends pages to the default receiver.

Read the lesson: Alerting with Alertmanager →

Logs

Q20Why does Loki tell you to keep labels few and low-cardinality?junior

Every unique label set is a separate stream, so a label like user_id or trace_id creates millions of tiny streams and the index balloons. High-cardinality values belong in the log line, filtered at query time with something like |= "user_id=8812" inside a narrow stream.

Read the lesson: Centralised logs with Loki →
Q21Why is Loki cheaper to run than Elasticsearch, and what do you give up?mid

Loki indexes only labels and stores lines in compressed chunks on object storage, while Elasticsearch indexes every field and word. The cost is that searching all streams for one rare word reads a lot of data, so Loki queries must start with labels that narrow them down; Elastic or Splunk earn their cost when people need fast full-text search or a SIEM.

Read the lesson: Centralised logs with Loki →
Q22A LogQL query with | json returns lines with __error__="JSONParserErr". What happened?mid

The json parser needs the whole line to be JSON, and these lines have a timestamp, level and caller before a JSON part. Loki keeps failed lines and labels them with __error__ instead of hiding them. Use the pattern parser to describe the line shape, or change the app to log pure JSON.

Read the lesson: Centralised logs with Loki →

Tracing

Q23What is the traceparent header and what breaks if a service drops it?junior

It is the W3C Trace Context header carrying a version, the 32-hex trace ID, the parent span ID and flags such as sampled. Each service starts its span as a child of the caller and forwards a new header with its own span ID. If a proxy or library drops it, the next service starts a new trace and the waterfall splits in two.

Read the lesson: Tracing with OpenTelemetry and Jaeger →
Q24Why put an OpenTelemetry Collector between apps and the tracing backend?mid

Apps only need to know "send OTLP to the Collector", while the Collector batches, strips sensitive attributes, changes sampling and exports to one or more backends from one config. It also buffers when the backend is down. The cost is another service to run and size, especially for tail sampling.

Read the lesson: Tracing with OpenTelemetry and Jaeger →
Q25Compare head sampling and tail sampling for traces.senior

Head sampling decides at the first service, such as keep 10%, and the decision travels in the traceparent flags; it is simple and cheap but drops 90% of slow and failed requests too. Tail sampling decides in the Collector after the trace finishes, so it can keep every error and slow trace, but it needs a Collector that sees all spans and the memory to hold them.

Read the lesson: Tracing with OpenTelemetry and Jaeger →

Kubernetes monitoring

Q26What is the difference between kube-state-metrics and cAdvisor metrics?mid

kube-state-metrics reports what Kubernetes thinks: desired replicas, pod phase, restarts, requests and limits. cAdvisor in the kubelet reports what containers actually use: CPU, memory working set and network. Most pod health questions need both, such as usage against the limit.

Read the lesson: Monitoring Kubernetes →
Q27You applied a ServiceMonitor but the app never appears on the Targets page. What do you check?mid

Three usual causes, in order: the ServiceMonitor is missing the release: monitoring label the Prometheus resource selects on, the selector doesn't match the Service's labels, or port uses a number or a name the Service doesn't have. The port must be the Service port's name.

Read the lesson: Monitoring Kubernetes →
Q28Pods stay Pending but node CPU graphs look idle. Why, and what query shows it?senior

The scheduler places pods by requests, not real usage. Comparing sum(kube_pod_container_resource_requests{resource="cpu"}) with sum(kube_node_status_allocatable{resource="cpu"}) shows requests near 100% of allocatable. The fix is more nodes or smaller, honest requests.

Read the lesson: Monitoring Kubernetes →
Q29Latency rises but the pod average CPU looks fine. What metric would you check?senior

CPU throttling: the ratio of container_cpu_cfs_throttled_periods_total to container_cpu_cfs_periods_total. Above about 25% the CPU limit is too low for the app's bursts, and the average hides the moments it hit the ceiling. Raising the limit costs capacity, so size it from real usage.

Read the lesson: Monitoring Kubernetes →

SLOs & on-call

Q30Explain SLI, SLO and SLA with one example.junior

The SLI is a ratio of good events to all events, such as requests that didn't return 5xx. The SLO is the target over a window, such as 99.9% over 30 days. The SLA is a customer contract with credits if broken, usually looser than the SLO, say 99.5%, so you react before you owe anything.

Read the lesson: SLOs, error budgets and on-call →
Q31What is an error budget, and how does an error-budget policy use it?mid

The budget is 1 minus the SLO: for 99.9% that is 43.2 minutes of full outage or 0.1% of requests per 30 days. A policy agreed with product turns it into decisions, such as release normally above 50%, extra review below 25%, and a feature freeze when it is gone.

Read the lesson: SLOs, error budgets and on-call →
Q32Why alert on burn rate with two windows instead of on every error?senior

Burn rate says how fast the budget is being spent; 14.4 over an hour uses 2% of a 30-day budget and is worth a page. The long window proves it is sustained, and the short window, such as 5 minutes, makes the alert stop soon after the problem stops. A slow burn of 1 over 3 days becomes a ticket.

Read the lesson: SLOs, error budgets and on-call →

Hosted tools

Q33What do Datadog, New Relic and Dynatrace add over self-hosted Prometheus, Grafana and Loki?mid

APM from an agent, real user monitoring, synthetic checks, click-through correlation between metrics, traces and logs, anomaly detection and security products on the same agent. You pay by hosts, data ingested, users or custom metric series, so the bill grows with volume.

Read the lesson: Hosted monitoring: Datadog, New Relic and Dynatrace →
Q34How do you keep a monitoring vendor choice reversible?senior

Instrument with OpenTelemetry instead of a vendor SDK and send everything through a Collector, whose exporters decide the backend. Trying a vendor, dual-sending during a migration or leaving becomes a Collector change. The vendor's own agent may still be worth it for features like RUM or auto-discovery.

Read the lesson: Hosted monitoring: Datadog, New Relic and Dynatrace →
← Back to the Monitoring course