Skip to content

Practical Mobile App Development Interview Questions

45 questions with answers. Hands-on questions where you write code, a query, a formula or concrete steps.

How to approach these questions

Talk while you work: say your approach first, write the simplest correct version, then improve it and mention edge cases.

Solved — practicalStart practicing
3 QUESTIONS FREESign up to unlock the full question bank and track your progress.Unlock every question and answer, then continue practising company-wise and package-wise.
3 questions free Unlock the rest in seconds
01

How would you structure the folder layout of a medium-sized cross-platform app?

Save to ▾
Show answer
Organise by feature rather than by type: features/auth, features/cart, features/profile, each containing UI, state logic and data code. Keep shared pieces in core folders such as core/network, core/storage, core/theme and core/widgets or components. Put configuration for environments separately. This keeps related code together, makes ownership clear and lets features be moved into packages later. Enforce the structure with lint rules and code review.
02

How do you set up multiple environments such as dev, staging and production in a mobile app?

Save to ▾
Show answer
Create build flavours on Android and schemes or configurations on iOS, each with its own app ID suffix, app name, icon and API base URL, so all can be installed side by side. In Flutter, use --flavor with --dart-define-from-file for config values; in React Native, use react-native-config or Expo app config with environment variables. Keep secrets out of the repo and set them in CI.
03

What questions would you ask before estimating a new mobile app project?

Save to ▾
Show answer
I would ask about target platforms and minimum OS versions, user types and key flows, design readiness, backend availability and API documentation, offline needs, payments, notifications, analytics, third-party SDKs, security or compliance requirements, languages to support, and release expectations including store accounts. I would also ask who maintains the app afterward. Then I break features into tasks, estimate with a buffer for store review and testing.
04

How do you think about mobile system design for a chat feature?

Save to ▾
Show answer
Start with requirements: one-to-one or group, media, read receipts, offline sending. The client keeps a local database as source of truth, shows sent messages instantly with a pending status, and syncs over a WebSocket while foregrounded, using push notifications in background. Handle reconnection, ordering by server timestamps, pagination of history, and retries with idempotent message IDs. Encrypt sensitive data and limit media size before upload.
05

Write a Dart sealed class for API results and handle it with an exhaustive switch.

Save to ▾
Show answer
sealed class Result<T> {} class Success<T> extends Result<T> { Success(this.data); final T data; } class Failure<T> extends Result<T> { Failure(this.message); final String message; } Widget view(Result<List<String>> r) => switch (r) { Success(:final data) => ListView(children: [for (final s in data) Text(s)]), Failure(:final message) => Center(child: Text(message)), };
06

Write a Flutter screen that fetches a list from an API using FutureBuilder.

Save to ▾
Show answer
class UsersPage extends StatefulWidget { const UsersPage({super.key}); @override State<UsersPage> createState() => _UsersPageState(); } class _UsersPageState extends State<UsersPage> { late final Future<List<User>> _future = api.fetchUsers(); @override Widget build(BuildContext context) => FutureBuilder<List<User>>( future: _future, builder: (context, snap) { if (snap.connectionState != ConnectionState.done) { return const Center(child: CircularProgressIndicator()); } if (snap.hasError) return const Center(child: Text('Something went wrong')); final users = snap.data!; return ListView.builder( itemCount: users.length, itemBuilder: (_, i) => ListTile(title: Text(users[i].name)), ); }, ); }
07

Write a simple counter using StatefulWidget and setState.

Save to ▾
Show answer
class Counter extends StatefulWidget { const Counter({super.key}); @override State<Counter> createState() => _CounterState(); } class _CounterState extends State<Counter> { int _count = 0; @override Widget build(BuildContext context) => Column( mainAxisSize: MainAxisSize.min, children: [ Text('Count: $_count'), FilledButton( onPressed: () => setState(() => _count++), child: const Text('Add'), ), ], ); }
08

How do you create reusable custom widgets in Flutter?

Save to ▾
Show answer
Extract repeated UI into a StatelessWidget class with clear constructor parameters, rather than helper methods that return widgets, because classes get their own element, can be const and rebuild independently. Accept callbacks for events, use the theme for colours and text styles, and provide sensible defaults. Group them into a shared widgets folder or design system package and document them with widget previews or a showcase screen.
09

Write a Dart model class with fromJson and toJson.

Save to ▾
Show answer
class Product { const Product({required this.id, required this.name, required this.price}); final String id; final String name; final double price; factory Product.fromJson(Map<String, dynamic> json) => Product( id: json['id'] as String, name: json['name'] as String, price: (json['price'] as num).toDouble(), ); Map<String, dynamic> toJson() => {'id': id, 'name': name, 'price': price}; } // For larger apps use json_serializable or freezed to generate this.
10

