Squarepoint·Software Engineer·Technical Phone Screen
- You're given a payroll file as a StringIO object with a header row and manually entered data. Using only the Python standard library, parse it into an in-memory structure that handles missing fields, extra whitespace, inconsistent delimiters, empty lines, and duplicate IDs. The parser should be driven by the header metadata so it works for files with different column sets.
- After parsing, write a function that counts how many employees have a salary strictly above 30,000. Handle missing or invalid salary values without crashing.
- Write a function that returns the employee with the longest job tenure based on a start date column. Define and document how you handle rows with missing or unparseable dates, and handle ties explicitly.
- Write a function that returns the employee with the second-highest salary. Define clearly how you handle duplicate salary values at the top.
“This was the core of the whole problem and I underestimated how much design thinking they wanted up front.”