Daily iOS
Architecture

Incremental legacy refactoring

You need to improve the structure of a massive ViewController in a live UIKit order feature without rewriting it all at once. If you split the work into small shippable steps, which seam would you create first?

How would an interviewer hear this answer? You'll see whether they'd move on, dig in, or say no, and which sentences would trip you up. Your score doesn't change.
See the short answer

Start at the points that touch the outside world, like the payment API call, order persistence, and navigation: pull them behind protocols that wrap the existing code as is to create seams, and with the testability those seams give you, move the internal logic over.

Share a question