How do you implement a form with validation in Flutter?

Save to ▾
Show answer
Wrap fields in a Form with a GlobalKey<FormState>, use TextFormField with a validator function that returns an error string or null, and call formKey.currentState!.validate() on submit. Use TextEditingController for values and dispose it, set keyboardType and textInputAction for each field, and autovalidateMode onUserInteraction to show errors as the user types. Keep validation rules in testable functions outside widgets.
11

Write a Cubit that loads products and emits loading, success and error states.

Save to ▾
Show answer
sealed class ProductState {} class ProductLoading extends ProductState {} class ProductLoaded extends ProductState { ProductLoaded(this.items); final List<Product> items; } class ProductError extends ProductState { ProductError(this.message); final String message; } class ProductCubit extends Cubit<ProductState> { ProductCubit(this._repo) : super(ProductLoading()); final ProductRepository _repo; Future<void> load() async { emit(ProductLoading()); try { emit(ProductLoaded(await _repo.fetchProducts())); } catch (_) { emit(ProductError('Could not load products')); } } }
12

Write a Riverpod provider that fetches data asynchronously and display it in a widget.

Save to ▾
Show answer
final productsProvider = FutureProvider.autoDispose<List<Product>>((ref) { final repo = ref.watch(productRepositoryProvider); return repo.fetchProducts(); }); class ProductsView extends ConsumerWidget { const ProductsView({super.key}); @override Widget build(BuildContext context, WidgetRef ref) { final products = ref.watch(productsProvider); return products.when( loading: () => const Center(child: CircularProgressIndicator()), error: (e, _) => const Center(child: Text('Failed to load')), data: (items) => ListView(children: [for (final p in items) ListTile(title: Text(p.name))]), ); } }
13

Write a go_router configuration with an auth redirect.

Save to ▾
Show answer
final router = GoRouter( initialLocation: '/', refreshListenable: authNotifier, redirect: (context, state) { final loggedIn = authNotifier.isLoggedIn; final goingToLogin = state.matchedLocation == '/login'; if (!loggedIn && !goingToLogin) return '/login'; if (loggedIn && goingToLogin) return '/'; return null; }, routes: [ GoRoute(path: '/', builder: (_, __) => const HomePage()), GoRoute(path: '/login', builder: (_, __) => const LoginPage()), GoRoute( path: '/product/:id', builder: (_, state) => ProductPage(id: state.pathParameters['id']!), ), ], );
14

How do you avoid unnecessary rebuilds in a Flutter app with state management?

Save to ▾
Show answer
Rebuild only what depends on the changed data. Use selectors such as context.select, ref.watch(provider.select(...)) or BlocSelector to listen to one field, split big widgets into smaller ones, and use const constructors. Keep state objects immutable with proper equality so identical states do not trigger rebuilds. Use Flutter DevTools rebuild tracking to find widgets that rebuild more often than expected.
15

How would you test a Bloc or Riverpod notifier?

Save to ▾
Show answer
Test business logic without widgets. For Bloc, the bloc_test package's blocTest builds the bloc with a fake repository, acts by adding events, and expects a list of emitted states. For Riverpod, create a ProviderContainer with overrides for repository providers, read the notifier, call methods and assert the state. Use mocktail for mocks and keep tests fast, deterministic and independent of the network.
16

How do you handle app-wide theming and dark mode in Flutter?

Save to ▾
Show answer
Define ThemeData for light and dark modes in MaterialApp, using ColorScheme.fromSeed to generate consistent Material 3 colours, and set themeMode from a settings state, saved in shared preferences. Widgets read Theme.of(context).colorScheme and textTheme instead of hardcoded colours. Add ThemeExtension classes for brand-specific tokens. This keeps the design consistent and makes switching themes a single state change.
17

Write a FlatList that shows products with pull-to-refresh and infinite scroll.

Save to ▾
Show answer
function ProductList({ items, loading, onRefresh, onEndReached }) { const renderItem = useCallback(({ item }) => <ProductRow product={item} />, []); return ( <FlatList data={items} keyExtractor={(item) => item.id} renderItem={renderItem} refreshing={loading} onRefresh={onRefresh} onEndReached={onEndReached} onEndReachedThreshold={0.5} ListEmptyComponent={!loading ? <Text>No products</Text> : null} /> ); }
18

