The coding screen focused on implementing a parser for host and IoT device logs. The main challenge was correctly parsing timestamps and key-value fields with quoted strings, spaces, embedded symbols, and escaped quotes while also supporting streaming processing for multi-gigabyte log files.
Interview Details
Coding — Host Log Key-Value Parser
The task was to write a Python program that reads host logs and converts each line into a structured dictionary. The logs represented events generated by systems and edge devices such as cameras, access controllers, and gateways. Each line started with a timestamp followed by zero or more key-value pairs:
<timestamp> <key1>=<value1> <key2>="<value with spaces>" ...
The parsed timestamp needed to be stored under: "timestamp". Two timestamp formats needed to be supported. One format contained no spaces 2026-09-30T08:42:17Z. The other used a date and time separated by one space: 2026-09-30 08:42:17.625. Keys could contain letters, digits, underscores, hyphens, and periods, corresponding to a pattern like: [\w.-]+
Unquoted Values
Normal values ended at the next whitespace character or the end of the line.
For example:
host=edge-07
status=offline
attempts=4
host=edge-07
status=offline
attempts=4
**Quoted
Unlock Full Details
Create a free account to unlock this interview experience report.