How would you implement deep links in a mobile app from end to end?
What the interviewer wants to hear
- Use verified https links (App Links, Universal Links) with the association files on the domain
- Central router maps URLs to destinations
- Validate parameters and treat links as untrusted input
- Handle cold start, warm start, and logged-out users
- Fallback to the website when the app is not installed, and test every route
Model answer
I prefer verified https links: Android App Links with assetlinks.json and iOS Universal Links with the apple-app-site-association file on our domain, so the same URL opens the app or falls back to the website. In the app, one central router parses the URL into a typed destination, so screens never parse raw strings. I validate every parameter because links are untrusted input that anyone can craft. The router must handle cold start, when the app launches from the link, and warm start, when it is already running. If the destination needs login, I store it as pending and continue after sign-in. I also build a sensible back stack so Back goes somewhere useful. Finally, I add automated tests for each route and check links with adb and on real devices.
Can you answer it under time pressure?
Take a timed medium round and get scored on every answer.
More medium Mobile App Developer questions
- How would you add offline support to an app that currently only works online?
- Users say a list in your app stutters while scrolling. How would you find and fix the problem?
- Walk me through how you release a new version of a mobile app to the stores.
- What is dependency injection and how have you used it in a mobile app?
- What security practices do you follow when building a mobile app?
- How do you manage state in a Flutter or React Native app as it grows beyond a few screens?
- What testing strategy do you use for a mobile app, and what do you test at each level?
- How do you make a mobile app accessible, and how do you check it?
- How would you set up CI/CD for a mobile app?