Write a custom hook that fetches data with loading and error states.

Save to ▾
Show answer
function useFetch(url) { const [state, setState] = useState({ data: null, loading: true, error: null }); useEffect(() => { const controller = new AbortController(); fetch(url, { signal: controller.signal }) .then((r) => { if (!r.ok) throw new Error('HTTP ' + r.status); return r.json(); }) .then((data) => setState({ data, loading: false, error: null })) .catch((e) => { if (e.name !== 'AbortError') setState({ data: null, loading: false, error: e.message }); }); return () => controller.abort(); }, [url]); return state; }
19

How do you handle platform-specific code in React Native?

Save to ▾
Show answer
Use Platform.OS checks or Platform.select({ ios: ..., android: ... }) for small differences in styles or behaviour. For larger differences, create files with platform extensions like DatePicker.ios.tsx and DatePicker.android.tsx, and the bundler picks the right one automatically. Keep platform branches inside small components so screens stay shared. Native platform differences, such as permissions setup, are configured in native files or Expo config plugins.
20

How does the keyboard affect layouts in React Native and how do you handle it?

Save to ▾
Show answer
When the keyboard opens it can cover inputs, especially at the bottom of the screen. Use KeyboardAvoidingView with behavior padding on iOS, and rely on Android's adjustResize window setting, or use react-native-keyboard-controller for consistent behaviour on both. Wrap forms in a ScrollView with keyboardShouldPersistTaps set to handled so buttons work while the keyboard is open, and dismiss the keyboard on submit.
21

How do you debug a React Native app?

Save to ▾
Show answer
Use React Native DevTools, the default debugger since 0.76, for console logs, breakpoints, React component inspection and profiling. Inspect network requests with the network panel or a proxy. For native crashes, check Logcat in Android Studio and the Xcode console. Use the performance monitor overlay for frame rates, and add a crash reporting tool like Sentry or Crashlytics for production errors with source maps uploaded.
22

Write a React Native component that requests location permission and shows the coordinates using Expo.

Save to ▾
Show answer
import * as Location from 'expo-location'; export function MyLocation() { const [coords, setCoords] = useState(null); const [error, setError] = useState(null); useEffect(() => { (async () => { const { status } = await Location.requestForegroundPermissionsAsync(); if (status !== 'granted') { setError('Location permission denied'); return; } const pos = await Location.getCurrentPositionAsync({}); setCoords(pos.coords); })(); }, []); if (error) return <Text>{error}</Text>; if (!coords) return <ActivityIndicator />; return <Text>{coords.latitude}, {coords.longitude}</Text>; }
23

Write a React Navigation setup with a stack containing a tab navigator and a details screen.

Save to ▾
Show answer
const Tab = createBottomTabNavigator(); const Stack = createNativeStackNavigator(); function HomeTabs() { return ( <Tab.Navigator> <Tab.Screen name="Feed" component={FeedScreen} /> <Tab.Screen name="Profile" component={ProfileScreen} /> </Tab.Navigator> ); } export default function App() { return ( <NavigationContainer> <Stack.Navigator> <Stack.Screen name="Home" component={HomeTabs} options={{ headerShown: false }} /> <Stack.Screen name="Details" component={DetailsScreen} /> </Stack.Navigator> </NavigationContainer> ); }
24

Write a Redux Toolkit slice for a cart.

Save to ▾
Show answer
const cartSlice = createSlice({ name: 'cart', initialState: { items: [] }, reducers: { addItem(state, action) { const existing = state.items.find((i) => i.id === action.payload.id); if (existing) existing.qty += 1; else state.items.push({ ...action.payload, qty: 1 }); }, removeItem(state, action) { state.items = state.items.filter((i) => i.id !== action.payload); }, }, }); export const { addItem, removeItem } = cartSlice.actions; export const selectTotal = (s) => s.cart.items.reduce((t, i) => t + i.price * i.qty, 0);
25

How do you implement authentication flow screens in React Navigation?

Save to ▾
Show answer
Conditionally render screen groups based on auth state: if the user is signed out, the navigator shows login and signup; when signed in, it shows the app screens. Changing state automatically switches stacks and prevents going back to login with the back button. Restore tokens from secure storage on startup while showing a splash screen. Expo Router offers protected routes for the same pattern.
26

How do you handle gestures such as swipe to delete in React Native?

Save to ▾
Show answer
Use react-native-gesture-handler, which processes gestures on the native side, often with Reanimated for smooth animations. For swipe to delete, the Swipeable or ReanimatedSwipeable component renders action buttons behind a row. Define gestures with the Gesture API, such as Gesture.Pan, and compose them when needed. Wrap the app root in GestureHandlerRootView. Provide an accessible alternative like a long-press menu for screen reader users.
27

