Your app has grown to 40 developers and one huge module. Builds are slow and teams block each other. How would you restructure it?
What the interviewer wants to hear
- Split into feature modules and core/shared modules
- Clear dependency rules; features do not depend on each other directly
- Navigation and communication through interfaces or a router
- Build speed: caching, parallel builds, only rebuild changed modules
- Code ownership and gradual migration
Model answer
I would split the app into modules: core modules for networking, design system, analytics and data, and feature modules for areas like login, search and payments. A strict rule is that feature modules do not depend on each other; they talk through interfaces in an API module or through a navigation router, so teams can work independently. On Android this means Gradle modules with convention plugins, and on iOS Swift packages. Smaller modules let Gradle and Xcode build in parallel and reuse build caches, so a change in one feature does not rebuild everything. I would add code owners for each module and dependency checks in CI. The migration should be gradual: extract the design system and core first, then move one feature at a time while measuring build time.
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?
- 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?
- How would you migrate a large UIKit or Android View app to SwiftUI or Jetpack Compose without stopping feature work?
- Millions of users have data in your app local database. How do you change the schema safely?