The Column Transformer

An easy Python mock interview question on DataDriven, with an AI interviewer who asks follow-up questions and a hire or no-hire decision at the end.

Domain
Python
Difficulty
easy
Seniority
L3

Interview Prompt

An ETL step ships its per-column transforms as configuration: `transforms` maps a column name to the name of an operation, while `rows` is a list of same-keyed dicts. An operation is one of `'upper'` or `'lower'` to change a string's case, `'increment'` to add one to a number, or `'double'` to multiply a number by two. Apply each column's operation to its value in every row and return the updated rows.

Summary

Each column gets its function.

How This Interview Works

  1. Read the vague prompt (just like a real interview)
  2. Ask clarifying questions to the AI interviewer
  3. Write and run your Python against test cases
  4. Answer the interviewer's follow-up questions, then get a hire or no-hire decision