How would you migrate a large React Native app from JavaScript to TypeScript?

Save to ▾
Show answer
Enable TypeScript with allowJs so both coexist, start with a relaxed tsconfig, and convert shared code first: API types, models, utilities and navigation param lists. Then convert screens feature by feature, tightening strict options gradually. Add type checks to CI so new files must be TypeScript. Avoid using any to silence errors; use unknown and narrow. Track progress and celebrate milestones to keep momentum.
28

Write a Dart HTTP client using dio with an interceptor that adds an auth token.

Save to ▾
Show answer
final dio = Dio(BaseOptions( baseUrl: 'https://api.example.com', connectTimeout: const Duration(seconds: 10), receiveTimeout: const Duration(seconds: 15), )); dio.interceptors.add(InterceptorsWrapper( onRequest: (options, handler) async { final token = await secureStorage.read(key: 'access_token'); if (token != null) options.headers['Authorization'] = 'Bearer $token'; handler.next(options); }, onError: (e, handler) { if (e.response?.statusCode == 401) authNotifier.logout(); handler.next(e); }, ));
29

How do you implement OTP login with a phone number?

Save to ▾
Show answer
The user enters a phone number, the backend or an auth service sends an OTP via SMS and returns a verification ID. The user enters the code, which is verified to issue session tokens. On Android, use the SMS Retriever or User Consent API to auto-read the code without SMS permissions; on iOS, set the text content type to one-time code for autofill. Rate-limit requests, expire codes quickly and protect against abuse.
30

How do you integrate a payment gateway in a mobile app safely?

Save to ▾
Show answer
Create the order on your backend with the amount, get an order ID, and open the gateway's SDK checkout in the app with that ID. After payment, the SDK returns a payment ID and signature, which the app sends to the backend to verify with the secret key before marking the order paid. Rely on server-side webhooks as the final truth. Never keep secret keys in the app or trust client-side success alone.
31

Write a React Native function that uploads an image with progress using Expo FileSystem.

Save to ▾
Show answer
import * as FileSystem from 'expo-file-system'; export async function uploadImage(uri, token, onProgress) { const task = FileSystem.createUploadTask( 'https://api.example.com/upload', uri, { httpMethod: 'POST', uploadType: FileSystem.FileSystemUploadType.MULTIPART, fieldName: 'file', headers: { Authorization: `Bearer ${token}` }, }, ({ totalBytesSent, totalBytesExpectedToSend }) => onProgress(totalBytesSent / totalBytesExpectedToSend) ); const res = await task.uploadAsync(); if (res.status !== 200) throw new Error('Upload failed'); return JSON.parse(res.body); }
32

How do you handle API errors gracefully in the UI?

Save to ▾
Show answer
Map errors into categories in the data layer: no internet, timeout, server error, unauthorised and validation errors with field messages. The UI shows a friendly message and a retry action for network issues, inline messages for validation, and redirects to login for unauthorised. Keep cached data visible when refresh fails. Log unexpected errors to crash reporting with request context but never sensitive data.
33

Write a Flutter widget test that taps a button and checks the counter text.

Save to ▾
Show answer
testWidgets('increments counter on tap', (tester) async { await tester.pumpWidget(const MaterialApp(home: Scaffold(body: Counter()))); expect(find.text('Count: 0'), findsOneWidget); await tester.tap(find.text('Add')); await tester.pump(); expect(find.text('Count: 1'), findsOneWidget); });
34

Write a React Native Testing Library test for a login button showing a validation error.

Save to ▾
Show answer
import { render, screen, fireEvent } from '@testing-library/react-native'; test('shows error when email is empty', () => { render(<LoginScreen onSubmit={jest.fn()} />); fireEvent.press(screen.getByRole('button', { name: 'Login' })); expect(screen.getByText('Email is required')).toBeTruthy(); });
35

How do you measure performance in a Flutter app?

Save to ▾
Show answer
Run the app in profile mode on a real device, not debug or emulator. Use Flutter DevTools: the performance view shows frame build and raster times, the CPU profiler finds expensive functions, and the memory view tracks allocations and leaks. Target under about 16 milliseconds per frame for 60 fps. The performance overlay shows UI and raster thread graphs, and rebuild tracking highlights widgets rebuilding too often.
36

How do you reduce app size for Flutter and React Native apps?

