Implement classes within an abstract Python framework
Company: Bloomberg
Role: Data Engineer
Category: Coding & Algorithms
Difficulty: medium
Interview Round: Technical Screen
Quick Answer: This question evaluates a candidate's skills in object-oriented design, implementing concrete classes from abstract interfaces, file I/O and streaming data transformations, error handling, and integration with a registry and CLI within a Python codebase.
Constraints
- 0 <= len(rows) <= 100000
- 1 <= len(header) <= 50
- 1 <= chunk_size <= 10000
- 0 <= max_retries <= 5
- The normalized header contains the keys `id`, `name`, and `age`
- Normalized header names are unique
Examples
Input: ([' ID ', ' Name ', 'Age', ' Email '], [['1', ' Alice ', '30', 'ALICE@EXAMPLE.COM'], ['x2', 'Bob', '22', 'bob@example.com'], ['3', ' Carol Danvers ', '41', ''], ['4', ' ', '28', 'dave@example.com'], ['5', 'Eve', '0', 'EVE@EXAMPLE.COM']], 2, 1)
Expected Output: (['{"id":1,"name":"Alice","age":30,"email":"alice@example.com"}', '{"id":3,"name":"Carol Danvers","age":41,"email":null}', '{"id":5,"name":"Eve","age":0,"email":"eve@example.com"}'], [1, 3])
Explanation: Rows 1 and 3 fail because `id` is not an integer and `name` becomes empty after trimming. The other rows are normalized and emitted as compact JSON.
Input: (['id', 'name', 'age'], [], 3, 2)
Expected Output: ([], [])
Explanation: No data rows means no output lines and no failures.
Hints
- Precompute the normalized column names once, then use a helper to validate and transform a single row.
- Process rows chunk by chunk, but keep the original row index so failed rows can be logged correctly.