← Back to blog Meta SDE VO: Toeplitz Matrix Check + Point-in-Polygon
Meta

Meta SDE VO: Toeplitz Matrix Check + Point-in-Polygon

2026-06-15

Meta's SDE VO round runs ~45 minutes, often a warm-up plus a heavier problem. Based on an oavoservice student's debrief, the interviewer was a senior engineer based in the London office—unhurried, and big on how clearly you explain your thinking. Two questions: a warm-up Toeplitz matrix check, and a main course of point-in-polygon on a 0/1 matrix. The latter is genuinely hard if you've never drilled computational geometry. At the end you'll find VO assist / VO proxy paths for anyone in a big-tech job search closing their gaps.


1. Meta SDE VO Overview

Dimension Details
Format Remote video / onsite (Coderpad / shared editor)
Per round ~45 min, 1–2 coding questions
Language Your choice; Python most common
Focus Algorithm fundamentals, geometric/math intuition, dry run, verbal clarity
Style Interviewers may sit in different offices (incl. Europe); explaining beats raw AC

Meta's coding rounds don't just test whether you can write it—they test whether you can explain it. The interviewer will have you dry-run the algorithm by hand against concrete cases, and ask for time complexity at the end. People who narrate each step while coding clearly have the edge.

2. Q1 (Warm-up): Check a Toeplitz Matrix

Problem

Given a matrix, decide whether it's a Toeplitz matrix—that is, every top-left-to-bottom-right diagonal has all equal elements.

Approach

No overthinking: the theoretical lower bound is one scan of the matrix. For every element off the first row and first column, matrix[i][j], if it equals its top-left neighbor matrix[i-1][j-1], the whole matrix is Toeplitz. State the condition clearly, implement the traversal, and you're through.

def is_toeplitz(matrix):
    rows, cols = len(matrix), len(matrix[0])
    for i in range(1, rows):
        for j in range(1, cols):
            if matrix[i][j] != matrix[i - 1][j - 1]:
                return False
    return True
print(is_toeplitz([[1, 2, 3],
                   [4, 1, 2],
                   [5, 4, 1]]))   # True

Time complexity: O(m·n) (each element seen once—already the lower bound). Space complexity: O(1).

3. Q2 (Main Course): Point-in-Polygon on a Matrix

Problem

Given a matrix of 0s and 1s where 1 marks the edges of a polygon, and the coordinate of a 0, decide whether that point is inside or outside the polygon.

Framing: Pick the explainable algorithm

This one is genuinely hard without prior computational-geometry practice, and scanline rarely shows up in everyday grinding. Your first thought might be the scanline algorithm, but it's costly to grasp for someone who hasn't seen it and awkward to explain live.

The safer pick is ray casting (the even-odd rule): shoot a ray from the test point in a fixed direction (say, to the right) and count how many times it crosses the polygon boundary. Odd crossings → inside; even → outside. The intuition is easy to convey, so neither you nor the interviewer gets tangled.

On this discrete 0/1 matrix, one simplification: from the point's row, walk rightward and count runs of consecutive 1s (each run is one boundary crossing), then check parity.

def is_inside(grid, r, c):
    cols = len(grid[0])
    crossings = 0
    j = c + 1
    # cast a ray rightward from (r, c), count boundary runs crossed
    while j < cols:
        if grid[r][j] == 1:
            crossings += 1
            while j < cols and grid[r][j] == 1:   # skip the whole edge run
                j += 1
        else:
            j += 1
    return crossings % 2 == 1                       # odd → inside
grid = [
    [0, 0, 0, 0, 0],
    [0, 1, 1, 1, 0],
    [0, 1, 0, 1, 0],
    [0, 1, 1, 1, 0],
    [0, 0, 0, 0, 0],
]
print(is_inside(grid, 2, 2))   # True, (2,2) is inside the box

After laying out the idea, the interviewer offered a few cases; I dry-ran the algorithm against each, confirmed the parity rule held, and reported complexity. Passed in one go.

Time complexity: O(cols) (one ray scans a single row). Space complexity: O(1).

Note: counting a consecutive 1 run as one crossing is a practical simplification for a discrete grid; a fully robust ray-cast also handles the degenerate case where the ray grazes a vertex. Stating that assumption out loud matters more than silently coding.

4. On-the-Spot Reminders


FAQ

Q1: How many questions per Meta SDE VO round?

A coding round is usually ~45 min with 1–2 questions, mostly LeetCode Medium with occasional Medium-hard. Interviewers can come from different offices (including in Europe) and broadly value reasoning and dry runs over raw AC.

Q2: Why use ray casting instead of scanline for point-in-polygon?

Ray casting (even-odd rule) is intuitive and easy to narrate: cast a ray from the point, count boundary crossings—odd means inside, even means outside. Scanline is powerful but costly to grasp and explain, and easy to get tangled in live. The explainable method wins in interviews.

Q3: Is there a faster solution for Toeplitz checking?

There's no lower time bound below seeing each element once, so O(m·n) is optimal; space can be O(1). The condition is simply that each element equals its top-left neighbor.

Q4: How do I prepare for blind spots like computational geometry?

Fill gaps by topic: do a few problems each on ray casting, convex hull, segment intersection, and scanline, each with a clear verbal walkthrough. For timed mocks by Meta question type, line-by-line walkthroughs, or full VO assist / VO proxy support, see the path below.


Preparing for a Meta SDE VO?

Meta coding rounds reward clear reasoning and gap coverage. oavoservice offers full Meta prep: timed mocks on matrix / computational geometry / ray casting / graph and tree high-frequency questions, dry-run and verbal-clarity polishing, and predictions by big-tech question type. Coaches include senior big-tech engineers, with full VO assist / VO proxy support.

Add WeChat Coding0201 now to get Meta questions and coaching.

Contact