Meta·Software Engineer·Onsite - Coding / Algorithms
Jun 2026
Meta SWE coding round, one algorithmic problem on minimizing round-trip flight costs. Pretty clean problem once you see the trick, but the constraint about strictly later days is the kind of thing that'll bite you if you skim the spec.
- Given two arrays of equal length representing outbound and return flight prices indexed by day, find the minimum total cost of a valid round trip where the return day must be strictly after the departure day. Return -1 if no valid pair exists.
“My first instinct was brute force, O(n^2) nested loops, which obviously works but dies on n=100000.” The rest of the author's notes on Software Engineer interview at Meta, Onsite - Coding / Algorithms round, covers how they worked through the question, what the panel pushed back on, and what they would do differently.
View Post