Skip to content
Tutorials Center
My learning

Topics

Lesson 37 of 37 ยท Projects and Practice

Ionic and Capacitor Interview Questions

Prepare for Ionic and Capacitor interviews: architecture, native plugins, navigation lifecycle, storage, offline sync, performance, testing and release questions with short answers.

Interviews for Ionic roles mix web skills, mobile knowledge and judgment about trade-offs. A good answer is short, correct and shows that you have shipped something: it names a concrete problem and how you solved it. This lesson groups common questions by topic. Try to answer aloud before reading the model answer, and then practice explaining one real project from the projects in this chapter.

Architecture and basics

What is Ionic, and how does it differ from Capacitor? Ionic Framework is a UI toolkit: web components, theming and navigation that look and behave like native mobile controls, working with Angular, React or Vue. Capacitor is the native runtime that wraps the built web app in a web view and exposes native APIs through plugins. You can use Ionic components without Capacitor (in a plain website) and Capacitor without Ionic.

How does a Capacitor app run on a phone? The web build is copied into the native Android or iOS project. The app loads it in the system web view (Android WebView, iOS WKWebView) from the local bundle. JavaScript calls plugins; the bridge turns these into native calls and returns promises.

How is Capacitor different from Cordova? Capacitor treats native projects as source you own and commit; Cordova generates them from config. Capacitor plugins use modern native APIs and promises, works with npm and Swift Package Manager or CocoaPods, and supports most Cordova plugins through a compatibility layer. Both use a web view.

When would you choose React Native or Flutter instead? When the app needs heavy native UI, complex gestures and animations at 60 fps everywhere, or a team already invested there. Ionic fits when you have web skills, want one code base for web, iOS, Android and PWA, and the app is content or form centered. Say it in terms of the requirement, not loyalty.

Components, navigation and lifecycle

Why does a list not refresh when you go back from a detail page? Ionic keeps pages in a navigation stack alive, so ngOnInit or useEffect([]) runs only once. Read shared state (store, signals) or use ionViewWillEnter and equivalents for refresh. See State Management in Ionic Apps.

What do ionViewWillEnter and ionViewDidLeave give you that framework hooks do not? They correspond to page transitions in the stack, not to creation and destruction, so you can start and stop work (timers, watchers) when a page becomes visible or hidden.

How do tabs keep their own history? Each tab has its own router outlet stack, so switching tabs preserves the navigation state of each one.

How do you theme an Ionic app? Override CSS custom properties (--ion-color-primary and the rest of the color set), use mode-specific styles for iOS and Material Design, and use dark mode through prefers-color-scheme or a class. Avoid overriding component internals when a CSS variable or shadow part exists.

Native features

How do you call a native feature safely across web and device? Check Capacitor.isNativePlatform() or plugin availability, provide a web fallback or a clear message, wrap calls in try and catch, and handle permission states. Test the fallback path.

Explain the permission flow for the camera. Check the current state, explain why you need it, request in context, and handle denied with an alternative (file picker) and a link to settings. On iOS the Info.plist usage strings are mandatory. See App Icons, Splash Screens and Permissions.

How would you build a custom Capacitor plugin? Scaffold with npm init @capacitor/plugin, define the TypeScript interface and web implementation, then implement the native Android (Kotlin or Java) and iOS (Swift) classes with methods marked as plugin methods that resolve or reject a call. Use plugins when no existing one fits and keep the interface small.

Push notifications: what happens between server and app? The app registers with FCM or APNs and receives a token, sends it to your server, and the server sends messages to the push service, which delivers them. Listeners handle foreground messages and taps. See Push Notifications, Local Notifications and Haptics.

Data, offline and performance

Where do you store data on a device? Settings in Preferences, records in SQLite, files in the filesystem, secrets in the keychain or keystore. Web storage can be evicted. See Storage, Preferences and SQLite.

How do you design an offline-first feature? Read and write locally, queue changes in an outbox with idempotency keys, sync when online, resolve conflicts with versions or merges, and show sync state. See Offline First and Sync.

A long list is janky. What do you do? Measure first. Then virtualize the list, paginate, use trackBy or keys, lazy load images, avoid heavy work in templates, and reduce change detection (OnPush or memoization).

Why might the first start be slow, and how do you improve it? Large bundle, eager loading of all routes, blocking requests before the first paint, many plugins initializing at once. Fix: lazy routes, defer analytics and nonessential plugins, cache the last data, keep the splash until the first useful screen.

Testing and release

How do you test code that uses Capacitor plugins? Inject the plugin or mock the module in unit tests, and use browser E2E tests with fakes for native parts. Device tests check what only a device can. See Unit Testing Ionic Components and Services.

What can a live update change, and what cannot? Only the web bundle. Native code, plugins and permissions need a new binary. See Publishing, PWA and Live Updates.

What are common store rejection reasons? Thin web wrapper with no app value, missing permission texts, crashes, no privacy policy or inaccurate data declarations, no account deletion option, wrong use of payments.

Quick self-test

Try answering these in one sentence each, using code if it helps. This stand-in turns a list of questions into a flashcard drill that tracks what you missed.

JS A flashcard drill

Press Run (or Ctrl + Enter) to see the console output here.

No output.

How to answer well

flowchart LR
  A["Restate the problem"] --> B["Give the short answer"]
  B --> C["Explain why"]
  C --> D["Mention a trade-off"]
  D --> E["Give an example from your work"]

Short answer first, reasons second, trade-off third. Interviewers listen for judgment.

  • Admit what you do not know and say how you would find out.
  • Prefer concrete numbers: "bundle went from 2.1 MB to 900 KB after lazy loading".
  • Know one project end to end: architecture, a bug you fixed, a store rejection you handled.

Check your understanding

Quick check ยท 3 questions

of 3 answered You scored / 3 ยท perfect!

  1. 1. Which statement about Ionic and Capacitor is correct?

    Ionic provides UI components; Capacitor wraps the web app natively and gives plugin access.
  2. 2. A candidate says 'live updates can add a new native plugin'. What is wrong?

    The native layer is compiled into the installed app.
  3. 3. What is a strong way to answer a performance question?

    Measurement and a concrete result show real experience.

Summary

  • Know the roles: Ionic for UI, Capacitor for native runtime and plugins.
  • Understand page lifecycle in the stack, permission flows and storage choices.
  • Describe offline sync, performance work, testing and releases with specifics.
  • Practice short, structured answers with a real example.

Next: back to the Ionic track