Save to ▾
Show answer
Publish Android App Bundles so users download only their architecture and density resources. In Flutter, use --split-debug-info and --obfuscate, remove unused packages and fonts, compress images and use tree-shaken icons. In React Native, enable Hermes, R8 minification and resource shrinking, and remove heavy libraries. For both, analyse size with tools like flutter build --analyze-size or APK Analyzer and lazy-load large assets.
37

How do you detect and fix memory leaks in cross-platform apps?

Save to ▾
Show answer
Leaks usually come from subscriptions, timers, controllers and listeners that are never disposed, or global caches that grow without limits. In Flutter, dispose controllers and cancel stream subscriptions in dispose, and check the DevTools memory view for growing instances. In React Native, return cleanup functions from useEffect and remove event listeners. Repeatedly open and close a screen while profiling to confirm memory returns to baseline.
38

How do you set up CI/CD for a cross-platform mobile app?

Save to ▾
Show answer
On every pull request, run lint, formatting checks, unit and widget or component tests. On merge, build signed Android and iOS release artifacts using CI services such as GitHub Actions, Codemagic, Bitrise or EAS Build, with signing keys stored as secrets. Use fastlane or EAS Submit to upload to internal testing tracks and TestFlight. Automate version numbers, generate release notes and run smoke tests with Maestro.
39

Write a GitHub Actions workflow that runs Flutter tests on every pull request.

Save to ▾
Show answer
name: flutter-ci on: pull_request: branches: [main] jobs: test: runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 - uses: subosito/flutter-action@v2 with: channel: stable cache: true - run: flutter pub get - run: dart format --set-exit-if-changed . - run: flutter analyze - run: flutter test --coverage
40

How would you set quality gates before a mobile release?

Save to ▾
Show answer
Define clear criteria: all automated tests pass, no open critical or high bugs, crash-free rate in beta above an agreed threshold like 99.5 percent, performance budgets for startup time and app size met, accessibility checks on new screens, and security review for sensitive changes. Run smoke tests on the release build on real devices. Release with a staged rollout and monitor metrics before expanding.
41

How do you build a release version of a Flutter app for both stores?

Save to ▾
Show answer
flutter build appbundle --release --obfuscate --split-debug-info=build/symbols # Output: build/app/outputs/bundle/release/app-release.aab flutter build ipa --release --obfuscate --split-debug-info=build/symbols # Output: build/ios/ipa/*.ipa, upload with Transporter or xcrun altool # Version comes from pubspec.yaml, for example: # version: 2.3.1+45 (name 2.3.1, build number 45)
42

Write an EAS configuration for development, preview and production builds.

Save to ▾
Show answer
{ "cli": { "version": ">= 12.0.0" }, "build": { "development": { "developmentClient": true, "distribution": "internal" }, "preview": { "distribution": "internal", "channel": "preview" }, "production": { "autoIncrement": true, "channel": "production" } }, "submit": { "production": {} } }
43

How do you force users to update when an old version has a critical bug?

Save to ▾
Show answer
Keep a minimum supported version in remote config or an API endpoint, check it at startup and show a blocking update screen linking to the store. On Android, use the Play In-App Updates API with the immediate flow for critical updates and flexible flow for normal ones. Keep the backend compatible with older versions for a defined period, and use forced updates sparingly because they frustrate users.
44

How do you automate store submissions with fastlane?

Save to ▾
Show answer
fastlane defines lanes in a Fastfile, such as beta and release. A lane can increment build numbers, build the app with gradle or gym, sign with match, which stores iOS certificates encrypted in a private repository, upload to TestFlight with pilot or Play testing tracks with supply, and upload metadata and screenshots. Running lanes from CI makes releases repeatable and removes manual steps on a developer's machine.
45

Write a release checklist for a mobile app update.

Save to ▾
Show answer
1. Bump version name and build number on both platforms. 2. Run full automated tests and smoke tests on release builds. 3. Verify signing, obfuscation and debug symbol upload. 4. Check new permissions and update store privacy declarations. 5. Update release notes and screenshots if UI changed. 6. Upload to internal track and TestFlight; QA sign-off. 7. Submit for review with reviewer notes and demo account. 8. Start staged rollout at 5 to 10 percent. 9. Monitor crashes, ANRs, reviews and key metrics. 10. Expand rollout or halt and hotfix.

Frequently asked questions

Why are practical questions important?

Most technical rounds include at least one live task. Practising the exact typing and reasoning makes you calm and fast in the real round.

How should I answer them?

Talk while you work: say your approach first, write the simplest correct version, then improve it and mention edge cases.