Parse logs and query by time
Company: Oracle
Role: Software Engineer
Category: Data Manipulation (SQL/Python)
Difficulty: Medium
Interview Round: Onsite
Implement a parser that converts raw log lines into structured records with fields {timestamp, level, message}. Build an API to support:
(a) insert(logLine),
(b) query(startTime, endTime, levelFilter?) returning records in time order. Explain how you will parse timestamps and time zones, handle malformed lines, and support large-scale data (e.g., indexing by time, batching, or using SQL windowing). Analyze time and space complexity and provide basic tests.
Quick Answer: This question evaluates competency in parsing and structuring log lines, interpreting timestamps and time zones, handling malformed input, designing insert/query APIs, reasoning about scalability and indexing, performing time/space complexity analysis, and planning basic tests.