How would you migrate a large UIKit or Android View app to SwiftUI or Jetpack Compose without stopping feature work?
What the interviewer wants to hear
- Migrate incrementally using interop (ComposeView, UIHostingController and the reverse)
- Build the design system components first
- New screens in the new framework, old screens migrated by priority
- Separate state and logic into ViewModels so the UI layer can be swapped
- Measure performance and app size, and agree on standards and training
Model answer
I would never do a big-bang rewrite. Both frameworks have good interop: ComposeView and AndroidView on Android, UIHostingController and UIViewRepresentable on iOS, so old and new UI can live side by side. First I build the design system in the new framework, like buttons, text styles and list rows, because every screen needs them. Then the rule is that new screens use the new framework, and existing screens are migrated when we touch them for features or when they cause many bugs. Before converting a screen, I make sure its logic lives in a ViewModel that exposes state, so only the view layer changes. I add screenshot tests to catch visual differences and measure scroll performance, startup and app size, since adding a framework adds weight. Team guidelines, code review and shared examples keep the code consistent during the long transition.
Can you answer it under time pressure?
Take a timed hard round and get scored on every answer.
More hard Mobile App Developer questions
- How would you design the mobile client for a chat app like WhatsApp?
- Your app has grown to 40 developers and one huge module. Builds are slow and teams block each other. How would you restructure it?
- A delivery app must track the rider location all day. How do you balance accuracy with battery life and OS limits?
- In a Flutter or React Native app, you need a feature that only exists in native SDKs, such as a payment terminal SDK. How would you integrate it well?
- How would you measure and improve app performance for real users in production, not just on your test phone?
- Users keep running old versions of your app for months. How do you evolve the API and decide when to force an update?
- Your crash reports show rising out-of-memory crashes after a release. How do you find and fix the problem?
- How would you implement secure login with an OAuth or OpenID Connect provider in a mobile app?
- Millions of users have data in your app local database. How do you change the schema safely?