This guide is part of a 719-question React Native interview handbook collected from real interviews across startups, product companies, fintech, e-commerce, and MNCs. Questions range from beginner to senior (5+ years) and cover JavaScript, React Native, New Architecture, performance, security, native modules, iOS, Android, system design, and behavioral interviews.
This article contains 140 questions (global questions 421–560). Answer each question before reading the response, explain assumptions and complexity for coding questions, and adapt behavioral examples to your truthful experience.
Difficulty guide
- 🟢 Beginner — expected for entry-level and junior React Native roles.
- 🟡 Intermediate — expected for engineers who can independently ship features.
- 🔴 Senior — tests architecture, trade-offs, production ownership, and native-platform knowledge.
Topics in this part
- Deep linking, debugging, builds, testing, security, and production issues
- Authentication, Fastlane, CI/CD, and release safety
- System design and offline-first architecture
- SQLite, Realm, WatermelonDB, Nx, and Turborepo
- AI-assisted mobile development
- Coding Problems — questions 1–47
Complete series
This Dev.to series has five core handbook articles plus five focused practice extras. Open the series page to move through the complete reading order:
- Part 1: JavaScript — core handbook, questions 1–120
- Part 2: React — core handbook, questions 121–220
- Part 3: React Native — core handbook, questions 221–420
- Part 4: Performance & Architecture — core handbook, questions 421–560
- Part 5: Senior & System Design — core handbook, questions 561–719
- Part 6: Output-Based JavaScript Practice — bonus practice article
- Part 7: Coding Interview Practice — bonus practice article
- Part 8: Code Output Challenges — bonus practice article
- Part 9: Current React Native Interview Questions — new high-frequency practice article
- Part 10: Project & Production Interviews — senior project ownership and real-production practice
Series navigation
Use the Complete React Native Interview Handbook 2026 series page on Dev.to to open every part in order.
Continuation note
This part begins with the remaining delivery topics from Part 3 and ends midway through Coding Problems.
Question bank
1. A deep link opens the wrong screen when the app starts from a killed state?
Answer
Answer: I log the raw initial URL, React Navigation linking parse result, restored auth state, and restored navigation state. I process the initial link once, validate params, and wait for auth hydration before navigating. If the route is protected I store it as a pending destination, complete login, then reset/navigate. I test custom schemes and universal links separately.
2. How does deep linking work end to end?
Example:Answer
Answer: A URL reaches the OS, the OS matches the app's registered scheme, universal link, or app link, and launches or resumes the app. React Native reads the initial URL for a cold start or receives a URL event while running. React Navigation's linking config converts the path into a route and params. I validate the destination, wait for auth restoration, and redirect protected links through login before continuing.
<NavigationContainer linking={linking}>...</NavigationContainer>;
🔴 Senior
3. Dynamic linking of native libraries?
Answer
Answer: Static libraries are copied into the app binary; dynamic frameworks are loaded at runtime and must be embedded and code signed. On Android native .so files must exist for supported ABIs and be packaged under jniLibs or an AAR. I check architecture slices, duplicate symbols, runtime search paths, minimum OS versions, license terms, and release stripping before integrating.
4. How does deep linking work?
Answer
Answer: A linking configuration maps URL prefixes and paths to routes and parameters. Native intent filters or associated domains deliver cold and warm links to the app.
Debugging & Troubleshooting
8 reviewed questions.
🟡 Intermediate
1. Crash vs ANR and how do you detect each?
Answer
Answer: An Android ANR means the main thread failed to respond within a system-defined timeout for an input, component, or broadcast operation. I start with Play Console Android vitals or captured ANR traces, inspect the blocked main-thread stack and locks, and correlate it with Perfetto or system traces. StrictMode can expose accidental disk or network work during development, but it does not replace ANR traces and should not be described as the ANR detector. I move blocking work off the main thread, shorten lock scope, and verify the affected path on a release build.
2. How do you debug a React Native app?
Answer
Answer: I reproduce with exact version/device, inspect JS logs and network, use React Native DevTools and React Profiler, debug native Android with Logcat/Android Studio and iOS with Xcode, and inspect production issues through Sentry/Crashlytics. I narrow the layer—JS logic, rendering, network, native module, build, or device—and verify the fix in release mode with regression tests.
3. Images crash Android with OutOfMemoryError?
Answer
Answer: I check source dimensions and decoded bitmap memory, because a compressed file can still decode into a huge bitmap. I request server-sized thumbnails, avoid base64, limit concurrent image loads, use a maintained cache library, and keep FlatList windows reasonable. I inspect Android memory and image cache behavior and never solve it by simply increasing the heap.
4. Push notifications work in debug but not in release?
Answer
Answer: I verify production APNs credentials, release bundle id/package name, provisioning entitlements, Firebase service files for the correct flavor, Android notification permission and channels, and R8 keep rules for the notification SDK. I test an installed release build with the app foreground, background, and killed, and inspect native device logs and provider delivery reports.
5. What is Flipper?
Answer
Answer: Flipper is a standalone extensible desktop debugger, but React Native no longer treats its integration as the default debugging path. For framework-aware inspection I start with the React Native DevTools version bundled with the target React Native release, and use platform tools such as Android Studio, Xcode Instruments, or Perfetto for native evidence. A team may still maintain a compatible Flipper setup for specific plugins, but I would not present it as universally bundled or as the primary profiler.
🔴 Senior
6. How do you debug a native crash that occurs only in release?
Answer
Answer: Reproduce the exact signed build, collect and symbolicate its stack with matching dSYMs, R8 mappings, or NDK symbols, correlate release and device evidence, and verify through staged deployment.
7. How do you debug a production-only React Native crash?
Answer
Answer: Segment by app version, platform, device, rollout cohort, and recent change; symbolicate native stacks and upload matching JavaScript source maps. Reproduce with a release build and production-equivalent configuration, add privacy-safe breadcrumbs, and test one hypothesis at a time. Mitigate with rollback or a feature flag before pursuing a broader refactor.
8. How do you investigate an Android ANR?
Answer
Answer: An Android ANR means the main thread failed to respond within a system-defined timeout for an input, component, or broadcast operation. I start with Play Console Android vitals or captured ANR traces, inspect the blocked main-thread stack and locks, and correlate it with Perfetto or system traces. StrictMode can expose accidental disk or network work during development, but it does not replace ANR traces and should not be described as the ANR detector. I move blocking work off the main thread, shorten lock scope, and verify the affected path on a release build.
Build & Release Process
29 reviewed questions.
🟡 Intermediate
1. App thinning and app optimization?
Answer
Answer: Apple App Thinning delivers device-specific architectures and assets; Android App Bundles let Play generate optimized APKs. I also enable Hermes and R8, compress images, remove unused fonts/assets/native libraries, audit dependencies, avoid universal APKs, lazy-load non-critical work, and inspect JS/native bundle size. Thinning reduces download size but does not replace runtime profiling.
2. Beta testing and adding test users?
Answer
Answer: On iOS I add internal App Store Connect users or external TestFlight testers; external builds may require beta review. On Android I create an internal/closed testing track and add email lists or Google Groups. For backend test users I provide non-production accounts with safe data, document OTP/payment bypasses securely, and give App Review a working demo account when login is required.
3. Build release bundle?
Answer
Answer: For Android, produce a signed release AAB or APK through Gradle; for iOS, archive the Release scheme and export or upload it through Xcode or Fastlane. Verify production configuration, signing, symbols, installation on a real device, and smoke tests before distribution.
4. Code signing and keystore?
Answer
Answer: Code signing proves who produced the binary and protects update integrity. Android uses a keystore containing the private signing key; Play App Signing can hold the app-signing key while CI uses an upload key. iOS uses certificates, private keys, provisioning profiles, app id, and entitlements. Losing keys can block updates, so they belong in secure backup/CI secret storage with controlled access.
5. CodePush limitations and alternatives?
Answer
Answer: Microsoft retired the hosted App Center CodePush service on March 31, 2025. Microsoft provides a standalone open-source CodePush deployment path, but self-hosting shifts availability, security, and operations to the team, so I do not describe the retired hosted service as a current default. For a new project I compare that path with a maintained provider such as EAS Update. Any OTA design must enforce native-runtime compatibility, signed updates, staged rollout, rollback, monitoring, and Apple and Google policy constraints; native code and permission changes still require a store release.
6. CodePush vs full store release — when which?
Answer
Answer: Microsoft retired the hosted App Center CodePush service on March 31, 2025. Microsoft provides a standalone open-source CodePush deployment path, but self-hosting shifts availability, security, and operations to the team, so I do not describe the retired hosted service as a current default. For a new project I compare that path with a maintained provider such as EAS Update. Any OTA design must enforce native-runtime compatibility, signed updates, staged rollout, rollback, monitoring, and Apple and Google policy constraints; native code and permission changes still require a store release.
7. Complete App Store and Play Store live process?
Answer
Answer: I bump versions, create signed release binaries, run regression on real devices, upload dSYM/source maps and Android mapping, test TestFlight/internal track, complete privacy/data safety, screenshots, content rating, permissions, export compliance, and reviewer credentials. Then I use phased/staged rollout, monitor crashes, ANRs, startup, and reviews, and keep rollback/hotfix plans. Native changes require a new binary.
8. Environment setup for a React Native project?
Answer
Answer: I pin Node and package manager versions, install JDK/Android Studio SDKs, Xcode/CocoaPods, and run the environment doctor. I keep environment-specific public configuration in typed files or build settings, never real secrets. Android flavors and iOS schemes select staging/production bundle ids, API URLs, icons, signing, and service files. CI uses the same locked versions and package lock.
9. Git workflow in a team?
Answer
Answer: I branch from the current integration branch, make small focused commits, rebase or merge according to team policy, push, open a PR, address review, pass CI, and merge with traceable history. I pull before long work, avoid committing secrets/generated noise, and never force-push shared main. Releases use protected branches/tags and documented hotfix flow.
10. Google Play release — what do you check?
Answer
Answer: I upload an AAB with incremented versionCode, complete Data Safety, meet target API requirements, use Play App Signing, test on internal and closed tracks, then stage production rollout and watch crashes, ANRs, and reviews.
11. How do Android build variants and iOS schemes differ?
Answer
Answer: Android combines product flavors and build types into variants. iOS schemes and build configurations select settings, targets, signing, and bundles.
12. How do you build reusable custom components?
Answer
Answer: I keep a small typed API, use composition instead of many boolean props, support accessibility and test IDs, expose style overrides carefully, and separate visual components from data fetching. For imperative behavior I use forwardRef and useImperativeHandle. A design system should centralize spacing, colors, typography, and interaction states.
13. How do you handle version updates and React Native migrations?
Answer
Answer: I read release notes and Upgrade Helper, update one major layer at a time, create a migration branch, validate New Architecture/library compatibility, update Pods/Gradle/JDK/Xcode requirements, run codemods, rebuild native projects, and test critical flows on both platforms. I compare startup, crashes, and bundle size before rollout and keep a rollback plan.
14. ProGuard/R8 — what and why?
Answer
Answer: R8 shrinks, optimizes, and obfuscates Android bytecode; ProGuard rules control what must be kept. It reduces APK size and makes reverse engineering harder, but obfuscation is not security. Reflection-heavy SDKs, serializers, and React Native modules may need keep rules. I test release builds and upload mapping.txt to Crashlytics/Sentry so obfuscated crashes are readable.
15. Senior Git scenarios: conflict, wrong commit, revert, and cherry-pick?
Answer
Answer: For conflicts I understand both changes, resolve locally, run tests, and continue the merge/rebase. To undo a published change I use git revert because it preserves history. I use reset only for local unshared history. cherry-pick copies a focused commit to a release/hotfix branch. I use force-with-lease only on my own branch with team awareness, never casually on main.
16. What is CodePush? When do you use it?
Answer
Answer: Microsoft retired the hosted App Center CodePush service on March 31, 2025. Microsoft provides a standalone open-source CodePush deployment path, but self-hosting shifts availability, security, and operations to the team, so I do not describe the retired hosted service as a current default. For a new project I compare that path with a maintained provider such as EAS Update. Any OTA design must enforce native-runtime compatibility, signed updates, staged rollout, rollback, monitoring, and Apple and Google policy constraints; native code and permission changes still require a store release.
17. What is Metro Bundler?
Answer
Answer: Metro is React Native's JavaScript bundler. It resolves modules, transforms JSX/TypeScript through Babel, creates the dependency graph and bundle/assets, and powers Fast Refresh. metro.config.js handles monorepos, aliases, asset extensions, transformers, and resolver settings. Metro is not the native build system; Gradle and Xcode still compile and package native code.
18. What is Metro?
Answer
Answer: Metro is React Native's JavaScript bundler and development server, handling resolution, transforms, assets, and Fast Refresh.
19. What is app thinning?
Answer
Answer: App thinning is Apple’s mechanism for delivering only the architecture, resolution-specific assets, and resources a device needs. Android App Bundles provide a similar optimized-per-device result. In React Native I use asset catalogs, correctly sized images, Hermes, and avoid unused assets.
20. iOS App Store review — what do you check before submit?
Answer
Answer: I verify signing, provisioning, entitlements, privacy labels, ATS, permission strings, absence of private APIs, reviewer credentials when needed, and that the submitted release build is exactly what QA tested.
🔴 Senior
21. A CodePush/OTA update crashes only one native app version?
Answer
Answer: I stop the rollout or roll back the incompatible update, segment failures by native runtime version, and verify the update's runtime compatibility policy. An OTA bundle can call native APIs that do not exist in an older binary even when the JavaScript deployment itself succeeded. I add explicit runtime versioning, release-channel isolation, staged rollout, smoke tests against every supported binary, and crash-rate rollback thresholds. Hosted App Center CodePush was retired on March 31, 2025, so the same controls must be implemented with the maintained OTA provider the project actually uses.
22. A native SDK works in debug but crashes in the release build?
Answer
Answer: On Android I inspect R8/ProGuard keep rules, missing transitive dependencies, ABI packaging, initialization order, and obfuscated stack traces using mapping.txt. On iOS I inspect framework embedding/signing, architecture slices, linker flags, dSYM symbolication, and release-only optimization assumptions. I reproduce the exact signed release binary and compare native logs.
23. Design a CI/CD pipeline for React Native?
Answer
Answer: PRs run format, type, lint, tests, and targeted native builds. Main produces signed immutable artifacts, runs E2E, uploads maps and symbols, promotes the same artifact through staged tracks, and gates on health metrics.
24. How do you make a build-vs-buy decision for a library?
Answer
Answer: Assess product fit, maintenance, New Architecture support, platforms, security, license, size, performance, accessibility, API stability, and exit cost; prototype the risky path and inspect native code.
25. How do you reduce APK or IPA size?
Answer
Answer: Analyze the artifact, remove unused native dependencies and resources, optimize images, use app bundles or ABI splits, enable R8 where safe, and avoid oversized JS assets.
26. Production crashes increased after a staged release. What actions do you take?
Answer
Answer: I compare crash-free users and ANRs by app version, OS, device, and affected flow. I symbolicate with uploaded source maps, dSYMs, and mapping files, then identify whether the regression is JS or native. I pause the rollout, roll back an OTA if compatible, prepare a hotfix, add a regression test, and monitor the fixed cohort before resuming rollout. Communication and impact assessment are part of the response.
27. What can CodePush or OTA updates change?
Answer
Answer: Microsoft retired the hosted App Center CodePush service on March 31, 2025. Microsoft provides a standalone open-source CodePush deployment path, but self-hosting shifts availability, security, and operations to the team, so I do not describe the retired hosted service as a current default. For a new project I compare that path with a maintained provider such as EAS Update. Any OTA design must enforce native-runtime compatibility, signed updates, staged rollout, rollback, monitoring, and Apple and Google policy constraints; native code and permission changes still require a store release.
28. What can safely ship through an OTA update?
Answer
Answer: Compatible JavaScript and assets can ship OTA; native binaries, permissions, SDKs, and entitlements cannot. Sign updates and bind them to a runtime compatibility version.
29. What would you build now, and what would you deliberately postpone?
Answer
Answer: Build the smallest reversible slice that meets current scale, security, and reliability needs; postpone speculative abstractions while documenting triggers for pagination, caching, native work, or service extraction.
Testing
7 reviewed questions.
🟡 Intermediate
1. How do you test React Native hooks and asynchronous UI behavior?
Answer
Answer: Render the component or hook through its public behavior, trigger the user action, and await the observable state with Testing Library queries. Control time and network boundaries explicitly, wrap state changes through supported helpers, and assert cleanup for timers, subscriptions, and aborted requests.
2. Jest and React Native Testing Library example strategy?
Answer
Answer: I render the component, query by role/text/test id, perform user actions, and assert visible outcomes rather than internal state. I mock network at the service or MSW layer, use fake timers for debounce, and clean native module mocks. Tests should verify loading, success, empty, error, retry, and accessibility behavior.
3. Unit tests, integration tests, snapshots, and E2E?
Answer
Answer: Unit tests isolate pure functions/hooks. React Native Testing Library tests components through user-visible behavior. Integration tests cover connected flows with mocked boundaries. Snapshot tests catch structural changes but become noisy if overused; I keep them small and review diffs. Detox or Maestro covers critical end-to-end flows on real app builds.
🔴 Senior
4. How do you choose unit, integration, and end-to-end tests in React Native?
Answer
Answer: Use unit tests for pure rules and reducers, integration tests for component behavior across state and service boundaries, and a small set of device tests for critical native and user journeys. Prefer observable behavior over implementation details, keep fixtures deterministic, and move a regression to the cheapest test layer that can reproduce it reliably.
5. How do you reduce flaky Detox or Maestro end-to-end tests?
Answer
Answer: Use stable accessibility identifiers, deterministic test accounts and backend state, explicit synchronization on observable conditions, and isolated cleanup. Remove arbitrary sleeps, capture logs and screenshots on failure, quarantine only with an owner and deadline, and track flake rate separately from product failures.
6. How do you reduce flaky E2E tests?
Answer
Answer: Wait on observable state instead of sleeps, use stable accessibility IDs, deterministic data, isolation and reset, control irrelevant animation and dependencies, and collect artifacts on failure.
7. What is your testing strategy for a React Native application?
Answer
Answer: Use unit tests for domain logic, Testing Library for visible component behavior, focused native integration tests, contract tests, and a small critical E2E suite.
Security
6 reviewed questions.
🟡 Intermediate
1. Biometric authentication implementation?
Answer
Answer: Biometrics should unlock a locally stored credential or approve an operation; they do not replace server authentication. I store the refresh token in Keychain/Keystore with biometric access control, prompt through a native library, then refresh the server session. I handle changed biometric enrollment, unavailable hardware, lockout, fallback PIN, and logout token revocation.
2. React Native WebView use cases and risks?
Answer
Answer: WebView embeds web content for payments, legacy pages, rich documents, or authentication flows. I validate navigation URLs, restrict origins, avoid injecting secrets, sanitize messages, and define a narrow postMessage protocol. It is not a replacement for all native UI because performance, accessibility, navigation, and security differ.
🔴 Senior
3. HMAC and SSL pinning?
Answer
Answer: HMAC signs a message with a shared secret so the server can verify integrity and authenticity; include timestamp and nonce to prevent replay. SSL pinning makes the app trust specific certificates or public keys instead of any system CA, reducing MITM risk. Pinning adds certificate rotation and outage risk, so I use backup pins and remote-safe migration. Neither protects a compromised device completely.
4. How do you keep secrets and signing material out of a mobile application?
Answer
Answer: Assume values shipped in an application bundle can be extracted. Keep privileged credentials and signing keys in backend or CI secret stores, use short-lived scoped tokens for clients, restrict public service keys by platform and API, and rotate exposed material. Obfuscation can raise effort but is not secret storage.
5. How do you threat-model a React Native authentication flow?
Answer
Answer: Identify assets, trust boundaries, attacker capabilities, entry points, and abuse cases across the app, device, network, deep links, backend, and third-party SDKs. Then choose controls for token lifetime, secure storage, transport, replay, device compromise, logging, recovery, and server-side authorization. Validate controls with abuse-case tests and incident telemetry.
6. Should every app use certificate pinning?
Answer
Answer: No. Pinning can reduce selected MITM risks but adds rotation and outage risk. Use it only when threat model or compliance justifies the cost, with backup pins, monitoring, rotation, and recovery.
Production Issues
2 reviewed questions.
🔴 Senior
1. How do you lead a production incident in a React Native application?
Answer
Answer: Confirm impact and severity, establish an incident lead and communication channel, stop harmful rollout, and choose the fastest reversible mitigation. Preserve evidence, assign parallel investigation owners, update stakeholders on a fixed cadence, and define recovery from user-visible metrics. Afterward, document contributing conditions and owned prevention work without blame.
2. How do you verify that a production hotfix actually solved the issue?
Answer
Answer: Define the failure metric and expected recovery before release, reproduce the original path in a release build, and deploy to a small representative cohort. Compare crash, latency, error, and business signals against a baseline while watching for secondary regressions. Expand only when the signal is stable and retain an immediate rollback path.
1. Design a production login flow?
Answer
Answer: On launch I show a splash while reading the refresh token from secure storage. If present, I refresh the session; otherwise I show AuthStack. After login I keep the access token in memory, refresh token in Keychain/Keystore, reset to AppStack, and register the push token. On 401 a single-flight refresh retries queued requests. Logout revokes tokens, clears persisted user data, unregisters push where needed, and resets navigation.
2. Offline React Native design?
Answer
Answer: I distinguish cached reads from queued writes. Reads come from a local DB/cache with freshness metadata. Writes are saved as durable operations with ids, timestamps, retry count, and idempotency key, then flushed when NetInfo reports connectivity. I use exponential backoff, conflict strategy, transactions, and visible sync status. MMKV fits small data; SQLite or WatermelonDB fits large relational datasets.
🔴 Senior
3. Design a New Architecture migration for a large React Native application?
Answer
Answer: Inventory native modules, view managers, code generation, animation, storage, navigation, and build tooling, then classify each dependency as compatible, replaceable, patchable, or blocking. Enable the architecture in controlled environments, migrate high-risk native boundaries incrementally, and compare startup, memory, rendering, crashes, and business flows. Preserve build-level rollback until both platforms and production cohorts are stable. React Native 0.82 and later run only on the New Architecture; 0.81 was the final release that allowed the Legacy Architecture, so migration and fallback advice must be tied to the project's target release.
4. Design a background media-download manager?
Answer
Answer: Model every download as a durable state machine keyed by content ID, with URL, destination, expected size, checksum, downloaded bytes, retry state, and ownership. Use platform background-transfer capabilities where continuity is required, publish throttled progress to active UI subscribers, and persist lifecycle checkpoints. Reconcile database state with actual files after restart and enforce storage, network, battery, and entitlement policies.
5. Design a feature-flag and remote-configuration platform for mobile?
Answer
Answer: Ship safe defaults in the binary and fetch signed, versioned configuration with cache expiry and schema validation. Evaluate targeting deterministically from non-sensitive attributes, record exposure events, and provide kill switches for risky features. Configuration must not attempt to activate native capability absent from the installed binary.
6. Design a mobile analytics architecture that protects privacy?
Answer
Answer: Define a typed event catalog with owner, purpose, allowed properties, retention, and consent requirement. Route events through one client that validates schemas, removes prohibited data, batches delivery, and honors opt-out state before collection. Version events deliberately and reconcile mobile telemetry with backend facts for critical business outcomes.
7. Design a modular CI/CD pipeline for Android and iOS?
Answer
Answer: Use reproducible dependency installation, static analysis, unit tests, native build validation, signing isolation, artifact provenance, automated distribution, and release approval gates. Cache only deterministic inputs and keep credentials in the CI secret store with least privilege. Promote the same verified artifact through environments when platform rules allow, and capture version, commit, configuration, and dependency manifests.
8. Design a multi-brand or white-label React Native platform?
Answer
Answer: Separate shared product capabilities from tenant configuration, assets, design tokens, entitlements, API endpoints, and native identifiers. Generate deterministic brand builds from validated configuration and keep brand-specific behavior behind typed capability flags rather than scattered conditions. CI should test shared journeys for every supported configuration and protect signing assets independently.
9. Design a production observability architecture for a React Native application?
Answer
Answer: Combine crash reporting, handled-error telemetry, performance traces, structured breadcrumbs, release metadata, network correlation IDs, and business journey metrics. Normalize Android, iOS, JavaScript, and native symbols so incidents can be grouped accurately. Define service-level indicators such as crash-free sessions, startup percentiles, API failure rate, and checkout success, with alerts tied to user impact.
10. Design a push-notification delivery and navigation system?
Answer
Answer: The backend stores token, platform, app version, user, locale, permission, and freshness metadata and removes invalid tokens from provider feedback. Payloads contain a typed navigation intent rather than arbitrary route data. The app uses one handler for foreground, background, and terminated launches, validates authentication and authorization, and queues navigation until the root navigator is ready.
11. Design a real-time chat architecture with offline support?
Answer
Answer: Persist conversations and pending messages locally, use client-generated message IDs, and synchronize through a WebSocket plus a paginated REST recovery path. Model sending, sent, delivered, read, and failed states explicitly; preserve ordering with server sequence numbers rather than device clocks. Reconnect with backoff, request missed ranges, and keep media uploads separate from message creation.
12. Design a resilient React Native and PWA integration boundary?
Answer
Answer: Define a versioned, allow-listed message protocol with schema validation, origin checks, correlation IDs, timeouts, and explicit success and error responses. Keep authentication and sensitive operations native where possible, and sign messages when the threat model requires integrity across the boundary. Navigation, lifecycle, retry, and backward compatibility must be specified rather than inferred.
13. Design a resilient payment flow in React Native?
Answer
Answer: Treat the backend as the payment source of truth and model the client flow as explicit states such as initiated, awaiting authorization, processing, succeeded, failed, and unknown. Every create or confirm operation uses an idempotency key, and app restarts reconcile status from the backend. Sensitive data stays inside approved SDK boundaries, while logs exclude secrets and payment details.
14. Design a safe OTA update and staged-release strategy?
Answer
Answer: Separate JavaScript-compatible OTA changes from updates that require a new native binary. Sign updates, enforce runtime compatibility, stage rollout by cohort, monitor crash and business metrics, and support automatic or manual rollback. App Store and Play Store releases should also use phased rollout, release gates, and immutable build provenance.
15. Design a scalable, image-heavy social feed in React Native?
Answer
Answer: Use cursor pagination, normalized entities, a virtualized list, stable row contracts, thumbnail-first image loading, memory and disk caching, and cancellation for off-screen work. Separate server state from local interaction state and prefetch conservatively based on measured scroll behavior. Track frame rate, blank cells, image failures, memory, cache hit rate, and time to first useful content.
16. Design a secure authentication and token-rotation architecture for a mobile app?
Answer
Answer: Keep short-lived access tokens in memory when practical and refresh credentials in Keychain or Keystore-backed storage. Centralize authentication in one request layer, allow only one refresh operation at a time, replay eligible requests after success, and clear all protected state after definitive refresh failure. Add device binding or proof-of-possession only when the threat model justifies the complexity.
17. Design an offline-first mutation and synchronization engine for React Native?
Answer
Answer: Write mutations to a durable local outbox with a client operation ID, entity version, payload, and retry metadata. Update the UI optimistically from the local database, then drain the outbox when connectivity and OS scheduling allow. The server must support idempotency and conflict detection; the client needs bounded retry, authentication recovery, dead-letter handling, and observable sync state.
18. Design an offline-first mutation flow?
Answer
Answer: Write domain changes and an outbox record transactionally with client IDs and idempotency keys, update UI optimistically, retry under connectivity and OS constraints, and reconcile server acknowledgements and conflicts.
19. How do you design offline synchronization?
Answer
Answer: Use a local database as source of truth, a durable outbox, idempotent APIs, bounded retry, connectivity and OS scheduling, explicit conflict rules, and visible sync state.
20. How would you design a production chat feature?
Answer
Answer: Use a local database as UI source of truth, realtime transport for events, HTTP for history and media, client IDs and server sequences, message states, an offline outbox, pagination, virtualization, and reconnect rules.
Mobile Databases (SQLite, Realm & WatermelonDB)
7 reviewed questions.
🟡 Intermediate
1. When do you use SQLite?
Answer
Answer: Use SQLite for relational, queryable, transactional local data such as offline domain records and outboxes.
🔴 Senior
2. How do you design safe mobile database migrations?
Answer
Answer: Version every schema, make migrations deterministic and resumable where possible, preserve a backup or recovery path, and test upgrades from every supported production version. Large transforms should avoid blocking startup and must tolerate interruption. Record migration duration and failures without logging sensitive records.
3. How do you optimize SQLite performance in React Native?
Answer
Answer: Use transactions for batches, parameterized queries, appropriate indexes, pagination, projection of only required columns, and background work where supported. Inspect query plans and avoid one query per rendered row. Keep database access behind a repository or data layer so UI code cannot create uncontrolled query patterns.
4. How do you synchronize a local mobile database with a backend?
Answer
Answer: Track server cursors or versions, client operation IDs, local dirty state, tombstones, and an outbox for mutations. Pull changes incrementally, apply them transactionally, push idempotent operations, and resolve conflicts with a domain-specific policy. Expose sync health and recoverable failures to the UI while keeping partial progress durable.
5. How should database encryption and key management work on mobile?
Answer
Answer: Use a maintained encrypted database implementation when the threat model requires data-at-rest protection, and store the encryption key in Keychain or Keystore-backed storage rather than in source code or ordinary preferences. Define key rotation, logout cleanup, backup behavior, rooted-device limitations, and recovery. Minimize stored sensitive data even when encryption is enabled.
6. SQLite versus Realm versus WatermelonDB: how do you choose?
Answer
Answer: SQLite offers a mature relational foundation and direct query control but requires schema, mapping, and synchronization design. Realm provides an object-oriented database and reactive model with its own runtime and ecosystem trade-offs. WatermelonDB builds a lazy, observable data layer over SQLite-oriented storage for large React Native datasets. Choose from query shape, data size, reactivity, migration, sync, native footprint, maintenance, and team expertise.
7. When do you use WatermelonDB?
Answer
Answer: WatermelonDB targets large offline-first datasets with lazy observable queries and synchronization patterns.
Monorepos (Nx & Turborepo)
5 reviewed questions.
🔴 Senior
1. How do you optimize CI for a React Native monorepo?
Answer
Answer: Use the dependency graph to run lint, tests, builds, and native validation only for affected projects while preserving periodic full verification. Cache package installation, JavaScript outputs, Gradle, CocoaPods, and derived artifacts only with complete deterministic keys. Separate fast pull-request feedback from signed release pipelines and monitor cache correctness and restore time.
2. How should native modules and Codegen be managed in a monorepo?
Answer
Answer: Give each native-capable package a clear JavaScript API, Codegen specification, Android and iOS implementation, build metadata, and compatibility policy. Apps should consume released or workspace-resolved package entry points rather than native source through accidental relative paths. CI must validate Codegen and native builds for every affected application.
3. How would you structure a React Native monorepo with Nx?
Answer
Answer: Keep deployable mobile apps separate from domain, UI, platform, tooling, and configuration libraries. Use project boundaries and tags to prevent feature packages from importing app internals, expose public entry points, and configure affected builds and tests from the dependency graph. Native projects retain clear ownership while shared TypeScript code remains platform-aware.
4. Nx versus Turborepo for a React Native monorepo: what are the trade-offs?
Answer
Answer: Nx provides an explicit project graph, generators, affected commands, dependency constraints, and a larger integrated toolchain. Turborepo focuses on task orchestration and local or remote caching with fewer architectural opinions. The decision depends on repository scale, governance needs, existing package-manager workspaces, CI design, and whether the team values integrated conventions or a smaller surface.
5. What Metro configuration issues commonly appear in React Native monorepos?
Answer
Answer: Common issues include duplicate React copies, unresolved workspace packages, files outside watched roots, symlink behavior, asset paths, platform extension resolution, and incompatible package exports. Configure project root, watch folders, resolver paths, and package-manager layout deliberately, then verify that React and React Native resolve to one compatible instance.
AI-Assisted Mobile Development
5 reviewed questions.
🔴 Senior
1. How can AI assistants improve React Native debugging without replacing evidence?
Answer
Answer: Provide a minimal reproduction, exact platform and versions, logs, stack traces, recent changes, and observed versus expected behavior. Ask for ranked hypotheses and the evidence that would distinguish them, then verify each hypothesis with profiling, instrumentation, or a controlled experiment. Keep the final root-cause analysis tied to runtime evidence.
2. How do you review AI-generated React Native code?
Answer
Answer: Check requirements, platform behavior, lifecycle cleanup, thread assumptions, state ownership, error handling, accessibility, performance, security, dependency health, and test quality. Verify every API against the installed package version and inspect native configuration changes separately. Prefer a small understandable change over a large generated abstraction.
3. How should Cursor or GitHub Copilot be used safely in React Native development?
Answer
Answer: Use AI assistants for bounded tasks such as scaffolding, test cases, migration checklists, documentation, and code exploration, while keeping the engineer accountable for requirements and output. Provide relevant local context, request assumptions and edge cases, review every dependency and platform API, and run the same tests and security checks required for human-written code.
4. How would you establish team governance for AI-assisted development?
Answer
Answer: Define approved tools and repositories, prohibited data, human-review requirements, attribution rules, dependency policy, security scanning, and incident handling. Train developers on prompt hygiene and verification, record exceptions, and measure outcomes such as review time, escaped defects, and test quality rather than generated-line counts.
5. What data should never be sent to an AI coding assistant?
Answer
Answer: Do not send production secrets, signing keys, access tokens, private customer data, proprietary source outside approved policy, incident payloads containing personal data, or confidential contracts. Follow organizational retention, model-training, regional, and vendor controls. Redact examples and use approved enterprise configurations when sensitive repositories are involved.
Coding Problems
75 reviewed questions.
🟢 Beginner
1. How do you build a character-frequency map?
Code example:Answer
Answer: Iterate characters and increment a count keyed by each character.
const freq = (s) =>
[...s].reduce((m, c) => ((m[c] = (m[c] || 0) + 1), m), {});
2. How do you check whether a string is a palindrome?
Code example:Answer
Answer: Normalize the string and compare it with its reverse.
const isPalindrome = (s) => {
s = s.toLowerCase();
return s === [...s].reverse().join('');
};
3. How do you count vowels in a string?
Code example:Answer
Answer: Match vowels case-insensitively and use zero when there is no match.
const vowels = (s) => (s.match(/[aeiou]/gi) || []).length;
4. How do you find the largest number in an array?
Code example:Answer
Answer: Use Math.max with spread for moderate arrays or scan once for very large arrays.
const max = (a) => Math.max(...a);
5. How do you implement a usePrevious hook?
Code example:Answer
Answer: Store the current value in a ref after commit and return the ref's previous content during render.
const ref = useRef();
useEffect(() => {
ref.current = value;
}, [value]);
return ref.current;
6. How do you remove duplicates from an array?
Code example:Answer
Answer: Create a Set from the array and spread it back into an array. This preserves the first occurrence order.
const unique = (a) => [...new Set(a)];
7. How do you reverse a string?
Code example:Answer
Answer: Split into characters, reverse, and join; use Array.from or spread when Unicode code points matter.
const reverse = (s) => [...s].reverse().join('');
🟡 Intermediate
8. Array.prototype.map polyfill (Medium)?
Code example:Answer
Answer: Creates a new array and preserves sparse-array holes.
I include value, index and source arguments, support thisArg, and avoid invoking the callback for missing sparse indexes. A full spec polyfill has additional coercion details.
Array.prototype.myMap = function (callback, thisArg) {
if (this == null) throw new TypeError('Invalid receiver');
const source = Object(this);
const length = source.length >>> 0;
const result = new Array(length);
for (let i = 0; i < length; i++) {
if (i in source) {
result[i] = callback.call(thisArg, source[i], i, source);
}
}
return result;
};
9. Array.prototype.reduce polyfill (Medium)?
Code example:Answer
Answer: Matches core reduce behavior, including a missing initial value.
The important edge case is an empty array without an initial value. I also skip sparse holes and pass all four callback arguments.
Array.prototype.myReduce = function (callback, initialValue) {
const source = Object(this);
const length = source.length >>> 0;
let index = 0;
let accumulator;
if (arguments.length > 1) {
accumulator = initialValue;
} else {
while (index < length && !(index in source)) index++;
if (index >= length) throw new TypeError('Empty array');
accumulator = source[index++];
}
for (; index < length; index++) {
if (index in source) {
accumulator = callback(
accumulator,
source[index],
index,
source,
);
}
}
return accumulator;
};
10. Challenge A: useDebounce?
Code example:Answer
Answer: Keep a debounced value in state, start a timeout whenever the source value or delay changes, and clear the previous timeout in effect cleanup. The hook returns the last value whose delay completed. Tests should cover rapid changes, delay changes, unmount cleanup, and the initial value.
function useDebounce(value, delay = 300) {
const [debounced, setDebounced] = useState(value);
useEffect(() => {
const id = setTimeout(() => setDebounced(value), delay);
return () => clearTimeout(id);
}, [value, delay]);
return debounced;
}
11. Challenge B: Infinite scroll + pull to refresh?
Code example:Answer
Answer: Keep initial loading, pagination, and refresh states separate. Guard onEndReached while a page request is active, deduplicate items by stable identifier, and ignore or cancel stale responses. Refresh resets the cursor and replaces data only after the first-page request succeeds, while pagination appends the next confirmed page.
const loadMore = () => {
if (!loadingMore && hasNextPage) fetchNextPage();
};
12. Challenge C: API hook with loading/error?
Code example:Answer
Answer: I keep data, error, and loading state in a custom hook, run the supplied fetcher in an effect, abort on cleanup, ignore AbortError, and return the three states to the screen.
function useApi(fetcher) {
const [state, setState] = useState({ loading: true });
useEffect(() => {
const controller = new AbortController();
setState({ loading: true });
fetcher(controller.signal)
.then((data) => setState({ data, loading: false }))
.catch((error) => {
if (error.name !== 'AbortError')
setState({ error, loading: false });
});
return () => controller.abort();
}, [fetcher]);
return state;
}
13. Check a normalized palindrome (Easy)?
Code example:Answer
Answer: Expected result: true
Explanation: I clarify whether case, spaces, punctuation and Unicode must be ignored. The two-pointer comparison avoids creating a second reversed string.
function isPalindrome(value) {
const clean = value.toLowerCase().replace(/[^a-z0-9]/g, '');
let left = 0;
let right = clean.length - 1;
while (left < right) {
if (clean[left++] !== clean[right--]) return false;
}
return true;
}
isPalindrome('A man, a plan, a canal: Panama');
14. Check two strings are anagrams without sort (Easy/Medium)?
Code example:Answer
Answer: areAnagrams('listen', 'silent') returns true.
This frequency-map solution avoids O(n log n) sorting. I first confirm normalization rules and mention that this exact style has appeared in React Native coding rounds.
function areAnagrams(a, b) {
const left = a.toLowerCase().replace(/\s/g, '');
const right = b.toLowerCase().replace(/\s/g, '');
if (left.length !== right.length) return false;
const counts = new Map();
for (const char of left) {
counts.set(char, (counts.get(char) ?? 0) + 1);
}
for (const char of right) {
const next = (counts.get(char) ?? 0) - 1;
if (next < 0) return false;
counts.set(char, next);
}
return true;
}
15. Debounce search TextInput?
Code example:Answer
Answer: Update local text immediately and debounce only the search side effect. Clear the previous timer when text changes, cancel the active request when possible, and ignore stale responses so an older query cannot replace newer results.
function SearchInput() {
const [text, setText] = useState('');
const query = useDebounce(text, 300);
useEffect(() => {
if (query) searchApi(query);
}, [query]);
return <TextInput value={text} onChangeText={setText} />;
}
16. Deep clone nested arrays and plain objects (Medium)?
Code example:Answer
Answer: Expected result: Returns an independent nested copy and preserves circular references.
Explanation: I state the supported types. JSON stringify is not a true deep clone because it loses undefined, Date, BigInt and circular references. In modern production code, structuredClone may be appropriate.
function deepClone(value, seen = new WeakMap()) {
if (value === null || typeof value !== 'object') return value;
if (seen.has(value)) return seen.get(value);
if (value instanceof Date) return new Date(value);
const copy = Array.isArray(value) ? [] : {};
seen.set(value, copy);
for (const key of Reflect.ownKeys(value)) {
copy[key] = deepClone(value[key], seen);
}
return copy;
}
17. Find the first non-repeating character (Easy)?
Code example:Answer
Answer: c
The first pass counts; the second preserves original order. I return null explicitly when no unique character exists.
function firstUnique(value) {
const counts = new Map();
for (const char of value) {
counts.set(char, (counts.get(char) ?? 0) + 1);
}
for (const char of value) {
if (counts.get(char) === 1) return char;
}
return null;
}
firstUnique('aabbcddee');
18. Flatten a nested array without flat() (Medium)?
Code example:Answer
Answer: [1, 2, 3, 4, 5]
I explain the recursive base case. For extremely deep input I would use an explicit stack to avoid call-stack overflow.
function flatten(values) {
return values.reduce(
(result, value) =>
result.concat(Array.isArray(value) ? flatten(value) : value),
[],
);
}
flatten([1, [2, [3, 4]], 5]);
19. Flatten object?
Code example:Answer
Answer: Walk the object recursively and build each output key from its parent path and current property. Clarify how arrays, null, dates, separator characters, circular references, and empty containers should be handled.
function flatten(object, parent = '', result = {}) {
for (const [key, value] of Object.entries(object)) {
const path = parent ? `${parent}.${key}` : key;
if (value && typeof value === 'object' && !Array.isArray(value)) {
flatten(value, path, result);
} else {
result[path] = value;
}
}
return result;
}
20. Flatten only to a requested depth (Medium)?
Code example:Answer
Answer: [1, 2, 3, [4]]
I validate depth in production and preserve remaining nested arrays once depth reaches zero. This exact depth-based variation has appeared in a React Native interview report.
function flattenDepth(values, depth = 1) {
if (depth === 0) return values.slice();
return values.reduce((result, value) => {
return result.concat(
Array.isArray(value) ? flattenDepth(value, depth - 1) : value,
);
}, []);
}
flattenDepth([1, [2, [3, [4]]]], 2);
21. Function.prototype.bind polyfill (Medium/Hard)?
Code example:Answer
Answer: Returns a function with fixed context and optional partial arguments.
A good bind answer must discuss constructor usage: new should ignore the bound context. A fully spec-compliant implementation also handles metadata and edge cases.
Function.prototype.myBind = function (context, ...preset) {
const target = this;
function bound(...later) {
const receiver = this instanceof bound ? this : context;
return target.apply(receiver, [...preset, ...later]);
}
bound.prototype = Object.create(target.prototype);
return bound;
};
22. Group objects by a property (Easy/Medium)?
Code example:Answer
Answer: An object whose keys are professions and values are user arrays.
I define behavior for a missing property. In production I may prefer Map if keys are not strings or if prototype-safe storage matters.
function groupBy(items, key) {
return items.reduce((groups, item) => {
const group = item[key] ?? 'unknown';
(groups[group] ??= []).push(item);
return groups;
}, {});
}
groupBy(users, 'profession');
23. How do you add a timeout to a Promise?
Code example:Answer
Answer: Race the operation against a timer Promise that rejects. Clear the timer in a production helper and cancel the underlying operation when possible.
function withTimeout(p, ms) {
return Promise.race([
p,
new Promise((_, reject) =>
setTimeout(() => reject(new Error('Timeout')), ms),
),
]);
}
24. How do you check whether two strings are anagrams?
Code example:Answer
Answer: Normalize both strings and compare sorted characters, or compare frequency maps for linear time.
const anagram = (a, b) =>
[...a].sort().join('') === [...b].sort().join('');
25. How do you find a missing number from 1 through n?
Code example:Answer
Answer: Subtract the array sum from n(n+1)/2, assuming exactly one number is missing and values are valid.
const missing = (a, n) =>
(n * (n + 1)) / 2 - a.reduce((x, y) => x + y, 0);
26. How do you find pairs that sum to a target?
Code example:Answer
Answer: Scan once with a Set of prior values; when target minus the current value has been seen, record the pair.
function twoSum(a, t) {
const seen = new Set(),
out = [];
for (const n of a) {
if (seen.has(t - n)) out.push([t - n, n]);
seen.add(n);
}
return out;
}
27. How do you find the first non-repeating character?
Code example:Answer
Answer: Build a frequency map, then scan the original string and return the first character with count one.
function firstUnique(s) {
const m = freq(s);
for (const c of s) if (m[c] === 1) return c;
}
28. How do you find the longest substring without repeating characters?
Code example:Answer
Answer: Use a sliding window and map each character to its latest index. Move the left edge past a duplicate and track the maximum width.
function longest(s) {
const seen = new Map();
let l = 0,
b = 0;
for (let r = 0; r < s.length; r++) {
if ((seen.get(s[r]) ?? -1) >= l) l = seen.get(s[r]) + 1;
seen.set(s[r], r);
b = Math.max(b, r - l + 1);
}
return b;
}
29. How do you find the maximum subarray sum?
Code example:Answer
Answer: Kadane's algorithm tracks the best subarray ending at each index and the best seen overall in O(n) time.
function maxSubArray(a) {
let cur = a[0],
best = a[0];
for (let i = 1; i < a.length; i++) {
cur = Math.max(a[i], cur + a[i]);
best = Math.max(best, cur);
}
return best;
}
30. How do you find the second-largest distinct number?
Code example:Answer
Answer: Track the largest and second-largest distinct values in one pass, updating both when a new maximum appears.
function secondMax(a) {
let x = -Infinity,
y = -Infinity;
for (const n of a) {
if (n > x) {
y = x;
x = n;
} else if (n > y && n !== x) y = n;
}
return y;
}
31. How do you flatten a nested object?
Code example:Answer
Answer: Recursively visit nested plain objects, joining path segments, and assign leaf values to the output.
function flattenObj(o, p = '', out = {}) {
for (const [k, v] of Object.entries(o)) {
const key = p ? `${p}.${k}` : k;
if (v && typeof v === 'object' && !Array.isArray(v))
flattenObj(v, key, out);
else out[key] = v;
}
return out;
}
32. How do you flatten an array of any depth?
Code example:Answer
Answer: Use flat(Infinity) or recurse into array elements while accumulating scalar values.
const flat = nested.flat(Infinity);
function flatten(a) {
return a.reduce(
(r, v) => r.concat(Array.isArray(v) ? flatten(v) : v),
[],
);
}
33. How do you group an array of objects by a property?
Code example:Answer
Answer: Reduce into an object whose property values are arrays, creating each group on first use.
function groupBy(a, k) {
return a.reduce((m, o) => ((m[o[k]] ??= []).push(o), m), {});
}
34. How do you implement a reusable API hook?
Code example:Answer
Answer: Model data, loading, and error; start work in an effect; abort during cleanup; and ignore abort errors.
function useApi(fetcher) {
const [state, setState] = useState({ loading: true });
useEffect(() => {
const controller = new AbortController();
fetcher(controller.signal)
.then((data) => setState({ data, loading: false }))
.catch((error) => {
if (error.name !== 'AbortError')
setState({ error, loading: false });
});
return () => controller.abort();
}, [fetcher]);
return state;
}
35. How do you implement a theme provider?
Code example:Answer
Answer: Store mode in context, derive theme tokens, expose a toggle, and consume through a focused useTheme hook.
<ThemeContext.Provider value={{theme,mode,toggle}}>
36. How do you implement a useDebounce hook?
Code example:Answer
Answer: Keep a debounced value in state, start a timeout whenever the source value or delay changes, and clear the previous timeout in effect cleanup. The hook returns the last value whose delay completed. Tests should cover rapid changes, delay changes, unmount cleanup, and the initial value.
useEffect(() => {
const id = setTimeout(() => setDebounced(value), delay);
return () => clearTimeout(id);
}, [value, delay]);
37. How do you implement a useThrottle hook?
Code example:Answer
Answer: Track the last publication time, update immediately when the interval has elapsed, otherwise schedule the remaining delay and clean up that timer.
function useThrottle(value, delay) {
const [throttled, setThrottled] = useState(value);
const lastRun = useRef(0);
useEffect(() => {
const remaining = Math.max(
0,
delay - (Date.now() - lastRun.current),
);
const id = setTimeout(() => {
lastRun.current = Date.now();
setThrottled(value);
}, remaining);
return () => clearTimeout(id);
}, [value, delay]);
return throttled;
}
38. How do you implement an Error Boundary?
Code example:Answer
Answer: Use a class component with getDerivedStateFromError for fallback state and componentDidCatch for reporting.
class ErrorBoundary extends React.Component {
componentDidCatch(e, info) {
logError(e, info);
}
}
39. How do you implement debounce for search TextInput?
Code example:Answer
Answer: I keep the raw text in state for the input, then debounce that value with a custom useDebounce hook. A second effect depends on the debounced query and calls the API. That way we do not hit the server on every keystroke.
<TextInput value={text} onChangeText={setText} />;
40. How do you implement debounce?
Code example:Answer
Answer: Keep a timer in a closure, clear it on every call, and schedule the function after the quiet period.
function debounce(fn, wait) {
let t;
return function (...args) {
clearTimeout(t);
t = setTimeout(() => fn.apply(this, args), wait);
};
}
41. How do you implement deep equality?
Code example:Answer
Answer: Return true for identical values, reject incompatible non-objects, compare key counts, then recursively compare corresponding properties. Production code must handle cycles, symbols, prototypes, and special types.
function deepEqual(a, b) {
if (Object.is(a, b)) return true;
if (!a || !b || typeof a !== 'object' || typeof b !== 'object')
return false;
const ka = Object.keys(a),
kb = Object.keys(b);
return (
ka.length === kb.length &&
ka.every((k) => Object.hasOwn(b, k) && deepEqual(a[k], b[k]))
);
}
42. How do you implement infinite scroll with pull-to-refresh?
Code example:Answer
Answer: Track data, page, refresh, and load-more state; replace data on refresh, append on pagination, guard duplicate requests, and provide stable list keys.
<FlatList
data={items}
refreshing={refreshing}
onRefresh={refresh}
onEndReached={loadMore}
renderItem={renderItem}
/>;
43. How do you implement memoize?
Code example:Answer
Answer: Cache results by an argument key and return the cached value on repeated calls. Real implementations need an appropriate key strategy and eviction policy.
function memoize(fn) {
const c = new Map();
return (...a) => {
const k = JSON.stringify(a);
if (c.has(k)) return c.get(k);
const v = fn(...a);
c.set(k, v);
return v;
};
}
44. How do you implement once?
Code example:Answer
Answer: Keep called and result in a closure. Invoke the target only on the first call and return the stored result thereafter.
function once(fn) {
let called = false,
result;
return (...a) => {
if (!called) {
called = true;
result = fn(...a);
}
return result;
};
}
45. How do you implement throttle?
Code example:Answer
Answer: Track the last execution time and invoke only when the minimum interval has elapsed.
function throttle(fn, wait) {
let last = 0;
return function (...args) {
const now = Date.now();
if (now - last >= wait) {
last = now;
fn.apply(this, args);
}
};
}
46. How do you move all zeros to the end of an array?
Code example:Answer
Answer: Write nonzero values forward in one pass, then fill the remaining positions with zeros.
function moveZeroes(a) {
let i = 0;
for (const x of a) if (x !== 0) a[i++] = x;
while (i < a.length) a[i++] = 0;
return a;
}
47. How do you run an array of async functions sequentially?
Code example:Answer
Answer: Use for...of and await each function before starting the next, collecting results in order.
async function sequential(fns) {
const out = [];
for (const fn of fns) out.push(await fn());
return out;
}
Continue the series
Open the Complete React Native Interview Handbook 2026 series page on Dev.to for the next part.
Top comments (0)