Logging, monitoring and observability – Server Side interview prep
261 interview-style multiple-choice questions on Logging, monitoring and observability, organized by topic: concepts, scenarios, code to read and tradeoffs, each with a short explanation. Learn the 148 key terms with the flashcards first, then test yourself.
Take the practice test · Flashcards · All study tools
What it covers
- 16.1 Logging practices
- 16.2 Log pipelines and storage
- 16.3 Metrics fundamentals
- 16.4 Prometheus, PromQL and dashboards
- 16.5 Distributed tracing
- 16.6 OpenTelemetry in practice
- 16.7 SLOs and alerting
- 16.8 Incidents and on-call
- 16.9 Health checks, synthetics and profiling
Key terms
16.1 Logging practices
- Structured logging
- Logs as queryable fields, not free text
- Log level
- Severity like Debug, Information, Warning, Error
- Correlation ID
- ID linking logs from one request
- Redaction
- Removing sensitive data from logs
- Log levels
- TRACE to FATAL
- ERROR level
- Failed, may need action
- Runtime log level
- Change without redeploy
- PII in logs
- Avoid or mask
- Log injection
- Forged entries
- Log context
- Request, user, tenant IDs
- Message template
- Constant message, fields
- Log rate limiting
- Sample noisy messages
- Audit log
- Who did what
- Canonical log line
- One wide event per request
- Async logging
- Fast but lossy on crash
- SLF4J
- Logging facade
- Error tracker
- Grouped errors
- stdout logging
- Platform collects logs
16.2 Log pipelines and storage
- Log shipper
- Collect and forward logs
- ELK
- Elasticsearch, Logstash, Kibana
- Loki
- Label-indexed logs
- Storage tiers
- Hot, warm, cold
- Grok
- Parse text to fields
- Disk buffer
- Survive backend outages
- LogQL
- Loki query language
- ECS
- Elastic Common Schema
- DaemonSet agent
- Node-level log collection
- Redaction processor
- Scrub secrets in pipeline
- Event vs ingest time
- When it happened vs arrived
- WORM storage
- Write once, read many
- Mapping explosion
- Too many fields
- ILM
- Index lifecycle management
- syslog
- Network log protocol
16.3 Metrics fundamentals
- Metric
- Numeric measurement over time
- Percentile latency
- Latency at a given rank, like p99
- SLO
- Service Level Objective
- Error budget
- Allowed unreliability under an SLO
- Counter
- Only increases
- Gauge
- Goes up and down
- Histogram
- Bucketed distribution
- Summary
- Client-side quantiles
- Counter reset
- Restart to zero
- Percentile averaging
- Meaningless
- Saturation metric
- Queue length or wait
- Apdex
- Satisfied, tolerating, frustrated
- Pull vs push
- Scrape vs send
- Exemplar
- Trace ID on a metric point
- Coordinated omission
- Hidden slow latency
- Native histogram
- Exponential buckets
- Temporality
- Cumulative vs delta
- Route template label
- /users/{id}
- Tail at scale
- Fan-out amplifies tails
16.4 Prometheus, PromQL and dashboards
- rate()
- Per-second counter increase
- irate()
- Last two samples
- increase()
- Total increase over window
- sum by
- Aggregate keeping labels
- histogram_quantile
- Percentile from buckets
- Recording rule
- Precomputed query
- for clause
- Must hold before firing
- Alertmanager
- Group, dedupe, route
- Pushgateway
- Batch job metrics
- up metric
- Scrape success
- Exporter
- Exposes a system's metrics
- Remote write
- Long-term storage
- absent()
- Alert on missing data
- offset
- Compare with the past
- Dashboard as code
- Versioned dashboards
16.5 Distributed tracing
- Trace
- End-to-end record of one request
- Span
- Single timed operation in a trace
- traceparent
- W3C header carrying trace context
- OpenTelemetry
- Open standard for telemetry collection
- Trace ID vs span ID
- Request vs operation
- Span kind
- SERVER, CLIENT, PRODUCER, CONSUMER
- Span event
- Timestamped note on a span
- Head sampling
- Decide at the start
- Tail sampling
- Decide after the trace
- Queue propagation
- Context in message headers
- Span link
- Relate several traces
- B3
- Zipkin headers
- tracestate
- Vendor trace data
- Critical path
- Spans setting total time
- N+1 in traces
- Many tiny DB spans
- Trace gap
- Uninstrumented time
- Jaeger/Tempo
- Trace backends
- Low-cardinality span name
- Route template
- Parent-based sampler
- Follow upstream decision
16.6 OpenTelemetry in practice
- OTLP
- OpenTelemetry protocol
- Semantic conventions
- Standard attribute names
- service.name
- Main resource attribute
- Resource
- Who produced the data
- API vs SDK
- Interface vs implementation
- Receiver/processor/exporter
- Collector pipeline
- Agent vs gateway
- Per-node vs central Collector
- memory_limiter
- Collector back-pressure
- k8sattributes
- Adds pod metadata
- OTTL
- Transform language
- Span metrics connector
- RED from spans
- Baggage
- Context key-values
- OpenTelemetry Operator
- Injects agents in k8s
- Log bridge
- Existing logger to OTel
- Metric view
- Change aggregation
16.7 SLOs and alerting
- Request-based SLI
- Good events / valid events
- Freshness SLI
- How recent data is
- Rolling window
- e.g. last 28 days
- Multi-burn-rate alert
- Fast and slow windows
- Burn rate 14.4
- 2% budget per hour
- Page vs ticket
- Now vs later
- Alert fatigue
- Ignored noisy alerts
- Hysteresis
- Separate fire/resolve levels
- Watchdog alert
- Always firing
- predict_linear
- Trend forecast
- Silence
- Mute during maintenance
- Journey SLO
- End-to-end user flow
- SLO as code
- Sloth, Pyrra, OpenSLO
16.8 Incidents and on-call
- Mitigate first
- Stop the bleeding
- Rollback
- Fastest mitigation for a bad deploy
- What changed?
- First incident question
- Declare early
- Cheap to downgrade
- Severity level
- Response by impact
- Comms lead / scribe
- Incident roles
- Status page update
- Impact + next update time
- Escalation policy
- Who's paged next
- MTTA
- Mean time to acknowledge
- Follow-the-sun
- Daytime on-call by region
- On-call handoff
- Share ongoing issues
- Contributing factors
- Many causes combine
- Near miss
- Problem without impact
- Kill switch
- Flag to disable a feature
- Blast radius
- Who and what is affected
16.9 Health checks, synthetics and profiling
- Liveness probe
- Check deciding whether to restart an instance
- Readiness probe
- Check deciding whether to send traffic
- Postmortem
- Incident review focused on learning
- MTTR
- Mean time to recover
- Startup probe
- Protects slow boot
- Shallow liveness
- Process stuck only
- Graceful shutdown
- Fail readiness, drain, exit
- Cached health check
- Avoid dependency load
- Browser synthetic
- Scripted user flow
- N of M locations
- Synthetic alert rule
- Heartbeat check
- Cron job pings
- Cert expiry monitoring
- Alert before TLS expires
- Blackbox exporter
- Probes HTTP, TCP, DNS
- Continuous profiling
- Always-on production profiles
- Off-CPU profile
- Time spent blocked
- Flame graph width
- Share of samples
- Differential flame graph
- Compare two profiles
- Heap profile
- Retained memory by site
- Span profiles
- Profiles linked to traces
Sample practice questions
What are the "three pillars" of observability usually listed as?
- CPU, memory and disk
- Logs, metrics and traces
- Alerts, dashboards and tickets
- Dev, test and prod
Answer: B. Logs, metrics and traces Each answers different questions; together they explain system behavior.
Why centralize logs from all servers into one system?
- Application servers aren't able to store log files on their disks
- Centralizing logs makes the applications themselves run faster
- Instances are many and short-lived, so you need cross-service search
- Every regulation everywhere requires logs in one central system
Answer: C. Instances are many and short-lived, so you need cross-service search Examples: Azure Monitor Logs, Elasticsearch, Loki, Splunk.
What is a metric?
- A numeric measurement aggregated over time, like request rate
- A configuration setting that controls monitoring
- A trace that follows one request across services
- A single log line describing one event in detail
Answer: A. A numeric measurement aggregated over time, like request rate Metrics are cheap to store and great for dashboards and alerts.
What is a dashboard best used for?
- Storing raw logs for long-term retention
- A quick view of health and help during incidents
- Replacing alerts entirely, since people watch it
- Deploying new code to production servers
Answer: B. A quick view of health and help during incidents Dashboards need someone to look; alerts come to you.
What does distributed tracing show?
- A list of every deployment made to production
- The CPU usage of each server over the past day
- One request's path and timing across services, as spans
- The schemas of each service's database tables
Answer: C. One request's path and timing across services, as spans It pinpoints which hop made a request slow.
What does auto-instrumentation give you?
- Spans for common libraries without code changes
- Automatic fixes for bugs found in production
- Automatic scaling of services under heavy load
- Automatic deletion of logs past their retention
Answer: A. Spans for common libraries without code changes Add manual spans for important business operations.
What is an SLO?
- A legally binding contract with customers that includes penalties
- An internal reliability target, like 99.9% of requests OK under 300 ms
- A single raw metric value collected from one server at a time
- A log severity level placed between warning and error
Answer: B. An internal reliability target, like 99.9% of requests OK under 300 ms An SLA is the contractual promise; SLIs are the measured indicators.
What do MTTD and MTTR measure?
- Mean time to detect and to recover from incidents
- Memory per thread and total threads per request
- Monthly counts of tests and of releases shipped
- Maximum transfer rate of data and of disk reads
Answer: A. Mean time to detect and to recover from incidents Good observability shortens both.
What is the difference between a liveness and a readiness probe?
- Liveness checks the database; readiness checks free disk space
- None; they're the same check, just registered under two names
- Liveness: should it restart? Readiness: should it get traffic now?
- Readiness restarts the container; liveness removes it from traffic
Answer: C. Liveness: should it restart? Readiness: should it get traffic now? Don't make liveness depend on downstream services, or one outage restarts everything.
What is structured logging?
- Writing every log message entirely in uppercase letters
- Writing a separate log file for every class in the app
- Sorting the lines of each log file into alphabetical order
- Logging key-value data, like JSON, that can be queried by field
Answer: D. Logging key-value data, like JSON, that can be queried by field `logger.LogInformation("Order {OrderId} placed", id)` keeps `OrderId` as a field.
More Server Side
- HTTP fundamentals
- REST API design
- GraphQL
- gRPC & real-time APIs
- OAuth 2.0, OIDC & JWT
- Sessions, cookies & web app security
- C# & .NET
- Java & Spring Boot
- Node.js & Express
- Python, Django & FastAPI
- Go (Golang)
- Concurrency & multithreading
- OOP & SOLID
- Design patterns
- Dependency injection
- Data structures
- Algorithms & Big-O
- Linux & shell scripting