I completed technical phone screen for Airtable and wanted to share my experience. No AI allowed unfortunately :(
I really enjoyed the way the interviewer presented the problem b/c most of the time, the problem is presented as "here's the exercise, good luck". This interviewer went above and beyond and presented the product context before the actual exercise. That in my book tells me that the engineers value product thinking which is a high ROI skill in this era
Within an Airtable app, you can create grid components. Grid components are like spreadsheets. You can create columns, add rows, delete column, delete row, update cells. When you update cells, you are able to do undo/redo. You can do the same for even the add/delete row and add/delete column operations. The interviewer did a quick demo via screen share!
I asked a few questions about the product context to identify what's in scope vs. out of scope
You are given a Table class with some filled out functions. Here's the interface you have:
row_ids array containing the list of row idscolumn_ids array containing list of column idsThe functions in Table class:
add_columnremove_columnadd_row(row_id)remove_row(row_id)set_cell(row, col, value)get_cell(row, col)get_row_ids()get_column_ids()undo() and redo() for set_cell caseFor this problem and future parts, you are not allowed to add function parameters to undo() and redo(). Think about why based on the product context
Simple test case:
table = Table()
table.add_row("test_row")
table.add_column("test_col")
# Set initial value
table.set_cell("test_row", "test_col", "initial_value")
assert table.get_cell("test_row", "test_col") == "initial_value"
table.set_cell("test_row", "test_col", "changed_value")
assert table.get_cell("test_row", "test_col") == "changed_value"
table.undo()
assert table.get_cell("test_row", "test_col") == "initial_value", "Undo should revert to previous value"
table.redo()
assert table.get_cell("test_row", "test_col") == "changed_value", "Redo should restore the undone change"I bounced a couple of ideas with the interviewer and we aligned on using a diff history like approach to save on space complexity. The interviewer had me write a few test cases to verify correctness.
undo() and redo() for the other operations (eg: add_row, remove_row, add_column, remove_column)I didn't get to this part by the time I completed iteration 1. I did talk about my high level thought process. Hopefully I did enough to move forward.
undo() and redo() functions. You can modify the other functions though if it helps. The interviewer specifically called out that he liked how I used existing pieces as much as possible. Don't reinvent the wheel