InterviewStack.io LogoInterviewStack.io

Log Analysis and Diagnostic Data Gathering Questions

Extracting signal from existing logs and diagnostic output to find a root cause: parsing and querying log data, correlating traces and metrics during an investigation, and gathering the right diagnostic information (including asking clarifying questions) before drawing conclusions. Covers text-processing and query techniques for locating evidence in logs (structured log parsing, ElasticSearch/SQL-style log queries, log aggregation and retention trade-offs) and reconstructing a timeline from the data on hand. This is the analysis-of-existing-data skill used during troubleshooting and investigation across infrastructure and operations roles: distinct from monitoring and observability, which is about instrumenting a system so telemetry exists in the first place (see the observability topics for that), and distinct from SIEM-based security detection and formal digital-forensics practice (chain of custody, artifact/disk/memory analysis), which have their own dedicated coverage elsewhere in the catalog.

EasyTechnical
31 practiced

Explain common logging severity levels (debug, info, notice, warning, error, critical/crit, alert, emergency) and how they map to syslog numeric priorities / priority names. Discuss production strategies for controlling volume (rate-limiting, sampling) of debug-level logs without losing context needed for post-incident analysis.

EasyTechnical
29 practiced

Given the following log line format: '2025-05-01T12:34:56Z level=error srv=payments request_id=abc123 user_id=42 msg="checkout failed" latency_ms=562', write a Python function that parses arbitrary lines conforming to this structure into a dictionary, handles missing keys gracefully, and converts numeric fields. Provide example input and expected output.

EasyTechnical
37 practiced

Given a sample Apache access log line formatted without quotes:

127.0.0.1 - frank [10/Oct/2024:13:55:36 -0700] GET /index.html HTTP/1.1 200 2326

Write a single PCRE regular expression to extract the following named groups: client_ip, user, timestamp, method, path, protocol, status, bytes. Show how you'd run grep -P or awk to capture these fields and mention timestamp parsing caveats (timezones, format).

MediumTechnical
33 practiced

Write a Python 3 script that reads a newline-delimited log file where each line is a JSON object with keys: "timestamp" (ISO 8601), "service", "level", "message". The script should output per-minute error counts (level == "ERROR") for a given service over the last 60 minutes, printing lines like: 2025-03-12 14:05 3. The log may be out-of-order and can be large (~10GB): prioritize streaming and bounded memory.

EasyTechnical
32 practiced

Describe a small utility or automation (pseudocode or high-level steps) you would implement in Python to scan metrics or logs and identify the top services with rising error rates over a sliding 24-hour window. State inputs, outputs, aggregation method, and threshold logic.

Unlock Full Question Bank

Get access to all 12 Log Analysis and Diagnostic Data Gathering interview questions and detailed answers.

Sign in to Continue

Join thousands of developers preparing for their dream job.