Observability and Monitoring Architecture Questions
Building visibility into infrastructure and services: metrics, logs, and traces, dashboards and alerting, SLIs/SLOs, and the design of an observability stack. Covers instrumenting systems for actionable signal, reducing alert noise, and diagnosing production issues from telemetry. Infrastructure-wide observability, distinct from network-specific monitoring.
One of your Linux servers has a load average of 8 on a 4 core box, but top shows CPU usage sitting around 20 percent. Walk me through how you would figure out what is actually driving that load.
Sample Answer
Direct answer
Load average and CPU percentage measure different things: load average also counts processes waiting on I/O in the run queue, not just processes waiting for CPU. On a 4 core box, a load of 8 means, on average, two processes are queued per core, a real overload signal, but since CPU sits at only 20% they are not queued waiting for CPU time. That combination almost always means something is I/O bound (disk, network, or a lock), not CPU bound. The fix is to find which processes are stuck in that waiting state and what they are waiting on.
Structured elaboration
Walk the toolchain in order:
uptime: confirms the load trend (1/5/15 min averages) is real and not a one-off spike.vmstat 1 5: check thewa(I/O wait) column. Highwawith lowus/syconfirms the CPU is idle waiting on I/O, not busy computing.iostat -x 1 5: look at%utilandawaitper device to find which disk is saturated.ps auxfiltered on process state, to find processes in uninterruptible sleep (stateD), the OS-level signature of a process blocked on I/O that cannot even be killed until the I/O completes.
Worked example
Ran the exact filter against a sample process table to demonstrate the technique, not a live host:
== processes stuck in uninterruptible sleep (D state) ==
USER PID %CPU %MEM VSZ RSS TTY STAT START TIME COMMAND
mysql 1122 12.4 8.2 812340 84200 ? Dl 09:14 4:41 /usr/sbin/mysqld
backup 2200 0.4 0.2 15200 3100 ? D 09:41 0:00 tar czf /backups/db.tar.gz /data
web 980 3.1 1.5 95200 22100 ? S Jul24 1:02 nginx: worker process
Command: ps aux | awk 'NR==1 || $8 ~ /^D/' (in a real ps aux listing, STAT is field 8, right after TTY). Run against the table above it drops the healthy nginx worker (state S) and keeps only the two processes actually blocked on I/O: a MySQL process and a backup tar job, both in state D/Dl. That narrows an 8 load average down to two concrete suspects and explains high load with idle-looking CPU.
Trade-offs and pitfalls
top's default view hideswa; you have to check the CPU detail line or usevmstat/mpstatto see it.- A high load average from many short-lived processes (a fork bomb, a cron storm) can look similar to an I/O problem at a glance;
vmstat'sr(runnable) column versusb(blocked) column tells them apart. - Network-attached storage (NFS, iSCSI) can cause
Dstate processes while iostat shows the local disk as idle. Checknfsstator network latency too.
What the interviewer probes next
They will usually push on what you would do once you have identified the blocked process (kill it, or is it un-killable and you need to fix the underlying storage), and whether you would have caught this earlier with a proactive alert instead of a manual investigation.
What is the practical difference between SNMP polling and SNMP traps when you are monitoring switches and UPS units, and when would you rely on each one?
Sample Answer
Direct answer
SNMP polling is the monitoring system reaching out on a schedule to ask a device for current values (an SNMP GET against a specific OID). An SNMP trap is the device pushing an unsolicited message the moment something happens. Polling is reliable and works for anything you want trended over time; traps are lower latency for events but can be lost since they ride on a single unacknowledged UDP packet.
Structured elaboration
Polling: the monitoring server sends snmpget or snmpwalk requests on an interval, for example every 60 seconds, for OIDs like interface counters, UPS battery charge, or temperature sensors. Traps: the device is configured to send a trap to the monitoring server's IP on port 162 the instant a condition fires, for example a UPS switching to battery power. The monitoring server just listens; it does no asking.
Where each wins:
- Use polling for anything you want a trend line on (bandwidth utilization, temperature, disk usage on an SNMP-managed appliance), because you need continuous samples, not just event notifications.
- Use traps for state changes you need to know about immediately and rarely, like a UPS going to battery, a fan failing, or a link going down, where waiting for the next poll interval could mean minutes of delay.
- Most production setups do both: poll for trend data and dashboards, and take traps as a low-latency backstop for critical state changes, usually funneled into the same alerting pipeline as the polled thresholds so on-call is not watching two separate systems.
Worked example
Real command syntax for polling two different device types:
snmpget -v2c -c public switch01.corp.local 1.3.6.1.2.1.1.3.0
snmpwalk -v2c -c public ups01.corp.local 1.3.6.1.2.1.33
The first reads sysUpTime.0 (OID 1.3.6.1.2.1.1.3.0, the standard MIB-II system-group uptime object) from a switch, a single scalar good for a trend graph. The second walks the whole UPS-MIB subtree (OID 1.3.6.1.2.1.33, RFC 1628) on a UPS in one pass, returning battery charge, input voltage, and runtime-remaining together; you would poll that same subtree on an interval for trending, while that UPS's "switched to battery" event is exactly what you would also configure as a trap so you are not waiting for the next poll cycle to find out.
Trade-offs and pitfalls
- Traps are sent over UDP with no acknowledgment or retry, so a trap sent during a network blip can simply vanish; never rely on traps alone for something you cannot afford to miss, always back it with a poll-based check too.
- SNMPv1/v2c send the community string in plaintext, a real risk on any network you do not fully trust. SNMPv3 adds authentication and encryption and is the right default for anything internet-facing or in a regulated environment.
- Polling too many devices too frequently can itself generate meaningful load on older network gear; interval choice is a real capacity decision, not just a monitoring one.
What the interviewer probes next
They will usually ask how you would handle a flood of traps during a real outage, since trap storms can overwhelm the monitoring server, and whether you know the difference between SNMPv2c and SNMPv3 well enough to justify a security decision.
You are asked to build a capacity trend for disk usage across 200 servers so management can plan storage purchases. What data would you collect, how would you calculate the trend, and what would trigger a purchase order?
Sample Answer
Direct answer
Collect a time series of used capacity per volume, for example daily df samples or whatever your monitoring system already stores, fit a trend line to it, and project forward to when it crosses your action threshold. You need enough history to smooth out noise (weekly patterns, one-off cleanups) but recent enough to reflect current growth, and the output should be a date, not just a percentage, because a date is what triggers a purchase order.
Structured elaboration
Collect at least daily df-style samples of used GB per volume, not just percent, since percent alone hides how many GB a jump actually represents on a large disk. Fit a trend line (ordinary least squares is enough for this) to get a growth rate in GB per day, then project forward to find the day the fit crosses your capacity ceiling.
What triggers the purchase order: pick a lead time longer than your procurement cycle. If buying and provisioning new storage takes 3 weeks, trigger the order when the trend crosses "90% full in 5 weeks," not when the disk is already at 90%.
Worked example
Executed example using 14 days of sampled disk usage on a 500 GB volume, fitting a least-squares line and projecting forward:
measured samples (GB used): [350.5, 350.4, 355.1, 357.4, 355.1, 358.0, 362.2,
363.5, 366.0, 366.7, 371.3, 373.2, 374.1, 377.7]
fitted growth rate: 2.105 GB/day (true underlying rate in this simulation was 2.0 GB/day)
fitted intercept (day 0 est.): 349.3 GB
90% full (450 GB) projected at day 47.9 from day 0
days remaining from today (day 13) to the 90% mark: 34.9 days
The fit (ordinary least squares) recovers the true 2.0 GB/day growth rate closely, 2.105 estimated, even with daily measurement noise. That is the point: a single day's jump or dip should not be read as a trend change, the line across many days is what you act on.
Trade-offs and pitfalls
- A straight-line fit assumes linear growth; a service about to onboard a large new customer or double its retention window will blow past a linear projection, so pair the trend with awareness of planned changes, not just historical data.
- Too little history (a few days) makes the slope noisy and unreliable; too much history (a year) can hide a recent acceleration by averaging it away. Recompute on a rolling window, for example the trailing 30 days, and re-evaluate weekly.
- An aggregate trend across 200 servers hides the one server about to fill up next week; you want both a fleet-wide summary for planning and a per-host projection for the "who pages tonight" question.
What the interviewer probes next
They will usually push on whether the fit is really linear or whether a single unusual day, a big import, a bulk cleanup, is quietly steering it, and on how you would roll a whole fleet of these projections into something a non-technical stakeholder can act on without reading a chart.
You're told storage costs $X per terabyte per month, and asked to propose a tiered storage policy for logs and metrics under that budget: hot, warm, and cold tiers, retention windows, a downsampling strategy for older data, and archival to cheaper storage. How would you make sure compliance requirements and alerting still work once raw data has been moved or downsampled?
Sample Answer
Direct answer
Split retention into hot (raw, fast storage, days), warm (compressed, still full resolution, weeks), cold (downsampled and heavily sampled, up to a year), and archive (compliance-only raw extracts, years, cheapest storage). Alerting stays correct because every alert either reads from the hot/warm tiers where it needs full resolution, or is redesigned to work on the statistical properties (percentiles, error counts) that downsampling preserves. Compliance stays correct because the raw bytes a regulator might ask for are pulled into a separate, signed archive path that bypasses the operational downsampling entirely.
Tiering policy
| Tier | Window | What's kept | Why |
|---|---|---|---|
| Hot | 0-7 days | Full-resolution raw metrics and logs | Real-time debugging, alert evaluation needs exact values |
| Warm | 8-30 days | Full resolution, compressed ~3x | Recent-incident lookback, still-fresh alerting context |
| Cold | 31-365 days | Metrics downsampled 10:1, logs sampled to 1% (errors kept at 100%) | Trend/capacity analysis, cheap enough to keep a year |
| Archive | 365+ days | Compressed 4:1 extract of the compliance-flagged subset only | Regulatory/legal retention, rarely queried |
Downsampling rule for metrics: never discard raw points, only aggregate. Roll up 10s scrapes into 1-minute buckets storing count, sum, min, max, and pre-computed percentile buckets (histogram, not just an average), so alerting on p95/p99 still works post-downsample. Averaging away the histogram is the single most common mistake here: an average of averages silently breaks p99-based alerts.
Downsampling rule for logs: keep 100% of error/warn-level events forever within the cold window; sample info/debug logs at a low, deterministic rate (hash on trace ID) so a given request's logs are either fully kept or fully dropped, never split. That preserves the ability to reconstruct a whole request's log trail if it was selected.
Keeping alerting correct across tiers
- Alert rules that fire on absolute thresholds (error count, latency p99) are pinned to run against hot/warm data only, since that is where fidelity is guaranteed.
- Longer-window alerts (weekly seasonality, slow burn SLO budget) run against cold-tier rollups, but only because the rollup step preserved histograms rather than plain averages, so the alert's percentile math still holds.
- Backtest every downsampling change: replay the last 90 days of raw data through the proposed rollup and confirm the alert would have fired at the same times it fired against raw data, before shipping the rollup config.
Keeping compliance correct across tiers
- Compliance retention is a separate write path, not a side effect of the operational tiers. At ingest, a policy tags records matching compliance scope (PII, regulated data classes, specific tenants); those records get a signed, immutable copy written to the archive tier at full fidelity, independent of what the operational hot/warm/cold pipeline does to the rest of the stream.
- The operational tiers are free to downsample or expire on their own schedule because the compliance obligation is already satisfied by the separate archive copy.
- Archive retrieval is on-demand (async restore), so day-to-day cost stays low, but an auditor's request for raw data from 3 years ago is answerable.
Worked example
Assume a service ingests G=500 GB/day of combined logs and metrics, split 30% metrics / 70% logs, and the storage budget is a hot-tier unit price of X=$23/TB-month (a concrete stand-in for the given $X). Illustrative relative unit prices for the other tiers, typical of SSD-backed vs. compressed-object vs. archival storage:
Warm priceCold priceArchive price=0.40X=$9.20/TB-month=0.15X=$3.45/TB-month=0.02X=$0.46/TB-monthTier volumes (hot: 7 days raw; warm: next 23 days at 3:1 compression; cold: next 335 days, metrics down 10:1 and logs sampled to 1%; archive: a 2%-of-ingest compliance subset, retained 7 years = 2555 days, compressed 4:1):
VhotVwarmVcoldVarchive=500×7=3,500 GB=3.50 TB=3500×23=3,833.33 GB=3.83 TB=10150×335+350×335×0.01=5,025+1,172.5=6,197.5 GB=6.20 TB=4500×0.02×2555=425,550=6,387.5 GB=6.39 TBMonthly cost:
C=3.50(23)+3.83(9.20)+6.20(3.45)+6.39(0.46)=80.50+35.27+21.38+2.94=$140.09/monthCompare that to the naive policy of keeping everything raw, at hot-tier price, for the full 7-year compliance window:
Cnaive=500×2555×100023=$29,382.50/month Reduction=1−29,382.50140.09=99.5%Tiering plus targeted downsampling cuts the steady-state storage bill by roughly 99.5% relative to keeping everything at hot-tier fidelity for the retention window, while still satisfying a 7-year compliance obligation and keeping alerting on full-fidelity data for the first month.
flowchart LR
Ingest[Raw Ingest] --> Hot[Hot 0-7d full res]
Hot --> Warm[Warm 8-30d compressed 3x]
Warm --> Cold[Cold 31-365d downsampled 10x, logs 1%]
Cold --> Archive[Archive 365d+ compliance subset, 4x compressed]
Hot --> AlertEval[Alert Evaluation]
Warm --> AlertEval
Cold --> AlertEval
Archive --> Restore[On-demand Restore]
Restore --> AlertEval
Ingest --> Vault[Signed Compliance Vault]
Vault --> Archive
Trade-offs and pitfalls
- Downsampling metrics to plain averages instead of histograms is the classic mistake: it looks fine until a p99-based SLO alert goes silent because the percentile can no longer be reconstructed from the rollup.
- Deterministic (hash-based) log sampling beats random sampling because it keeps a request's full log trail together instead of showing half a trace.
- Treating compliance retention as "whatever the operational tiers happen to still have" instead of a separate write path is a common design flaw: an operational cost-cutting change (shortening the cold window) can silently create a compliance gap unless the archive copy is decoupled from it.
- Archive restore latency (minutes to hours, depending on backend) is a real trade-off against cost; if legal holds require faster turnaround, that changes the archive tier choice and its price multiplier.
- Budget monitoring has to be proactive: alert on forecasted spend crossing the budget before the bill arrives, not after, since tier transitions are usually async and lag actual ingest growth.
Your team keeps getting paged at 2 a.m. for a disk space alert that clears itself ten minutes later before anyone can act on it. How would you redesign the alert so it stops paging on transient spikes but still catches real capacity problems?
Sample Answer
Direct answer
A threshold that fires on a single instantaneous sample is the root problem: it reacts to noise, not to a sustained condition. The fix is to require the condition to hold for a minimum duration meaningfully longer than the known false-alarm's own duration before it pages, and to separate "worth looking at during business hours" from "wake someone up," instead of treating every threshold breach as page-worthy.
Structured elaboration
Concretely:
- Change the check from "disk usage over 90% right now" to "disk usage over 90% for at least 15 consecutive minutes." Since this specific false alarm already resolves on its own in about ten minutes, the sustained window needs real margin past that, not a duration equal to it, or the same class of spike could still accidentally satisfy the rule.
- Add a second, lower-severity threshold, for example a ticket or a chat notification at 85% sustained for an hour, that goes to the team's queue instead of paging, so a genuinely slow leak still gets noticed before it becomes urgent.
- Use trend, not just level, where you can: usage climbing 5% per hour is a different problem than sitting flat at 91% for months on a disk that runs nearly full by design.
- Route the actual page only for the sustained, high-severity case, and route everything else to a lower-urgency channel with a runbook link, so on-call learns to trust that a page always means act now.
Worked example
A minute-by-minute simulation makes the trade-off concrete. Baseline disk usage sits at 70%. A transient spike jumps to 93% at minute 10, holds for exactly 10 minutes (matching the alert's own known pattern), and drops back to 71% at minute 20, nothing wrong. Separately, a real leak starts climbing 1% per minute from minute 30 onward and first crosses 90% at minute 49, staying above it from then on.
- Instant threshold (pages the moment any sample is at or above 90%): fires immediately at minute 10 for the spike, a false page, and fires again at minute 49 for the real leak. Across the run it fires on 42 separate minutes total.
- Sustained-15-minute threshold: never fires during the 10-minute spike, since 10 consecutive minutes does not reach the 15-minute bar. It does confirm the real leak, paging at minute 63, 15 consecutive minutes after the climb first crossed 90% at minute 49, a 14-minute detection delay traded for silencing the known false-alarm pattern with real margin.
That 14-minute delay is the actual cost of the redesign. If this were a volume that could fill from 90% to 100% faster than that under a genuinely fast leak, a flat 15-minute duration would be too slow and would need shortening or pairing with a rate-of-change check instead.
Trade-offs and pitfalls
- A "for" duration trades detection speed for noise reduction: too short and you are back to paging on spikes, too long and a genuine fast fill (a runaway log during an incident) eats into your response time. Size the duration to the fastest realistic growth rate you actually need to catch in time.
- Static percentage thresholds do not generalize across disks of very different sizes; 90% full on a 20 TB data volume is very different headroom than 90% on a 20 GB boot volume. Consider an absolute free-space floor in addition to a percentage.
- Silently raising the threshold to make the pages stop is the wrong fix and the most common mistake here; it just narrows the window before a real full-disk incident.
What the interviewer probes next
They will usually push on how you would gain confidence in a new duration setting before it goes live in production, and on how your same alerting policy needs to bend for a volume that is intentionally expected to run near full, like a cache tier.
Unlock Full Question Bank
Get access to all 10 Observability and Monitoring Architecture interview questions and detailed answers.
Sign in to ContinueJoin thousands of developers preparing for their dream job.