Progressive Web Apps interview questions

16 questions from the Progressive Web Apps: Offline, Installable Web Apps course, each with the correct answer and an explanation. Try to answer before you open the answer.

Module 1: Getting started

1. What are the three pillars of a PWA?

  1. Server-side rendering, database, API
  2. Reliable (offline), Fast (instant load), Engaging (app-like)
  3. JavaScript, CSS, HTML
  4. Server-side rendering, SQL, REST
Show answer

Answer: Reliable (offline), Fast (instant load), Engaging (app-like)

PWAs are defined by reliability, speed, and engagement—they work offline, load instantly, and feel native.

Lesson: What are Progressive Web Apps?

Module 2: Core foundations

2. What does the 'display' field control in manifest.json?

  1. The screen brightness and contrast
  2. Which languages to support
  3. How the app appears when launched (fullscreen, standalone, minimal-ui, browser)
  4. The size of the service worker cache
Show answer

Answer: How the app appears when launched (fullscreen, standalone, minimal-ui, browser)

The 'display' field determines the UI of the installed app—standalone makes it look fully native.

Lesson: Web App Manifest file

Module 3: Core PWA features

3. When should you use network-first caching?

  1. For static assets like images and fonts
  2. Only for old browsers
  3. Only for video streaming
  4. For HTML pages and frequently updated content
Show answer

Answer: For HTML pages and frequently updated content

Network-first is ideal for content that changes often and requires freshness.

Lesson: Network-first pattern

4. What is the main benefit of stale-while-revalidate?

  1. Instant response to users while fresh data updates in background
  2. Always serving the newest content
  3. Reducing server load completely
  4. Guaranteeing offline writes
Show answer

Answer: Instant response to users while fresh data updates in background

This strategy balances speed (instant cache) with freshness (background fetch).

Lesson: Stale-while-revalidate

5. What does Workbox precaching do?

  1. Caches versioned build assets during install
  2. Encrypts the cache
  3. Disables the service worker
  4. Blocks network requests
Show answer

Answer: Caches versioned build assets during install

Precaching stores assets up front and updates them when their revision changes.

Lesson: Workbox: Caching Without Boilerplate

Module 5: Visual design

6. What does 'theme_color' in manifest.json control?

  1. The background color of the entire app
  2. The color of the browser's address bar and system chrome on Android
  3. The color scheme for light and dark modes
  4. The font size of the app
Show answer

Answer: The color of the browser's address bar and system chrome on Android

theme_color customizes the browser UI to match your app's branding on Android.

Lesson: App theming

Module 7: Testing & debugging

7. Where in Chrome DevTools can you inspect service workers?

  1. Sources tab → Scripts
  2. Console tab → Messages
  3. Application tab → Service Workers
  4. Elements tab → Styles
Show answer

Answer: Application tab → Service Workers

The Application tab provides service worker status, cache inspection, and lifecycle control.

Lesson: Debugging PWAs

Module 10: Interview prep

8. What is the main purpose of a service worker in a PWA?

  1. Render the user interface
  2. Store user authentication tokens
  3. Compile TypeScript to JavaScript
  4. Intercept network requests, enable offline functionality, and handle caching
Show answer

Answer: Intercept network requests, enable offline functionality, and handle caching

Service workers are background scripts that intercept requests, manage caches, and enable offline support.

Lesson: PWA interview questions

9. Which file tells browsers how to install and display a PWA?

  1. package.json
  2. robots.txt
  3. manifest.json
  4. sitemap.xml
Show answer

Answer: manifest.json

The web app manifest holds name, icons, start_url and display mode.

Lesson: PWA interview questions

10. Where must a service worker be served from (except localhost)?

  1. Any HTTP page
  2. A file URL
  3. A USB drive
  4. HTTPS
Show answer

Answer: HTTPS

Service workers require a secure context.

Lesson: PWA interview questions

11. Which strategy suits versioned static assets?

  1. Cache-first
  2. Network-only
  3. No caching
  4. Random
Show answer

Answer: Cache-first

Fingerprinted assets rarely change, so serving from cache is fastest.

Lesson: PWA interview questions

12. What does event.waitUntil() do in install?

  1. Skips the event
  2. Keeps the event alive until a promise settles
  3. Stops the worker
  4. Clears the cache
Show answer

Answer: Keeps the event alive until a promise settles

It ensures caching work finishes before the event ends.

Lesson: PWA interview questions

13. Which API stores large structured offline data?

  1. localStorage only
  2. Cookies
  3. IndexedDB
  4. window.name
Show answer

Answer: IndexedDB

IndexedDB handles structured, larger datasets asynchronously.

Lesson: PWA interview questions

14. When should you ask for push permission?

  1. Immediately on page load
  2. Never
  3. On every click
  4. After the user shows interest, in context
Show answer

Answer: After the user shows interest, in context

Contextual prompts get far higher acceptance.

Lesson: PWA interview questions

15. Which header setting helps users get a new service worker quickly?

  1. Cache-Control: no-cache on sw.js
  2. Cache-Control: max-age=31536000 on sw.js
  3. Expires: never
  4. Set-Cookie
Show answer

Answer: Cache-Control: no-cache on sw.js

A cached sw.js can delay updates.

Lesson: PWA interview questions

16. What is feature detection for PWAs?

  1. Detecting viruses
  2. Checking an API exists before using it
  3. Compressing images
  4. Installing plugins
Show answer

Answer: Checking an API exists before using it

e.g. 'serviceWorker' in navigator keeps older browsers working.

Lesson: PWA interview questions

← Back to the course