← SIG (Susquehanna) Interview Insights

SIG (Susquehanna)·Software Engineer·Technical Phone Screen·Intermediate

Intermediate
May 2026

Summary

SIG coding round, pretty much all matrix manipulation in Python. One question but it had four parts and they wanted working code plus example outputs for each. Not the most complex stuff algorithmically but you need to be precise and not fumble the indexing.

Questions Asked (1)

Q1

Given a 3x3 matrix, write Python code to: (a) transpose it in-place, (b) swap two specified rows and two specified columns, (c) reverse a specified column and reverse all rows, and (d) rotate the matrix 90 degrees clockwise. Show example inputs and outputs for each part.

Algorithms & Data StructuresTechnical Trade-offs
Author's notes

Four parts sounds manageable until you're live coding and realize your in-place transpose is clobbering values before you swap them.

Create a free account to read the full note

AI HintsAI Generated

Suggested Approach

Start by clarifying that the matrix is 3x3 and operations are in-place, then systematically implement each part with clear variable names and comments. For each operation, explain the logic briefly, write clean Python code, and verify with a concrete example. Emphasize efficiency and correctness, especially for in-place transpose and rotation.

Pro tip: For in-place transpose, only iterate over the upper triangle (i < j) to avoid redundant swaps. For 90-degree clockwise rotation, combine transpose with reversing each row, which is both efficient and easy to remember.

1. Clarify requirements and constraints

Confirm that the matrix is 3x3, operations are in-place, and indices are 0-based. Ask if any operation should return a new matrix or modify in-place.

2. Implement in-place transpose

Use nested loops to swap elements across the main diagonal, iterating only over i < j to avoid double swapping.

3. Implement row and column swaps

Swap the entire rows using tuple assignment, and swap columns by iterating over each row and swapping the elements at the specified column indices.

4. Implement column reversal and row reversal

For reversing a column, iterate from top to bottom swapping with the corresponding element from the bottom. For reversing all rows, use list reversal on each row.

5. Implement 90-degree clockwise rotation

First transpose the matrix in-place, then reverse each row. This yields a 90-degree clockwise rotation.

Key Points to Mention

  • In-place operations minimize space complexity (O(1) extra space).
  • Transpose can be done by swapping matrix[i][j] with matrix[j][i] for i < j.
  • Row swap is O(1) using tuple assignment; column swap is O(n) for an n x n matrix.
  • Reversing a column or row can be done in-place with two pointers.
  • 90-degree clockwise rotation = transpose + reverse each row.
  • Always test with a concrete 3x3 example to verify correctness.

AI-generated suggestions, not part of the candidate's original notes. May be inaccurate — verify before relying on them.