Back to problems

Parse payroll file and answer queries

Algorithm · Squarepoint · Hard

You receive a payroll text file as a file-like object such as StringIO. The file contains manually keyed, delimited payroll records. The first non-empty line is a header row that names the columns, so the parser must read the schema from the file instead of hard-coding a fixed set of columns. The data can be comma-separated or tab-separated. It may contain blank lines, extra whitespace, missing or malformed values, inconsistent formatting, and repeated employee IDs. The…

Checking your access…