Skip to content
$ lynuxpro

INTERVIEW PREP

Interview questions

570 questions from real DevOps, SRE, platform engineering and MLOps interviews, with the answer an interviewer wants to hear. Try answering out loud first, then open the model answer.

1.What are the three pillars of observability?Beginner

Metrics, logs and traces. Metrics are numbers over time, logs are text records of events, and traces follow one request through many services.

2.What are the four golden signals?Beginner

Latency, traffic, errors and saturation. Watching these four tells you most of what users feel.

3.How does Prometheus collect data?Beginner

It pulls. Every scrape interval it visits each target's /metrics page and stores the numbers. If a scrape fails, the up metric becomes 0.

4.What is the difference between a counter and a gauge?Beginner

A counter only goes up (until a restart), like total requests. A gauge goes up and down, like memory in use. You usually take the rate of a counter.

5.What is a label, and why can too many be a problem?Beginner

A label splits a metric into separate series, for example by status code. Every unique label combination is a new series, so labels with many values (like user id) use huge memory. This is high cardinality.

6.What does rate() do?Mid

It turns a counter into growth per second over a time window, such as rate(x[5m]). Use it on counters, not gauges.

7.How do you get a latency percentile in PromQL?Mid

Use a histogram metric: histogram_quantile(0.95, sum by (le) (rate(x_bucket[5m]))). Do not average percentiles from different servers.

8.What is an exporter?Mid

A small program that reads data from software you cannot change, such as a database or Linux, and exposes it as a /metrics page for Prometheus.

9.What is the job of Alertmanager?Mid

Prometheus decides when an alert fires. Alertmanager groups alerts, mutes silenced ones, and routes them to Slack, email or a pager.

10.What makes a good alert?Mid

It reports a symptom users feel, needs a human to act, has a for: duration to avoid spikes, and links to a runbook. Alerts that nobody acts on should be fixed or removed.

11.How is Loki different from Elasticsearch?Mid

Loki indexes only labels, so it is cheap and works well with Prometheus-style labels. Elasticsearch indexes all the text, so full-text search is rich but costs more storage and memory.

12.What is a trace and a span?Mid

A trace is the full journey of one request. A span is one step inside it, with a start time and duration. Spans nest to show who called whom.

13.How do you monitor an app on Kubernetes?Mid

Install kube-prometheus-stack, expose a /metrics port on the app, and create a ServiceMonitor that selects its Service. Prometheus then scrapes the pods as they come and go.

14.Why is Prometheus pull-based, and when do you push instead?Mid

Pulling lets Prometheus see at once when a target is down, because the scrape fails, and you do not have to configure each app with the server address. Push is only for short-lived batch jobs that end before a scrape, using the Pushgateway.

15.What is a recording rule?Mid

A rule that Prometheus evaluates on a schedule and stores as a new metric. Use it for heavy queries that you use often, so dashboards load fast and alerts stay simple.