Web & Mobile Testing

Scenario-based questions using the CROSS framework: login pages, search, checkout, file uploads, real-time features, and more.

Overview #

Web and mobile testing represents the most tangible layer of quality assurance — where users directly interact with your product. Senior QA engineers must demonstrate not just knowledge of test techniques, but the ability to think systematically about complex user flows across platforms, devices, network conditions, and edge cases.

This chapter covers 30 scenario-based questions that interviewers commonly use to assess a candidate's ability to:

  • Decompose complex features into testable components
  • Identify high-risk areas that demand deeper coverage
  • Think cross-platform (iOS, Android, Web, PWA)
  • Consider non-functional requirements (security, performance, accessibility)
  • Design concrete test cases rather than listing abstract topics
  • Communicate a structured approach under time pressure

The CROSS Framework for Scenario Questions

Use this framework to structure your answers:

C - Clarify: Ask scope questions (platform? user type? integrations?)
R - Risk:    Identify what could go wrong (data loss, security, UX)
O - Outline: Design test categories (functional, edge, NFR)
S - Specify: Give concrete test cases with steps and expected results
S - Summartic: Summarize coverage and mention automation strategy

Platform Consideration Matrix

Dimension Web iOS Android
Input Keyboard/Mouse/Touch Touch/Face ID/Voice Touch/Fingerprint/Voice
Lifecycle Tab focus/blur App states (active/background/suspended) Activity lifecycle (onCreate/onPause/onDestroy)
Storage localStorage/cookies/IndexedDB Keychain/UserDefaults/CoreData SharedPreferences/Room/Keystore
Network Online/Offline (ServiceWorker) Reachability/NWPathMonitor ConnectivityManager
Permissions Browser prompts Info.plist + runtime Manifest + runtime
Updates Instant (deploy) App Store review (1-7 days) Play Store review (hours-days)

Q1How would you test a login page? #

Objective

Demonstrate ability to decompose a seemingly simple feature into comprehensive test coverage spanning functional correctness, security hardening, accessibility, and cross-platform behavior.

Interview Answer

"A login page seems simple but is one of the highest-risk surfaces in any application. I'd structure my approach using risk-based thinking.

First, I'd clarify scope: What authentication methods are supported — email/password, SSO, OAuth, biometric? Is there MFA? What platforms — web, iOS, Android? Are there rate-limiting or lockout policies?

Risk identification: The login page is the front door for attackers. Top risks include credential stuffing, session hijacking, information disclosure through error messages, and broken accessibility preventing users from authenticating.

Test design — I'd organize into categories:

Functional (Happy Path):

  • Valid credentials → successful login → redirect to dashboard
  • 'Remember me' checkbox persists session across browser restarts
  • SSO redirect flow completes and maps to correct internal user

Functional (Negative):

  • Invalid password → generic error ('Invalid credentials' — not 'Wrong password')
  • Non-existent email → same generic error (prevents user enumeration)
  • Empty fields → client-side validation fires before network request
  • SQL injection in email field (' OR 1=1 --) → sanitized, no bypass
  • XSS payload in email field (<script>alert(1)</script>) → escaped in DOM

Security:

  • Credentials transmitted over HTTPS (inspect network tab for TLS)
  • Password field masked by default, with show/hide toggle
  • Session token is HttpOnly, Secure, SameSite=Strict
  • After 5 failed attempts → account lockout or CAPTCHA challenge
  • Concurrent sessions: login on Device B → behavior on Device A (configurable?)
  • CSRF token present in login form, validated server-side
  • Response timing is consistent for valid vs. invalid emails (prevents timing attacks)

Performance:

  • Login API responds < 500ms at P95 under normal load
  • Load test: 1000 concurrent login attempts → no degraded response
  • Third-party SSO provider timeout → graceful error message

Accessibility:

  • Form labels associated with inputs (for/id pairing)
  • Error messages announced by screen reader (aria-live region)
  • Tab order: email → password → remember me → login button
  • Sufficient color contrast on error states (4.5:1 ratio)
  • Login possible using keyboard only (Enter key submits form)

Platform-specific:

  • iOS: Keychain autofill prompt appears for saved credentials
  • Android: Autofill framework integration, biometric prompt if configured
  • Web: Password manager detection, autofill compatibility

I'd automate the functional and security regression tests in CI, use OWASP ZAP for periodic security scans, and run accessibility checks with axe-core in the pipeline."

Framework/Diagram

Login Page Test Taxonomy
├── Functional
│   ├── Happy paths (valid login, SSO, biometric)
│   ├── Negative paths (invalid creds, empty fields, locked account)
│   └── Edge cases (unicode emails, max-length passwords, special chars)
├── Security
│   ├── Injection (SQL, XSS, LDAP)
│   ├── Session management (token security, concurrent sessions)
│   ├── Rate limiting (lockout, CAPTCHA)
│   └── Information disclosure (error messages, timing)
├── Performance
│   ├── Response time under load
│   ├── Third-party dependency failures
│   └── Database query optimization
├── Accessibility
│   ├── Screen reader compatibility
│   ├── Keyboard navigation
│   └── Visual contrast and focus indicators
└── Cross-platform
    ├── Autofill/credential manager integration
    ├── Biometric fallback behavior
    └── Deep link to login from external sources

Worked Example

Scenario: Testing login for a B2B SaaS application (e.g., Slack-like tool)

Test Case ID Category Steps Expected Result
LOGIN-001 Functional Enter valid email + password, click Login Redirect to workspace, session cookie set
LOGIN-002 Security Enter admin' OR '1'='1 in email field Input sanitized, standard error shown
LOGIN-003 Security Submit login 6 times with wrong password Account locked, email notification sent
LOGIN-004 Accessibility Navigate form using Tab key only Focus moves: email → password → checkbox → button
LOGIN-005 Performance Simulate 500 concurrent logins via k6 P95 < 500ms, no 5xx errors
LOGIN-006 Cross-platform Open login on iOS Safari with saved keychain Autofill prompt appears, credentials populate

Common Mistakes to Avoid

  1. Only testing happy path — Interviewers want to see negative and security thinking
  2. Saying "I'd test invalid credentials" without specifying what the expected behavior should be
  3. Ignoring information disclosure — Different error messages for "user not found" vs "wrong password" is a security vulnerability
  4. Forgetting accessibility — Login is a legal compliance requirement (ADA/WCAG)
  5. Not mentioning automation — Senior engineers should connect testing to CI/CD

Follow-up Questions

  • "How would you test Remember Me functionality across browser updates?"
  • "What's your approach to testing SSO with multiple identity providers?"
  • "How would you verify the login page is not vulnerable to credential stuffing?"
  • "How do you test login behavior when the auth service is down?"

Q2How would you test a chat application? #

Objective

Assess the candidate's ability to handle real-time systems with complex state management, concurrency, and multi-device synchronization challenges.

Interview Answer

"A chat application is one of the most complex features to test because it involves real-time communication, state synchronization, and numerous edge cases around connectivity. Let me walk through my approach.

Clarifying questions: Is this 1:1 chat, group chat, or both? What message types are supported — text, images, files, voice notes? Is there end-to-end encryption? What platforms — web, iOS, Android? Is there a message history limit?

Risk analysis: The top risks are message loss, message ordering, duplicate messages, sync failures across devices, and data leakage in group chats.

Test design:

Message Sending & Receiving:

  • Send text message → appears in recipient's chat within 2 seconds
  • Send message with emoji/unicode → renders correctly on all platforms
  • Send 10,000-character message → handled gracefully (truncated or scrollable)
  • Send message to offline user → delivered when they come online (with delivery indicator update)

Real-time Synchronization:

  • User A sends message while User B is typing → both messages appear in correct order
  • Open same conversation on phone and laptop → message appears on both simultaneously
  • Send message on phone, switch to web → message visible in web conversation

Group Chat Specifics:

  • Send message to 500-member group → all members receive within SLA
  • User removed from group → cannot see new messages, history behavior per spec
  • Admin deletes message → removed from all participants' views
  • @mention in group → notification only for mentioned user

Media Messages:

  • Send 25MB image → compression applied, preview generated, full-res downloadable
  • Send unsupported file type → clear error message, file not sent
  • Send image on poor connection → progress indicator, retry on failure
  • Video message → thumbnail generated, plays inline

Connectivity & Offline:

  • Send message while offline → queued with pending indicator
  • Reconnect after offline → queued messages sent in order
  • Switch from WiFi to cellular mid-conversation → no message loss
  • Server goes down mid-send → message retried with exponential backoff

Performance:

  • Scroll through 10,000 message history → smooth scrolling (virtualized list)
  • 100 messages received in burst → UI remains responsive
  • Chat with 1000 participants → member list loads progressively
  • Memory usage stays stable after 1 hour of active chatting

Security:

  • Messages encrypted in transit (TLS) and at rest
  • Cannot access other users' conversations via API manipulation
  • Deleted messages purged from server (not just hidden)
  • File attachments scanned for malware before delivery
  • Rate limiting on message sends (prevent spam)

Accessibility:

  • Screen reader announces new messages with sender name
  • Keyboard shortcut to send (Enter) and new line (Shift+Enter)
  • Message timestamps accessible to assistive technology
  • High contrast mode maintains readability"

Framework/Diagram

Chat Application Test Architecture
├── Message Lifecycle
│   ├── Compose → Send → Transit → Deliver → Read
│   ├── States: pending → sent → delivered → read → deleted
│   └── Each transition is a test boundary
├── Synchronization
│   ├── Multi-device consistency
│   ├── Conflict resolution (simultaneous edits)
│   └── Eventual consistency verification
├── Network Resilience
│   ├── Offline queueing
│   ├── Reconnection handling
│   ├── Network transition (WiFi ↔ cellular)
│   └── Server failover
├── Scale
│   ├── Large groups (100+ members)
│   ├── Long conversations (10K+ messages)
│   └── Burst traffic (viral messages)
└── Platform-specific
    ├── Push notification delivery
    ├── Background sync behavior
    └── Platform input methods (dictation, GIFs, stickers)

Worked Example

Scenario: Testing Slack-like team messaging

Test Case ID Category Steps Expected Result
CHAT-001 Functional User A sends "Hello" to User B Message appears in B's chat < 2s, delivery tick shown to A
CHAT-002 Sync Send message on mobile, check desktop Message visible on both with same timestamp
CHAT-003 Offline Disable network, send 3 messages, re-enable All 3 delivered in order, pending indicators clear
CHAT-004 Performance Load conversation with 50K messages, scroll up Virtual scrolling, no frame drops, < 200ms per page
CHAT-005 Security Modify API request to access another user's DM 403 Forbidden, event logged
CHAT-006 Group Send message to 500-person channel All online members receive within 5s

Common Mistakes to Avoid

  1. Treating chat as simple CRUD — It's a distributed system with real-time requirements
  2. Ignoring message ordering — Network delays can cause out-of-order delivery
  3. Not testing multi-device scenarios — This is where most sync bugs hide
  4. Forgetting about message states — Pending, sent, delivered, read are all testable
  5. Skipping performance at scale — Chat degrades significantly with history size

Follow-up Questions

  • "How would you test message search across 1 million messages?"
  • "How would you verify end-to-end encryption is actually working?"
  • "What's your approach to testing typing indicators at scale?"
  • "How would you test message reactions in a group chat?"

Q3How would you test offline message sending? #

Objective

Evaluate the candidate's understanding of offline-first architecture, queue management, conflict resolution, and resilience testing techniques.

Interview Answer

"Offline message sending is a critical reliability feature. Users expect their messages to be delivered once connectivity resumes, without loss or duplication. Here's how I'd approach testing it.

Clarifying questions: What's the offline queue size limit? Is there a TTL on queued messages? How does the app indicate offline status? Does it support all message types offline (text, media, reactions)?

Risk analysis: Key risks are message loss, duplicate sends on reconnection, incorrect ordering, queue overflow, and poor UX (user doesn't realize they're offline).

Test design:

Basic Offline Queueing:

  • Enable airplane mode → send message → verify pending indicator shown
  • Send 5 messages offline → disable airplane mode → all 5 delivered in order
  • Verify messages appear in conversation immediately (optimistic UI) with pending state
  • Kill app while offline with queued messages → relaunch → messages still in queue

Queue Management:

  • Send 100 messages offline → verify queue doesn't corrupt or lose messages
  • Queue near capacity → send another → graceful handling (error or oldest evicted)
  • Mix message types offline: text, image, reply, reaction → all types queue correctly
  • Cancel a queued message before reconnection → message removed from queue

Reconnection Behavior:

  • Disable WiFi → send messages → enable WiFi → messages flush in FIFO order
  • Flapping connection (on/off/on rapidly) → no duplicates, no message loss
  • Reconnect to different network (WiFi → cellular) → queue flushes normally
  • Server returns 500 on first retry → exponential backoff, eventual delivery

Ordering & Timestamps:

  • Send 3 messages offline, recipient sends 2 messages during that time → correct interleaving on reconnection based on timestamps
  • Offline message timestamps reflect send-time (when user tapped send), not delivery-time
  • Verify server-side ordering uses client-provided timestamps for offline messages

Multi-device Conflict:

  • Send message offline on phone, same message sent from laptop (online) → no duplicate in conversation
  • Offline message from Device A, online message from Device B to same thread → both appear, correct order

Edge Cases:

  • Send message offline → manually change device time → reconnect → timestamp handling
  • Send offline → app update occurs before reconnection → messages still delivered
  • Low storage on device → offline queue persistence behavior
  • Send message offline to a user who blocked you during offline period → appropriate error on reconnection

Platform-specific:

  • iOS: Background app refresh + offline queue (app suspended vs. terminated)
  • Android: WorkManager/JobScheduler for queue flush on connectivity change
  • Web: Service Worker + IndexedDB queue persistence

Verification tooling:

  • Use Charles Proxy / mitmproxy to simulate network conditions
  • Use Xcode Network Link Conditioner for iOS
  • Android Emulator network throttling settings
  • Monitor local database/IndexedDB for queue state inspection"

Framework/Diagram

Offline Message Flow
┌─────────────┐     ┌──────────────┐     ┌─────────────┐
│   User      │     │  Local Queue │     │   Server    │
│   taps Send │────▶│  (SQLite/    │     │             │
│             │     │   IndexedDB) │     │             │
└─────────────┘     └──────┬───────┘     └─────────────┘
                           │                      ▲
                    [OFFLINE - Pending]            │
                           │                      │
                    [CONNECTIVITY RESTORED]        │
                           │                      │
                           ▼                      │
                    ┌──────────────┐              │
                    │  Retry with  │──────────────┘
                    │  Exp Backoff │
                    └──────────────┘
                           │
                    [Success → Remove from queue]
                    [Failure → Retry or Dead-letter]

Queue States: PENDING → SENDING → SENT → CONFIRMED (ACK from server)

Worked Example

Scenario: WhatsApp-like messenger with offline support

Test Case ID Steps Expected Result Verification
OFFLINE-001 Airplane mode ON → type & send "Test 1" Message shows with clock icon (pending) Inspect local DB for queued entry
OFFLINE-002 Send 5 msgs offline → airplane OFF All 5 delivered in order within 10s Check server logs for correct sequence
OFFLINE-003 Send msg offline → kill app → relaunch → go online Message delivered after relaunch Queue persisted across app restart
OFFLINE-004 Send offline → flap network 5 times rapidly Exactly 1 copy of message delivered Server dedup check, no duplicates in chat
OFFLINE-005 Send image offline (15MB) → reconnect on 3G Upload retries with progress, eventually succeeds No timeout crash, resumable upload
OFFLINE-006 Send msg offline → recipient blocks sender → reconnect Appropriate error/silent failure, no crash Error handling for 403 on flush

Common Mistakes to Avoid

  1. Only testing simple on/off scenarios — Real offline is about flapping connections and partial connectivity
  2. Forgetting persistence across app kill — Queue must survive process termination
  3. Ignoring timestamp handling — Offline messages need careful timestamp logic
  4. Not testing queue limits — Unbounded queues cause memory/storage issues
  5. Missing deduplication verification — Reconnection retries commonly cause duplicates

Follow-up Questions

  • "How would you test offline behavior when the queue contains mixed media types?"
  • "What happens if the server schema changes while messages are queued offline?"
  • "How do you handle offline messages to a deleted conversation?"
  • "How would you automate offline testing in CI/CD?"

Q4How would you validate ordering across reconnects? #

Objective

Test understanding of distributed systems concepts — causal ordering, vector clocks, sequence numbers — and how to verify correctness in chat/messaging systems.

Interview Answer

"Message ordering across reconnects is a subtle but critical problem. When a client disconnects and reconnects, it may receive a burst of messages that arrived during the offline period. The challenge is ensuring these messages appear in the correct order relative to each other and to any messages the user sent while offline.

Clarifying questions: What ordering guarantee does the system provide — causal, total, or best-effort? Are sequence numbers client-generated or server-assigned? Is ordering per-conversation or global? How are conflicts resolved?

Risk analysis: Incorrect ordering leads to confusing conversations (answers before questions), broken thread contexts, and potential data integrity issues in transactional systems.

Test design:

Basic Ordering Verification:

  • User A sends messages M1, M2, M3 sequentially → User B sees them in same order
  • User B is offline → M1, M2, M3 arrive → User B reconnects → sees M1, M2, M3 in order
  • Verify ordering uses server-assigned sequence numbers, not client timestamps (clocks drift)

Cross-user Ordering:

  • User A sends M1, User B sends M2, User A sends M3 (all while User C is offline) → User C reconnects and sees M1, M2, M3 in causal order
  • Two users send simultaneously in a group → server determines order, all clients see same order
  • Verify that the ordering is consistent across all group participants (total order)

Reconnection Burst Scenarios:

  • Client offline for 1 hour, 500 messages accumulated → on reconnect, all arrive in correct sequence
  • Client reconnects and receives batch → verify no UI flicker or reordering during render
  • Pagination of missed messages: first batch arrives, user scrolls, second batch arrives → no reorder

Network Partition Scenarios:

  • Client has intermittent connectivity (connected for 2s, disconnected for 5s, repeat) → messages from multiple gaps merge correctly
  • Client sends M1 offline, reconnects briefly (M1 sent), disconnects, sends M2 offline, reconnects → M1, M2 in order
  • Split-brain: two clients believe they're sending M3 → server resolves with tie-breaking rule

Clock Skew Testing:

  • Set device clock 5 minutes ahead → send message → verify server uses its own timestamp for ordering
  • Set device clock 1 hour behind → send message → message doesn't appear at bottom of old history
  • Two devices with 30-second clock difference → messages still ordered correctly

Sequence Number Validation:

  • Inspect sequence numbers in API response → strictly monotonically increasing per conversation
  • Gap in sequence numbers after reconnect → client requests missing messages
  • Duplicate sequence number received → client deduplicates (idempotent processing)

Stress & Concurrency:

  • 10 users sending messages simultaneously to one group → total order consistent for all
  • Reconnect during high-traffic burst (100 msg/sec in group) → no ordering violations
  • Database replication lag → verify read-your-own-writes consistency"

Framework/Diagram

Ordering Mechanisms
┌─────────────────────────────────────────────────┐
│  Server-side Total Order                         │
│  ┌───┐ ┌───┐ ┌───┐ ┌───┐ ┌───┐ ┌───┐         │
│  │ 1 │ │ 2 │ │ 3 │ │ 4 │ │ 5 │ │ 6 │ seq_id  │
│  └───┘ └───┘ └───┘ └───┘ └───┘ └───┘         │
│   A      A     B     A     C     B    sender   │
└─────────────────────────────────────────────────┘

Reconnection Sync:
  Client last_seen_seq = 3
  Server has seq 4, 5, 6
  → Sends delta [4, 5, 6] in order
  → Client appends to local store

Validation Query:
  SELECT * FROM messages 
  WHERE conversation_id = X 
  ORDER BY server_seq ASC
  → Verify no gaps, no duplicates, monotonic

Worked Example

Scenario: Testing a Telegram-like app's ordering guarantees

Test Case ID Setup Action Verification
ORD-001 A, B, C in group chat A sends M1→M2→M3 while C offline C reconnects → sees M1, M2, M3 in order
ORD-002 A online, B online A sends "Question?", B sends "Answer!" 100ms later All participants see Question before Answer
ORD-003 Client offline 2 hours 2000 messages accumulated in group Sync completes, messages in seq order, paginated
ORD-004 Device clock +10 min Send message from skewed device Message appears at correct position (server time)
ORD-005 Flapping connection Send M1 (offline) → brief online → Send M2 (offline) Both arrive, M1 before M2
ORD-006 20 users, same group All send within 1-second window All 20 clients see identical ordering

Common Mistakes to Avoid

  1. Relying on client timestamps — Device clocks drift; server-assigned ordering is essential
  2. Testing only with two users — Group scenarios expose ordering bugs that 1:1 doesn't
  3. Ignoring pagination boundaries — Ordering can break at page boundaries during sync
  4. Not verifying consistency across observers — All participants must see the same order
  5. Forgetting about database replication lag — Reads from replicas may show stale order

Follow-up Questions

  • "How would you test ordering in an eventually consistent system?"
  • "What's the difference between causal ordering and total ordering, and which would you test for?"
  • "How would you detect ordering violations in production?"
  • "How would you handle ordering when messages span multiple servers/shards?"

Q5How would you test duplicate-message prevention? #

Objective

Evaluate understanding of idempotency, client-side deduplication keys, server-side uniqueness constraints, and testing strategies for exactly-once delivery semantics.

Interview Answer

"Duplicate messages are one of the most common and annoying bugs in messaging systems. They typically occur during reconnection retries, double-tap on send, or server-side processing failures. Here's my testing approach.

Clarifying questions: Does the system use client-generated idempotency keys? Is deduplication handled client-side, server-side, or both? What's the dedup window (how long are IDs tracked)? Does it apply to all message types?

Risk analysis: Duplicates erode user trust, corrupt read counts, trigger duplicate notifications, and in transactional contexts (payments, orders) can cause real financial harm.

Test design:

Client-side Deduplication:

  • Rapidly tap send button 5 times → only 1 message appears in conversation
  • Send button disables after first tap (UI-level prevention)
  • Verify client generates unique idempotency key (UUID) per message intent
  • Resend same message text → different idempotency key → treated as new message (user intent)

Network Retry Deduplication:

  • Send message → simulate network timeout (server received but ACK lost) → client retries → only 1 message on server
  • Send message → server returns 500 → client retries with same idempotency key → server deduplicates
  • Send message → connection drops mid-request → reconnect → retry → no duplicate
  • Verify retry uses same idempotency key as original attempt

Reconnection Scenarios:

  • Client sends M1 offline → reconnects → flush sends M1 → ACK lost → second flush → still only 1 M1
  • WebSocket reconnect triggers re-send of unacknowledged messages → server deduplicates
  • Multiple reconnection cycles in quick succession → no duplicates

Server-side Verification:

  • Send message with duplicate idempotency key via API directly → server returns 200 (idempotent) but doesn't create second record
  • Query database directly: SELECT COUNT(*) FROM messages WHERE idempotency_key = X → always 1
  • Race condition: two requests with same key arrive simultaneously → exactly one stored (database constraint)

Edge Cases:

  • Idempotency key collision (UUID collision — theoretical) → verify handling
  • Dedup window expiry: send message, wait beyond dedup window, retry with same key → behavior defined (new message or still deduped?)
  • Client cache cleared → retry generates new idempotency key → potential duplicate (verify server-side protection)
  • Message edit vs. new message: editing a message should not be treated as duplicate of original

Multi-device Scenarios:

  • Same user sends same text from two devices simultaneously → two separate messages (different idempotency keys, different intent)
  • Offline queue synced from Device A, same queue somehow synced from Device B → server deduplicates by key

Automation Approach:

  • Intercept network at proxy level to simulate ACK loss
  • Inject duplicate API calls in integration tests
  • Monitor production for duplicate messages (alerting on same idempotency_key with multiple message_ids)"

Framework/Diagram

Deduplication Architecture
┌──────────┐        ┌──────────────┐        ┌──────────┐
│  Client  │───────▶│   Server     │───────▶│ Database │
│          │        │              │        │          │
│ Generate │        │ Check dedup  │        │ UNIQUE   │
│ idem_key │        │ cache/store  │        │ constraint│
│ per send │        │              │        │ on key   │
│ intent   │        │ If exists:   │        │          │
│          │        │   return ACK │        │          │
│ Retry    │        │ If new:      │        │          │
│ same key │        │   insert msg │        │          │
└──────────┘        └──────────────┘        └──────────┘

Dedup Flow:
  Request 1 (key=abc123) → Insert → ACK → Client marks sent ✓
  Request 2 (key=abc123) → Cache hit → ACK (no insert) → Client marks sent ✓
  
  Result: 1 message in DB, client confident it was sent

Worked Example

Scenario: Testing deduplication in a payment confirmation messaging system

Test Case ID Trigger Condition Expected Behavior Verification Method
DEDUP-001 Double-tap send button Send button disabled after first tap, 1 message sent UI state + API call count
DEDUP-002 Network timeout on first send, auto-retry Same idempotency key reused, 1 message in DB DB query + API logs
DEDUP-003 Kill app mid-send, relaunch, queue flush Offline queue uses original idempotency key, no dup DB count check
DEDUP-004 Inject duplicate API call via Postman Server returns 200, no second message created DB assertion
DEDUP-005 Race condition: 2 requests arrive within 1ms Database UNIQUE constraint prevents both inserting DB count = 1
DEDUP-006 Same text sent intentionally by user twice Two different idempotency keys → 2 messages (correct) Both visible, different IDs

Common Mistakes to Avoid

  1. Confusing identical content with duplicate messages — Same text ≠ duplicate; the idempotency key determines identity
  2. Testing only at UI level — Double-tap prevention is necessary but not sufficient; network retries need server-side dedup
  3. Ignoring the dedup window — Keys can't be stored forever; test behavior after window expires
  4. Not testing the race condition — Two requests arriving simultaneously is the hardest case
  5. Forgetting multi-device scenarios — Same user, multiple devices is a common source of false duplicates

Follow-up Questions

  • "How would you test deduplication in a distributed system with multiple server nodes?"
  • "What's the tradeoff between dedup window size and storage cost?"
  • "How would you detect duplicate messages in production monitoring?"
  • "How does exactly-once delivery differ from at-least-once with deduplication?"

Q6How would you test read receipts across devices? #

Objective

Assess ability to test multi-device state synchronization, eventual consistency, and privacy-sensitive features with complex interaction patterns.

Interview Answer

"Read receipts are a multi-device synchronization challenge combined with privacy considerations. The feature seems simple — show when a message was read — but involves complex state propagation across devices and users.

Clarifying questions: Does the system support delivery receipts AND read receipts? Can users disable read receipts (privacy toggle)? What counts as 'read' — message visible in viewport, or conversation opened? How does it work in group chats? Is there a 'read by' list?

Risk analysis: Key risks include incorrect read state (showing read when it wasn't, or vice versa), privacy violations (showing read status when user disabled it), performance degradation in large groups, and sync lag confusing users.

Test design:

Basic Read Receipt Flow:

  • User A sends message to User B → shows single tick (sent)
  • Message delivered to B's device → double tick (delivered)
  • User B opens conversation and message is in viewport → blue tick (read) + timestamp
  • Verify read receipt timestamp matches when message actually entered viewport, not when app opened

Multi-device Read State:

  • User B has phone and laptop → reads message on phone → laptop also shows conversation as read
  • Read on laptop → phone's unread badge clears
  • Partial read: B opens conversation on phone, scrolls to message 5 of 10 → receipts sent for 1-5 only
  • B reads on offline device → reconnects → read receipts propagate to sender

Group Chat Read Receipts:

  • Send message to 50-person group → read receipt shows "Read by 3" → tap to see list
  • All 50 members read → shows "Read by all"
  • User leaves group after reading → still counts in read receipt? (product decision to test)
  • Performance: 1000-member group, generate read receipts → UI responsive, no flooding

Privacy Controls:

  • User B disables read receipts → User A never sees blue tick for messages to B
  • Verify: when B disables read receipts, B also cannot see others' read receipts (bidirectional privacy)
  • Disable read receipts → previously sent read receipts remain (no retroactive removal)
  • Group chat: B disables read receipts → B not shown in "Read by" list
  • Admin/API level: verify read events still not tracked (or tracked but not exposed) per privacy setting

Timing & Accuracy:

  • Read receipt timestamp accuracy: read at 10:00:00 → receipt shows 10:00 (not 10:01)
  • Network delay: B reads at 10:00, receipt reaches A at 10:03 (slow connection) → shows 10:00 (read time, not delivery time)
  • Message read during poor connectivity → receipt queued and delivered when connection stable

Edge Cases:

  • Read message → immediately delete the message → read receipt status retained? Hidden?
  • Blocked user: A blocks B → B sends message → message not delivered → no read receipt ever
  • Ephemeral/disappearing messages: read receipt triggers disappear timer
  • Notification preview: if message content shown in notification banner, is that "read"? (Usually no)
  • Screen reader reads message content aloud → does that trigger read receipt?

Platform-specific:

  • iOS: Notification extension displays message → not a read receipt (only in-app viewport counts)
  • Android: Notification shows message preview → not a read receipt
  • Web: Tab in background, conversation visible → focus detection determines read
  • Web: Multiple tabs open → read in one tab → other tabs update"

Framework/Diagram

Read Receipt State Machine
┌────────┐    ┌───────────┐    ┌────────────┐    ┌──────┐
│  SENT  │───▶│ DELIVERED │───▶│    READ    │───▶│ READ │
│(1 tick)│    │ (2 ticks) │    │ (blue tick)│    │ + ts │
└────────┘    └───────────┘    └────────────┘    └──────┘
    │              │                  │
    └── Server ACK └── Device receipt └── Viewport trigger

Multi-device Sync:
  ┌─────────────┐         ┌─────────────┐
  │  Device 1   │         │  Device 2   │
  │  (reads)    │────────▶│  (syncs)    │
  │  Send read  │         │  Mark read  │
  │  receipt    │         │  Clear badge│
  └──────┬──────┘         └─────────────┘
         │
         ▼
  ┌─────────────┐
  │   Server    │──── Propagate to sender's all devices
  └─────────────┘

Worked Example

Scenario: Testing iMessage-like read receipts

Test Case ID Setup Action Expected Result
READ-001 A sends msg to B B opens chat, msg in viewport A sees blue tick + "Read 10:00 AM"
READ-002 B has phone + iPad B reads on phone iPad shows conversation as read, badge clears
READ-003 B disables read receipts B reads A's message A sees delivered (2 ticks) only, never blue
READ-004 100-person group 30 people read message Sender sees "Read by 30", tappable list
READ-005 B offline, reads msg B reconnects after 5 min A receives read receipt with original read time
READ-006 A sends 20 messages B scrolls to msg 10 Read receipts for msgs 1-10, not 11-20

Common Mistakes to Avoid

  1. Equating "delivered" with "read" — These are distinct states with different triggers
  2. Forgetting viewport detection — Opening a chat doesn't mean all messages are read
  3. Ignoring privacy bidirectionality — Disabling read receipts typically affects both directions
  4. Not testing large group performance — 1000 read receipts flooding the network is a real issue
  5. Missing the notification preview case — Seeing content in a notification ≠ reading the message

Follow-up Questions

  • "How would you test read receipts in a channel with 10,000 members?"
  • "What's the privacy implication of storing read timestamps on the server?"
  • "How would you test read receipt behavior when a message is forwarded?"
  • "How do you handle read receipts for messages that auto-delete after reading?"

Q7How would you test a push notification? #

Objective

Assess knowledge of platform-specific notification systems (APNs, FCM), delivery reliability, user experience considerations, and edge cases in notification behavior.

Interview Answer

"Push notifications span the full stack — from server-side triggering through platform delivery services to client-side rendering. Each layer introduces potential failure points.

Clarifying questions: What notification types — transactional, marketing, real-time alerts? Which platforms — iOS, Android, Web Push? Are notifications actionable (quick reply, buttons)? What grouping/threading behavior? Are there quiet hours or DND?

Risk analysis: Notifications can be missed (silent failure), delayed, duplicated, shown with incorrect content, or violate user preferences. They also have platform-specific restrictions (iOS requires explicit permission, Android channels).

Test design:

Delivery Verification:

  • Trigger event → notification arrives on device within SLA (typically < 5 seconds)
  • Notification content matches trigger (correct sender name, message preview, icon)
  • Deep link in notification opens correct screen in app
  • Notification arrives when app is: foreground, background, killed/terminated
  • Verify notification ID for deduplication — same event doesn't trigger twice

Platform-specific Behavior:

  • iOS: Permission prompt appears on first trigger, notification grouped by thread
  • iOS: Notification Service Extension modifies content (decryption, media attachment)
  • iOS: Critical alerts bypass Do Not Disturb (if entitled)
  • Android: Notification channel creation on app install, respects channel importance
  • Android: Heads-up notification for high-priority, silent for low-priority
  • Android: Custom notification layouts render correctly across OEM skins (Samsung, Xiaomi)
  • Web: Service Worker handles push event, shows notification even when tab closed

User Preferences:

  • User disables notifications for a channel → no notifications for that type
  • User sets quiet hours (10 PM - 7 AM) → notifications queued, delivered at 7 AM
  • User mutes conversation → no notification for messages in that thread
  • System-level notification disabled (OS settings) → app detects and shows in-app prompt

Content & Formatting:

  • Long message preview truncated gracefully (iOS: ~4 lines expanded, 2 collapsed)
  • Special characters, emoji, RTL text render correctly in notification
  • Rich notifications: image attachment loads and displays
  • Notification actions (Reply, Mark Read, Dismiss) function correctly

Batching & Grouping:

  • 10 messages from same sender in 1 minute → grouped notification ("5 new messages")
  • Messages from 5 different chats → grouped by conversation (iOS thread identifier)
  • Clearing one notification from group → others remain

Edge Cases:

  • Token refresh: app's push token changes → server updates, notifications still deliver
  • Expired push token → server handles gracefully, removes stale registration
  • Notification received during OS update/restart → queued by OS, delivered after boot
  • Low power mode: notification delivery timing may be affected (batched by OS)
  • Multiple accounts on same device → notification routes to correct account"

Framework/Diagram

Push Notification Delivery Chain
┌─────────┐    ┌─────────┐    ┌────────────┐    ┌────────┐
│ Backend │───▶│ APNs/   │───▶│   Device   │───▶│  User  │
│ Server  │    │ FCM/Web │    │    OS      │    │  Sees  │
│         │    │ Push    │    │            │    │ Notif  │
└────┬────┘    └────┬────┘    └─────┬──────┘    └────────┘
     │              │               │
  Trigger        Delivery        Render
  + payload      + routing       + tap action
  + targeting    + priority      + grouping

Failure Points:
  1. Server fails to send → Event logged, retry queue
  2. Token expired → 410 from APNs, remove token
  3. FCM quota exceeded → Back-pressure, retry
  4. Device offline → Platform queues (limited time)
  5. User permissions OFF → Not shown (tracked in analytics)

Worked Example

Scenario: Testing notifications for a messaging app (e.g., WhatsApp)

Test Case ID Condition Action Expected Result
PUSH-001 App in background Receive new message Notification shows sender + preview within 3s
PUSH-002 App terminated (killed) Receive new message Notification delivered by OS, tap opens chat
PUSH-003 Notifications disabled for group Message sent in group No notification, unread badge updates silently
PUSH-004 10 messages in 30s, same chat Burst of messages Grouped: "10 new messages from Alice"
PUSH-005 Android, Xiaomi device High-priority notification Heads-up notification shows despite battery optimization
PUSH-006 Quick Reply action Tap "Reply" on notification Inline reply field opens, message sends, notification dismisses

Common Mistakes to Avoid

  1. Testing only when app is in foreground — Notifications behave completely differently across app states
  2. Ignoring OEM Android customizations — Xiaomi, Huawei, Samsung have aggressive battery optimizers that kill background processes
  3. Not testing token rotation — Push tokens expire and refresh; this must be handled seamlessly
  4. Forgetting about notification permissions — iOS requires opt-in; test the denied state
  5. Missing grouping/threading tests — Ungrouped notifications flood the notification shade

Follow-up Questions

  • "How would you test notification delivery rate at scale (1M devices)?"
  • "How would you verify notifications don't contain sensitive data on lock screen?"
  • "What's your approach to testing notification scheduling and time zones?"
  • "How would you test fallback when push fails (SMS, email, in-app)?"

Q8How would you test an e-commerce checkout? #

Objective

Demonstrate ability to test a high-stakes, multi-step flow involving payments, inventory, concurrency, and regulatory compliance.

Interview Answer

"Checkout is the highest-value flow in e-commerce — any bug here directly impacts revenue. I'd approach this with extreme rigor across functional, financial, and compliance dimensions.

Clarifying questions: Single-page or multi-step checkout? What payment methods — card, wallet, BNPL, COD? Guest checkout supported? What tax/shipping calculation engines? International orders?

Risk analysis: Revenue loss from failed payments, cart abandonment from UX issues, inventory oversell from concurrency bugs, financial discrepancy from calculation errors, PCI compliance violations.

Test design:

Cart to Checkout Transition:

  • Add 3 items → proceed to checkout → all items, quantities, prices correct
  • Item goes out of stock after adding to cart → clear message at checkout, option to remove
  • Price changes between cart and checkout → user notified, updated price shown
  • Coupon/promo applied in cart → persists to checkout, discount reflected

Address & Shipping:

  • Valid address → shipping options displayed with accurate rates and delivery estimates
  • International address → correct tax/duty calculation, shipping restrictions applied
  • Address validation: typo in zip code → suggestion offered
  • Multiple shipping addresses (split shipment) → each item shows its destination
  • PO Box address → restrictions for carriers that don't deliver to PO Boxes

Payment Processing:

  • Valid card → payment succeeds → order confirmation shown
  • Declined card → clear error, user can retry with different method
  • 3D Secure/SCA redirect → complete challenge → return to merchant → order placed
  • Payment timeout → order not placed, no charge, user informed
  • Insufficient funds → specific error message (not generic 500)
  • Saved payment method → one-click pay works, CVV re-entry if required

Order Calculation Accuracy:

  • Subtotal + tax + shipping - discount = total (verify to the penny)
  • Tax calculation for different jurisdictions (e.g., NY vs. OR vs. EU VAT)
  • Free shipping threshold: cart at $49 → shows shipping cost; add $1 item → free shipping
  • Currency conversion for international orders → correct rate, displayed clearly
  • Rounding: verify no penny discrepancies across line items

Concurrency & Inventory:

  • Last item in stock: two users checkout simultaneously → only one succeeds
  • Inventory reserved during checkout (timer) → released if abandoned
  • Flash sale: 100 users clicking buy on 50 items → no overselling
  • Database-level inventory check at payment time, not just cart time

Edge Cases:

  • Browser back button during payment processing → no double charge
  • Session timeout during checkout → cart preserved, user re-authenticates and continues
  • Checkout with 50+ items (bulk order) → performance acceptable, pagination if needed
  • Empty cart → checkout button disabled, direct URL access redirects to cart
  • Network failure after payment success but before confirmation page → order created, confirmation email sent

Security & Compliance:

  • Card numbers never logged in application logs
  • PCI DSS: card data handled by tokenized iframe (Stripe Elements, Braintree)
  • HTTPS enforced on all checkout pages
  • CSRF protection on payment submission
  • Address and card data encrypted at rest

Accessibility:

  • Form fields properly labeled for screen readers
  • Error messages associated with fields (aria-describedby)
  • Progress indicator (Step 2 of 4) announced to assistive tech
  • Payment form navigable by keyboard only"

Framework/Diagram

Checkout Flow Test Matrix
┌──────────┐   ┌──────────┐   ┌──────────┐   ┌──────────┐   ┌──────────┐
│   Cart   │──▶│ Address  │──▶│ Shipping │──▶│ Payment  │──▶│ Confirm  │
│ Summary  │   │  Entry   │   │  Method  │   │  Entry   │   │  Page    │
└──────────┘   └──────────┘   └──────────┘   └──────────┘   └──────────┘
     │              │              │              │              │
  - Items       - Validation   - Rate calc    - Gateway      - Order ID
  - Qty/Price   - Suggestions  - Delivery est - 3DS/SCA      - Email sent
  - Coupons     - International- Split ship   - Tokenization - Inventory
  - Stock check - Restricted   - Free ship    - Retry logic    decremented
                  regions        threshold    - Timeout       - Receipt

Cross-cutting: Security | Performance | Accessibility | Compliance

Worked Example

Scenario: Testing Shopify-like checkout

Test Case ID Category Steps Expected Result
CHKOUT-001 Happy path Add item, enter address, select shipping, pay with Visa Order confirmed, email received, inventory decremented
CHKOUT-002 Concurrency Two users buy last item simultaneously One succeeds, other sees "Out of stock"
CHKOUT-003 Calculation $99 subtotal + 8.875% NY tax + $5.99 shipping - $10 coupon Total = $103.78 (verify exact)
CHKOUT-004 Payment failure Use test card that triggers decline Error shown, user can retry, no order created
CHKOUT-005 Recovery Close browser after shipping step, return Cart and address preserved (cookie/session)
CHKOUT-006 Security Inspect network requests during payment Card number tokenized, never in plaintext

Common Mistakes to Avoid

  1. Only testing happy path — Payment failures, timeouts, and inventory conflicts are where real bugs live
  2. Not verifying calculations to the penny — Rounding errors in tax/shipping are common and expensive
  3. Ignoring concurrency — E-commerce must handle simultaneous purchases of limited inventory
  4. Forgetting the back-button scenario — Users navigate unpredictably; the system must be resilient
  5. Missing PCI compliance — Card data handling errors can result in fines and loss of processing ability

Follow-up Questions

  • "How would you test a 'Buy Now, Pay Later' integration?"
  • "How would you handle testing with real payment gateways vs. sandbox?"
  • "What's your approach to testing checkout performance during Black Friday?"
  • "How would you test abandoned cart recovery emails?"

Q9How would you test a payment confirmation screen? #

Objective

Evaluate ability to test the critical moment between payment processing and order confirmation — where financial accuracy, user trust, and error handling converge.

Interview Answer

"The payment confirmation screen is the receipt of the digital world. It must be accurate, trustworthy, and handle all possible outcomes from the payment gateway. I'd focus on accuracy, timing, and failure modes.

Clarifying questions: What information is displayed (order ID, amount, estimated delivery, payment method last 4 digits)? Is this screen reachable only after successful payment, or also for pending/failed states? Can users take actions from this screen (print, share, track)?

Risk analysis: Showing incorrect amounts erodes trust, showing confirmation for failed payments causes support tickets, and not showing confirmation for successful payments causes panic and duplicate orders.

Test design:

Data Accuracy:

  • Verify order ID matches backend record
  • Total charged matches exact amount displayed during checkout (to the penny)
  • Payment method shows correct last 4 digits and card type (Visa/MC icon)
  • Shipping address displayed matches what was entered
  • Estimated delivery date is reasonable and calculated correctly
  • Line items match cart (item names, quantities, individual prices)
  • Tax, shipping, and discount breakdowns sum to the correct total

Timing & State Management:

  • Payment processes in 2 seconds → confirmation shown immediately
  • Payment processes in 15 seconds → loading/processing indicator shown, then confirmation
  • Payment times out (30s) → appropriate error, NOT a false confirmation
  • Payment webhook delayed → optimistic confirmation with "Processing" badge
  • Verify double-click on "Place Order" doesn't trigger duplicate payment

Failure Scenarios:

  • Payment declined → error screen (NOT confirmation), clear reason, retry option
  • Payment gateway timeout → "We're confirming your payment" screen, email follow-up
  • Network failure after payment succeeds → confirmation email sent regardless
  • Server crash after payment but before order creation → reconciliation process exists
  • Partial payment failure (split payment, one card declined) → clear status per method

Page Behavior:

  • Refresh confirmation page → same content (idempotent), no duplicate charge
  • Back button from confirmation → cannot re-submit (cart is empty, order placed)
  • Direct URL access to confirmation with different user's order ID → 403 forbidden
  • Bookmark confirmation URL → accessible later (order status page)
  • Print-friendly layout available

Email/Notification Correlation:

  • Confirmation email sent within 60 seconds of screen display
  • Email content matches on-screen confirmation exactly
  • Push notification (if enabled) fires with order ID
  • SMS confirmation for high-value orders (if configured)

Accessibility:

  • Screen reader announces "Order confirmed" with order number
  • All financial data in accessible table format (not just visual layout)
  • Focus management: page load puts focus on confirmation heading
  • Print action accessible via keyboard

Cross-platform:

  • Web: confirmation URL shareable, renders in any browser
  • iOS: confirmation deep-linkable from notification, renders in WKWebView
  • Android: screenshot capability, share intent works
  • Mobile: long order ID doesn't overflow on small screens"

Framework/Diagram

Payment Confirmation States
┌─────────────────────────────────────────────────┐
│            Payment Processing                    │
├────────────┬──────────────┬────────────────────┤
│  SUCCESS   │   PENDING    │     FAILED         │
├────────────┼──────────────┼────────────────────┤
│ ✓ Show     │ ⏳ Show       │ ✗ Show error       │
│   order ID │   "Processing"│   message          │
│ ✓ Amount   │ ⏳ Estimated  │ ✗ Reason (if known)│
│   charged  │   completion │ ✗ Retry option     │
│ ✓ Email    │ ⏳ "We'll     │ ✗ Support link     │
│   receipt  │   email you" │ ✗ Cart preserved   │
│ ✓ Tracking │ ⏳ Webhook    │ ✗ No charge made   │
│   link     │   listener   │                    │
└────────────┴──────────────┴────────────────────┘

Worked Example

Scenario: Amazon-like order confirmation

Test Case ID Payment Outcome Screen Content Verification
CONFIRM-001 Card charged $142.57 Shows "Total: $142.57", order #, delivery date Cross-check DB order record
CONFIRM-002 3DS challenge passed Confirmation with "Paid via Visa •••4242" Verify card last4 matches
CONFIRM-003 Gateway timeout "Confirming payment..." spinner → email within 5min Webhook eventually confirms
CONFIRM-004 Card declined Error: "Payment declined. Try another card." No order in DB, no charge
CONFIRM-005 Page refreshed 3x Same confirmation content each time No duplicate orders/charges
CONFIRM-006 User B accesses User A's URL 403 Forbidden or redirect to own orders Authorization check

Common Mistakes to Avoid

  1. Only testing the success state — Failed and pending states need equal coverage
  2. Not verifying financial accuracy — Amounts must match exactly between payment gateway and display
  3. Ignoring the "network failure after payment" scenario — This is where money gets lost
  4. Not testing the back button / refresh behavior — Users do this constantly
  5. Forgetting about email correlation — The confirmation page and email must show identical information

Follow-up Questions

  • "How would you test confirmation for a subscription payment vs. one-time?"
  • "What happens if the confirmation page crashes — how do you ensure the user knows their payment went through?"
  • "How would you test multi-currency confirmation displays?"
  • "How would you verify no sensitive payment data is cached in the browser?"

Q10How would you test a ride-sharing booking flow? #

Objective

Demonstrate ability to test a real-time, location-dependent, multi-party flow with complex state machines, timing constraints, and safety considerations.

Interview Answer

"Ride-sharing is a real-time marketplace connecting riders and drivers. The booking flow involves geolocation, dynamic pricing, matching algorithms, and a complex state machine. I'd test end-to-end with focus on reliability and safety.

Clarifying questions: What ride types — standard, premium, shared/pool? Scheduled rides supported? What's the cancellation policy? Is there in-app navigation? Safety features (share trip, emergency button)?

Risk analysis: GPS inaccuracy leading to wrong pickup, surge pricing errors overcharging users, driver matching failures leaving riders stranded, safety features not functioning in emergencies, and payment issues after ride completion.

Test design:

Pickup Location & Destination:

  • Enter destination → route displayed on map, ETA shown
  • GPS pickup pin accuracy: verify pin drops at actual device location (±10m)
  • Adjust pickup pin manually → address text updates accordingly
  • Enter ambiguous address → suggestions list shown, correct one selectable
  • Airport pickup → geofence-specific pickup zones displayed
  • No GPS signal (indoor, tunnel) → graceful fallback, manual address entry

Pricing & Estimates:

  • Standard route → fare estimate range shown (e.g., $12-15)
  • Surge pricing active → multiplier clearly displayed, user confirms before booking
  • Route with tolls → toll amount included in estimate
  • Shared ride → per-seat pricing, total depends on route match
  • Promo code applied → discount reflected in estimate
  • Final fare within estimate range (or explanation if exceeded due to route change)

Driver Matching & Acceptance:

  • Request ride → matched with nearby driver within 30s
  • No drivers available → clear message, options (wait, try different type, schedule)
  • Driver accepts → ETA to pickup shown, driver info displayed (name, car, plate, rating)
  • Driver cancels after acceptance → auto-rematch, rider notified
  • Rider cancels within free window → no charge; after window → cancellation fee

Ride Lifecycle State Machine:

  • Requesting → Matched → Driver en route → Arrived → Trip started → Trip completed → Rating
  • Verify state transitions on both rider and driver apps simultaneously
  • Driver arrives → "Driver has arrived" notification + 5-min wait timer starts
  • Rider no-show (5-min timer expires) → ride cancelled, no-show fee charged
  • Trip starts → live tracking shows rider moving along route
  • Route deviation by driver → alert if significant deviation from optimal route

Real-time Communication:

  • In-app call between rider and driver → connection established, audio clear
  • In-app messaging: driver sends "I'm in the blue Toyota" → rider sees immediately
  • Share trip with emergency contact → contact sees live location

Safety Features:

  • Emergency button → connects to 911, shares live location with Uber safety team
  • Trip anomaly detection: unexpected stop, route deviation → safety check triggered
  • Rider reports unsafe situation during ride → appropriate response flow
  • Driver photo matches profile → facial recognition or verification prompt

Edge Cases:

  • Phone battery dies during ride → ride continues, payment processes normally
  • Driver's app crashes mid-trip → ride state preserved, can resume
  • Two ride requests simultaneously from same account → second rejected
  • Request ride for someone else → correct phone number receives driver info
  • Cross-border ride (city to different state/country) → regulatory compliance"

Framework/Diagram

Ride-sharing State Machine
┌──────────┐     ┌───────────┐     ┌───────────┐
│REQUESTING│────▶│  MATCHED  │────▶│ DRIVER EN │
│          │     │           │     │  ROUTE    │
└──────────┘     └───────────┘     └───────────┘
     │                │                   │
  [timeout]      [driver cancels]     [arrives]
     │                │                   │
     ▼                ▼                   ▼
┌──────────┐     ┌───────────┐     ┌───────────┐
│NO DRIVERS│     │ RE-MATCH  │     │  ARRIVED  │
│AVAILABLE │     │           │     │ (5m timer)│
└──────────┘     └───────────┘     └─────┬─────┘
                                         │
                               ┌─────────┴─────────┐
                               │                    │
                               ▼                    ▼
                        ┌───────────┐        ┌──────────┐
                        │TRIP ACTIVE│        │ NO-SHOW  │
                        │(tracking) │        │(fee+cancel)│
                        └─────┬─────┘        └──────────┘
                              │
                              ▼
                        ┌───────────┐     ┌──────────┐
                        │ COMPLETED │────▶│  RATING  │
                        │(fare calc)│     │          │
                        └───────────┘     └──────────┘

Worked Example

Scenario: Testing Uber-like ride booking

Test Case ID Category Steps Expected Result
RIDE-001 Happy path Enter destination, request, driver matched ETA shown, driver info displayed, live tracking
RIDE-002 Pricing Request during surge (2.5x) Clear surge disclosure, user confirms, fare = base × 2.5
RIDE-003 Matching Request in area with no drivers "No drivers available" within 60s, suggest scheduled ride
RIDE-004 Cancellation Cancel 6 minutes after driver acceptance Cancellation fee charged (outside free window)
RIDE-005 Safety Press emergency button during trip 911 connection + live location shared with safety team
RIDE-006 Edge case Driver app crashes mid-trip Ride state preserved server-side, driver reconnects, trip continues

Common Mistakes to Avoid

  1. Testing only the happy path booking — The interesting scenarios are cancellations, no-shows, and failures
  2. Ignoring the dual-sided nature — Both rider and driver apps must be in sync at all times
  3. Not testing GPS edge cases — Indoor, tunnels, poor signal are common real-world conditions
  4. Forgetting safety features — These are critical and must work under stress (panic scenarios)
  5. Missing surge pricing transparency — Regulatory requirement in many jurisdictions

Follow-up Questions

  • "How would you test the driver matching algorithm's fairness?"
  • "How would you test ride-sharing (pool) with dynamic route optimization?"
  • "What's your approach to testing ride ETA accuracy?"
  • "How would you test the system during a major event (stadium, concert)?"

Q11How would you test a food-delivery order lifecycle? #

Objective

Test understanding of multi-party coordination (customer, restaurant, driver), time-sensitive operations, and complex state management across a distributed system.

Interview Answer

"Food delivery involves three stakeholders (customer, restaurant, driver) with time-sensitive handoffs. A bug at any stage can mean cold food, wrong orders, or lost revenue. I'd test each handoff point rigorously.

Clarifying questions: Is it marketplace (multiple restaurants) or single-brand? How is driver assignment done — zone-based, nearest, or auction? What's the SLA for delivery? Are there scheduled orders? Contactless delivery option?

Risk analysis: Wrong items delivered, excessive delivery times, pricing discrepancies between menu and checkout, driver assignment failures, and food safety concerns (time/temperature).

Test design:

Menu & Cart:

  • Browse restaurant → menu loads with accurate prices, images, descriptions
  • Item customization (no onions, extra cheese) → reflected in order summary and sent to restaurant
  • Out-of-stock item → marked unavailable, cannot add to cart
  • Restaurant closes mid-browse → cart shows "Restaurant closed" at checkout
  • Minimum order value not met → clear message with remaining amount needed
  • Add items from two restaurants → separate carts or clear warning

Order Placement:

  • Place order → confirmation with estimated delivery time
  • Payment processed → restaurant receives order on their tablet
  • Order ID consistent across customer app, restaurant dashboard, and driver app
  • Scheduled order for 7 PM → queued, sent to restaurant at appropriate prep time

Restaurant Acceptance & Preparation:

  • Restaurant accepts → status updates to "Preparing your order"
  • Restaurant rejects (too busy) → customer notified, refund initiated, suggest alternatives
  • Prep time estimate: restaurant says 20 min → customer sees "Ready for pickup at X"
  • Restaurant marks individual items as unavailable → customer offered substitution or partial refund
  • Restaurant marks order ready → driver assignment triggered

Driver Assignment & Pickup:

  • Order ready → nearest available driver assigned within 5 minutes
  • Driver accepts → customer sees driver name, ETA to restaurant, then ETA to delivery
  • No driver available → escalation (bonus offered, expand radius, or notify customer of delay)
  • Driver arrives at restaurant → "Picking up your order" status
  • Driver confirms pickup (photo/code) → "On the way" status

Delivery & Completion:

  • Live tracking shows driver en route with accurate ETA
  • Driver arrives → "Driver has arrived" notification
  • Contactless delivery: driver photos drop-off location → customer receives photo
  • Customer confirms receipt → order completed, rating prompt
  • Tip option available post-delivery

Time Sensitivity:

  • Total time from order to delivery tracked against SLA
  • If delivery exceeds SLA by >15 min → automatic compensation (credit/refund)
  • Food sitting at restaurant >10 min waiting for driver → escalation
  • Delivery to address 30+ min away → warning during order placement

Edge Cases:

  • Customer changes delivery address after restaurant starts cooking → policy-dependent handling
  • Driver has accident/emergency mid-delivery → auto-reassign, customer notified of delay
  • Customer unavailable at delivery (no answer, wrong address) → timer starts, policy for abandonment
  • Split order from restaurant (multiple bags) → driver confirms all items picked up
  • Driver eats/tampers with food (reported) → investigation flow, refund, driver penalty

Refund & Dispute:

  • Missing items reported → photo evidence, partial refund processed
  • Wrong order entirely → full refund + credit, reorder option
  • Food quality issue → refund policy applied, restaurant notified
  • Dispute response time SLA verified"

Framework/Diagram

Food Delivery Order Lifecycle
Customer App          Restaurant Dashboard       Driver App
─────────────         ────────────────────       ──────────
[Browse Menu]
[Place Order] ──────▶ [New Order Alert]
[Payment OK]          [Accept/Reject]
                      [Accept] ────────────────▶ (queued for assignment)
[Preparing...]        [Cooking...]
                      [Ready] ──────────────────▶ [Assigned]
                                                  [Accept]
[Driver assigned]                                 [Navigate to restaurant]
[Driver at restaurant]                            [Confirm pickup]
[On the way]                                      [Navigate to customer]
[Driver arrived]                                  [Confirm delivery]
[Rate & Tip]          [Order complete]            [Order complete]

Key Handoffs (Test Boundaries):
  1. Customer → Restaurant (order details accuracy)
  2. Restaurant → Driver (readiness sync, wait time)
  3. Driver → Customer (delivery confirmation, condition)

Worked Example

Scenario: Testing DoorDash-like delivery flow

Test Case ID Category Steps Expected Result
FOOD-001 Happy path Order burger + fries, pay, wait Delivered within ETA, correct items, driver rated
FOOD-002 Restaurant reject Restaurant marks "too busy" Customer refunded within 5 min, notification sent
FOOD-003 Driver no-show No driver accepts in 10 min Escalation: bonus offered, customer notified of delay
FOOD-004 Missing item Customer reports missing fries (with photo) Partial refund for fries, restaurant notified
FOOD-005 Schedule Order for 7 PM delivery Sent to restaurant at 6:30 PM (prep time aware)
FOOD-006 Address change Change address after restaurant accepts If driver not yet picked up: allowed. After pickup: denied or reroute

Common Mistakes to Avoid

  1. Only testing from customer perspective — The restaurant and driver apps are equally important
  2. Ignoring timing/SLA testing — Food delivery is extremely time-sensitive
  3. Not testing the rejection/failure paths — Restaurant rejects, driver cancels, customer unavailable
  4. Forgetting about food-specific concerns — Temperature, allergens, prep time accuracy
  5. Missing the multi-party communication — All three parties must see consistent state

Follow-up Questions

  • "How would you test the delivery ETA prediction accuracy?"
  • "How would you test batched orders (one driver, multiple deliveries)?"
  • "What's your approach to testing surge/dynamic pricing for delivery fees?"
  • "How would you test the tip flow and ensure drivers receive correct amounts?"

Q12How would you test a video upload? #

Objective

Assess understanding of file handling, progressive uploads, transcoding pipelines, and UX for long-running operations with various failure modes.

Interview Answer

"Video upload involves large file handling, background processing, and multiple potential failure points. It's a feature where UX during waiting, error recovery, and platform differences all matter significantly.

Clarifying questions: What's the maximum file size? Supported formats? Is there client-side compression? Resumable uploads? Background upload on mobile? What transcoding/processing happens server-side?

Risk analysis: Upload failures on poor connections with no resume, data loss from browser/app crashes mid-upload, server-side processing failures with no notification, storage cost from unmanaged uploads, and security risks from malicious files.

Test design:

Basic Upload Flow:

  • Select 30-second MP4 video (50MB) → upload starts, progress bar accurate
  • Upload completes → processing indicator shown → video playable within SLA
  • Multiple quality levels generated (1080p, 720p, 480p) → verify each playable
  • Thumbnail auto-generated from video → displays correctly in listings
  • Metadata preserved (title, description entered by user) → appears on video page

File Validation:

  • Upload MP4, MOV, AVI, WebM → all accepted (if supported)
  • Upload unsupported format (.exe renamed to .mp4) → rejected with clear error
  • Upload file exceeding max size (e.g., 5GB when limit is 2GB) → rejected before upload starts
  • Upload corrupted video file → detected, user notified
  • Upload zero-byte file → rejected immediately
  • File with misleading MIME type → server validates actual content (magic bytes)

Resumable Upload & Recovery:

  • Upload 500MB file, kill network at 50% → reconnect → resume from 50%
  • Close browser tab mid-upload → re-open → option to resume (if supported)
  • Mobile: switch apps mid-upload → upload continues in background
  • Mobile: app killed by OS during background upload → resume on next app open
  • Upload via unstable connection (packet loss) → individual chunk retries, overall progress continues

Progress & UX:

  • Progress bar accurately reflects bytes uploaded (not just time estimate)
  • Upload speed displayed (e.g., "2.3 MB/s")
  • Estimated time remaining shown and reasonably accurate
  • Cancel button available and immediately stops upload
  • Multiple videos queued → sequential or parallel upload with individual progress

Server-side Processing:

  • Transcoding to multiple resolutions → status visible to user ("Processing 720p...")
  • Processing failure (codec issue) → user notified, option to retry or upload different format
  • Long video (2 hours) → processing time communicated, notification when complete
  • Audio extraction → verify audio quality maintained
  • Subtitles/captions auto-generated (if feature exists) → accuracy reasonable

Performance:

  • Upload doesn't block UI (background thread/worker)
  • Memory usage stable during large upload (streaming, not loading entire file to memory)
  • Concurrent uploads by many users → server handles without degradation
  • CDN propagation: video available in all regions after processing

Security:

  • Malware in video file → server-side scanning before publishing
  • Excessively large file → upload terminated server-side if client bypassed
  • Direct URL to video respects access controls (private video not publicly accessible)
  • Upload endpoint requires authentication (no anonymous uploads)
  • Rate limiting on upload endpoint (prevent abuse/storage exhaustion)

Platform-specific:

  • iOS: PhotoLibrary permission, background upload via URLSession background task
  • Android: Storage permission (scoped storage on Android 11+), WorkManager for background
  • Web: Drag-and-drop upload zone, clipboard paste for screen recordings
  • Web: File picker filters to video MIME types"

Framework/Diagram

Video Upload Pipeline
┌──────────┐    ┌──────────────┐    ┌───────────┐    ┌──────────┐
│  Client  │───▶│ Upload Server│───▶│ Transcoder│───▶│   CDN    │
│  (chunk) │    │ (reassemble) │    │ (multiple │    │(distribute)│
│          │    │              │    │  quality) │    │          │
└──────────┘    └──────────────┘    └───────────┘    └──────────┘
     │                │                   │               │
  Progress         Validate            Process          Serve
  Resume           Virus scan          Thumbnail        Stream
  Cancel           Size check          Subtitles        Adaptive
                   Format verify       Watermark        bitrate

Upload States: SELECTING → UPLOADING → PROCESSING → PUBLISHED → FAILED
Chunk States: PENDING → UPLOADING → CONFIRMED → RETRYING

Worked Example

Scenario: Testing YouTube-like video upload

Test Case ID Category Steps Expected Result
VID-001 Happy path Upload 100MB MP4, wait for processing Video playable in 3 qualities, thumbnail generated
VID-002 Resume Upload 500MB, kill network at 200MB, reconnect Resume from ~200MB, complete without re-upload
VID-003 Validation Upload .exe renamed to .mp4 Rejected: "Invalid video format" after server inspection
VID-004 Background Start upload on iOS, switch to different app Upload continues, notification when complete
VID-005 Performance Upload while scrolling feed UI remains smooth (60fps), no jank
VID-006 Large file Upload 4K video (3GB) on WiFi Chunked upload, progress accurate, completes within 20 min

Common Mistakes to Avoid

  1. Only testing small files on fast connections — Real users upload large files on poor connections
  2. Ignoring background upload behavior — Mobile users switch apps constantly during uploads
  3. Not testing server-side processing failures — The upload succeeding doesn't mean the video is usable
  4. Forgetting security validation — Files must be validated server-side, not just by client MIME type
  5. Missing the resumable upload scenario — Non-resumable large uploads are a terrible UX on mobile

Follow-up Questions

  • "How would you test video upload for users in regions with very slow internet (500kbps)?"
  • "How would you verify transcoded video quality meets requirements?"
  • "What's your approach to testing upload quotas and storage limits?"
  • "How would you test video DRM/copy protection after upload?"

Q13How would you test a search experience? #

Objective

Evaluate ability to test relevance, performance, and UX of a search system spanning indexing, query processing, ranking, and result presentation.

Interview Answer

"Search is deceptively complex — it combines text processing, ranking algorithms, performance requirements, and nuanced UX. I'd test across the full pipeline from query input to result interaction.

Clarifying questions: What content is searchable (products, messages, documents, users)? Is there typeahead/autocomplete? Faceted search/filters? How fresh must results be (real-time vs. batch indexed)? Fuzzy matching/typo tolerance?

Risk analysis: Irrelevant results frustrate users, slow search drives abandonment, missing results mean lost sales/engagement, and search can be a vector for injection attacks.

Test design:

Query Input & Autocomplete:

  • Type 3 characters → autocomplete suggestions appear within 200ms
  • Suggestions relevant to typed prefix and user's history
  • Select suggestion → full search executes with that term
  • Clear search field → suggestions disappear, previous results clear
  • Special characters in query → properly escaped, no injection
  • Empty search submission → shows trending/popular or validation error

Relevance & Ranking:

  • Search for exact product name → that product is first result
  • Search for partial name → relevant results ranked by relevance
  • Misspelled query ("iphne") → shows results for "iphone" with "Did you mean?" prompt
  • Search for synonym ("couch" vs. "sofa") → returns both
  • Recent/updated content ranks higher than stale content (freshness boost)
  • User context influences results (previous purchases, location)

Filters & Facets:

  • Apply price filter ($10-$50) → only results within range shown
  • Combine multiple filters (category + price + rating) → AND logic applied
  • Filter shows count of matching results → counts are accurate
  • Remove filter → results expand back to unfiltered set
  • No results with current filters → helpful message, suggest removing filters

Performance:

  • Search returns results within 300ms for typical queries
  • Complex query (long string, multiple terms) → still within 1s
  • Concurrent searches (100 users) → no degradation
  • Large result set (10,000+ matches) → paginated, first page fast
  • Autocomplete under 200ms even under load

Empty & Edge States:

  • Zero results → friendly message, suggested alternative queries
  • Single character search → minimum character requirement or broad results
  • Very long query (500+ chars) → truncated or handled gracefully
  • Search for recently created content → appears within indexing SLA (e.g., < 30 seconds)
  • Search in empty database → appropriate empty state

Security:

  • SQL injection in search: '; DROP TABLE products; -- → no effect
  • XSS in search: <script>alert(1)</script> → escaped in results display
  • Search results respect access controls (User A can't find User B's private docs)
  • Search query logging doesn't expose sensitive data
  • Rate limiting on search API (prevent scraping)

Accessibility:

  • Search results navigable by keyboard (Tab through results)
  • Screen reader announces result count ("25 results for iPhone")
  • Autocomplete dropdown accessible (arrow keys, screen reader announces)
  • Search input has proper aria-label
  • Filter changes announced to assistive technology

Platform-specific:

  • Mobile: search bar with clear button, keyboard "Search" action button
  • Mobile: voice search input works correctly
  • Web: Cmd/Ctrl+K shortcut opens search
  • Mobile: results adapt to portrait/landscape"

Framework/Diagram

Search System Test Layers
┌─────────────────────────────────────────────┐
│ Layer 1: Query Input                         │
│   Autocomplete, spell-check, history, voice │
├─────────────────────────────────────────────┤
│ Layer 2: Query Processing                    │
│   Tokenization, synonyms, filters, parsing  │
├─────────────────────────────────────────────┤
│ Layer 3: Retrieval & Ranking                 │
│   Index lookup, relevance scoring, freshness│
├─────────────────────────────────────────────┤
│ Layer 4: Result Presentation                 │
│   Snippets, highlighting, pagination, facets│
├─────────────────────────────────────────────┤
│ Layer 5: Interaction                         │
│   Click-through, refine, filter, sort       │
└─────────────────────────────────────────────┘

Performance Budgets:
  Autocomplete: < 200ms
  Full search:  < 300ms (P95)
  Indexing lag:  < 30s for new content
  Zero results:  < 5% of queries

Worked Example

Scenario: Testing search for an e-commerce platform (Shopify store)

Test Case ID Category Query Expected Result
SRCH-001 Relevance "wireless headphones" Top 5 results are wireless headphones, sorted by relevance
SRCH-002 Typo tolerance "wirless hedphones" Shows results for "wireless headphones" with correction
SRCH-003 Filters "shoes" + filter: size 10, color: black Only black shoes in size 10, count accurate
SRCH-004 Performance "a" (very broad) Results within 500ms, paginated, no timeout
SRCH-005 Security <img src=x onerror=alert(1)> Input escaped, no XSS, zero results shown safely
SRCH-006 Freshness Add new product, search by name Product appears in results within 30 seconds

Common Mistakes to Avoid

  1. Only testing with exact match queries — Real users misspell, use synonyms, and phrase things differently
  2. Ignoring performance under load — Search is one of the most frequently used features
  3. Not verifying access control — Search must respect content permissions
  4. Forgetting about empty states — Zero results is a UX challenge, not just a test pass
  5. Testing relevance manually only — Use automated relevance scoring (NDCG) for regression

Follow-up Questions

  • "How would you measure search quality over time?"
  • "How would you test personalized search results without bias?"
  • "What's your approach to testing search across multiple languages?"
  • "How would you test voice search accuracy?"

Q14How would you test an OTP/MFA flow? #

Objective

Demonstrate expertise in testing authentication security features including timing, delivery channels, fallback mechanisms, and resistance to common attacks.

Interview Answer

"OTP/MFA is a security-critical feature where both usability and security must be balanced. A bad implementation either frustrates users (can't log in) or provides false security (bypassable). I'd test both dimensions rigorously.

Clarifying questions: What MFA methods are supported — SMS, email, TOTP (authenticator app), push notification, hardware key (FIDO2)? Is MFA required or optional? Can users set up multiple methods? What's the OTP length and expiration? Is there a backup/recovery flow?

Risk analysis: OTP bypass allows unauthorized access, OTP not delivered blocks legitimate users, replay attacks reuse expired codes, SIM-swap attacks compromise SMS OTP, and race conditions allow brute-force.

Test design:

OTP Generation & Delivery:

  • Request OTP → code received via SMS/email within 30 seconds
  • OTP is correct length (6 digits) and numeric
  • Each OTP request generates a different code (not predictable sequence)
  • Code delivered to correct phone/email (not leaked to other channels)
  • TOTP: authenticator app code matches server expectation within time window

OTP Validation:

  • Enter correct OTP → authentication succeeds, redirected to app
  • Enter incorrect OTP → error message, remaining attempts shown
  • Enter expired OTP (after TTL) → "Code expired, request new one" message
  • Enter OTP from previous session → rejected (not replayable)
  • Leading/trailing spaces in OTP input → trimmed, accepted if digits match
  • Copy-paste OTP → works correctly (no formatting issues)

Rate Limiting & Brute Force:

  • Enter wrong OTP 5 times → account locked or extended cooldown
  • Request OTP 10 times rapidly → rate limited after threshold (e.g., 3 per 10 min)
  • After lockout → legitimate user can still recover via backup method
  • Brute force attempt via API (scripted) → blocked by rate limiting + CAPTCHA

Timing & Expiration:

  • OTP valid for exactly 5 minutes (or configured TTL)
  • Enter OTP at 4:59 → accepted; at 5:01 → rejected
  • TOTP: code valid for current 30s window + 1 previous window (clock skew tolerance)
  • Time-of-check vs time-of-use: verify OTP can't be used in the microsecond after expiry

Fallback & Recovery:

  • Primary method fails (SMS not delivered) → option to use backup method
  • Backup codes: each code usable exactly once, then invalidated
  • Lost device → recovery flow (support ticket, identity verification)
  • All MFA methods lost → account recovery process (security questions, ID verification)

Multi-device & Session:

  • OTP entered on different device than where it was requested → behavior defined
  • Request OTP on web, enter on mobile (cross-device flow) → works if same session context
  • Multiple browser tabs: request OTP in Tab A, enter in Tab B → last OTP valid

Security Edge Cases:

  • Man-in-the-middle: phishing site proxies OTP to real site → FIDO2/WebAuthn immune
  • SIM swap attack: attacker receives SMS OTP → why TOTP/hardware keys are preferred
  • OTP in URL parameter (bad implementation) → verify it's in POST body only
  • OTP visible in server logs → verify logs redact sensitive values
  • Session fixation: verify session ID changes after successful MFA

Platform-specific:

  • iOS: SMS autofill from Messages (one-time code detection)
  • Android: SMS Retriever API for automatic code entry
  • Web: WebAuthn/FIDO2 hardware key support
  • Mobile: biometric as MFA factor (Face ID / fingerprint)"

Framework/Diagram

MFA Flow Decision Tree
┌─────────────┐
│ Login with  │
│ credentials │
└──────┬──────┘
       │ (valid)
       ▼
┌─────────────┐    ┌──────────────┐
│ MFA Required│───▶│ Select Method│
│?            │    │ SMS|TOTP|Push│
└─────────────┘    └──────┬───────┘
                          │
              ┌───────────┼───────────┐
              ▼           ▼           ▼
        ┌──────────┐ ┌────────┐ ┌──────────┐
        │ Send SMS │ │ TOTP   │ │ Push to  │
        │ OTP      │ │ Check  │ │ Device   │
        └────┬─────┘ └───┬────┘ └────┬─────┘
             │            │           │
             ▼            ▼           ▼
        ┌──────────────────────────────────┐
        │        Validate Code/Response     │
        ├────────────┬─────────────────────┤
        │ Valid      │ Invalid              │
        │ → Access   │ → Retry (max 5)     │
        │   granted  │ → Lockout           │
        │            │ → Fallback method    │
        └────────────┴─────────────────────┘

Security Properties to Verify:
  ✓ Not predictable  ✓ Not replayable  ✓ Time-limited
  ✓ Rate-limited     ✓ Channel-bound   ✓ Brute-force resistant

Worked Example

Scenario: Testing MFA for a banking app

Test Case ID Category Steps Expected Result
MFA-001 Happy path Login → receive SMS OTP → enter code Access granted, session established
MFA-002 Expiration Wait 6 minutes after receiving OTP → enter "Code expired" error, resend option
MFA-003 Brute force Enter wrong code 5 times via API Account locked for 30 min, alert email sent
MFA-004 Replay Capture valid OTP, use it after first use Rejected: "Code already used"
MFA-005 Fallback SMS not received after 60s, click "Try another way" Backup codes or email OTP option shown
MFA-006 Auto-fill iOS: receive SMS with OTP code Keyboard suggests code, one-tap to fill

Common Mistakes to Avoid

  1. Only testing the happy path — The security value of MFA is in its resistance to attacks
  2. Not testing OTP expiration precisely — Off-by-one second errors are common
  3. Ignoring the recovery flow — Users lose phones; recovery must be both secure and usable
  4. Testing only one MFA method — Users switch methods; all paths need coverage
  5. Forgetting about SMS autofill UX — iOS and Android have specific APIs for OTP autofill

Follow-up Questions

  • "How would you test the security of SMS OTP vs. TOTP vs. FIDO2?"
  • "How would you automate MFA testing in CI/CD without real SMS?"
  • "What's your approach to testing MFA enrollment vs. MFA verification?"
  • "How would you test MFA for API-only access (service accounts)?"

Q15How would you test account lockout? #

Objective

Evaluate understanding of security mechanism testing, including the balance between protecting against brute force and not creating denial-of-service for legitimate users.

Interview Answer

"Account lockout is a double-edged sword — it protects against brute force but can itself become a denial-of-service vector if an attacker intentionally locks out legitimate users. I'd test both the security efficacy and the usability impact.

Clarifying questions: What's the lockout threshold (attempts before lock)? What's the lockout duration (temporary vs. permanent)? Is it IP-based, account-based, or both? Is there progressive delay? What unlock mechanisms exist (time-based, admin, self-service)?

Risk analysis: Too aggressive lockout = DoS against legitimate users; too lenient = brute force succeeds; no notification = user unaware they're under attack; no unlock mechanism = support burden.

Test design:

Threshold Testing:

  • Enter wrong password N-1 times → account still active, warning shown ("1 attempt remaining")
  • Enter wrong password N times → account locked, clear message shown
  • Enter correct password after lock → still locked (credentials not checked during lockout)
  • Verify threshold is per-account, not per-session (closing browser doesn't reset counter)
  • Mixed case: 3 wrong attempts, 1 correct, 2 more wrong → counter behavior (reset on success?)

Lockout Duration & Recovery:

  • Temporary lockout: verify account unlocks after specified duration (e.g., 30 minutes)
  • Try login at 29 minutes → still locked; at 31 minutes → unlocked
  • Permanent lockout: verify only admin or self-service flow can unlock
  • Self-service unlock via email/SMS verification → works, counter resets
  • After unlock, user can login with correct credentials immediately

Progressive Delay (if implemented instead of hard lockout):

  • 1st failure: no delay; 3rd failure: 5s delay; 5th failure: 30s delay; 10th: 5min
  • Verify delay is enforced server-side (not just UI), API returns 429
  • After successful login, delay counter resets

Notification & Awareness:

  • Account locked → email notification sent to account owner ("Suspicious activity detected")
  • Email includes: time, IP address, location (if available), unlock instructions
  • Multiple lockouts → escalation (additional verification required on unlock)
  • Admin dashboard shows locked accounts with attempt details

Attack Scenarios:

  • Brute force from single IP → locked + IP temporarily blocked
  • Distributed brute force (different IPs, same account) → account-level protection triggers
  • Account lockout DoS: attacker locks victim's account intentionally → victim has self-service unlock
  • Credential stuffing (valid emails, random passwords) → global rate limiting across accounts
  • Username enumeration via lockout: locked vs. non-existent account → same response (no info leak)

Boundary & Integration:

  • Lockout applies to all login paths: web, mobile app, API, SSO
  • OAuth/SSO login attempts → do they count against lockout? (usually no, external IDP handles)
  • Password change during lockout period → behavior defined (usually not possible)
  • Admin manually unlocking account → immediate effect, user can login
  • Lockout state survives server restart (persisted, not in-memory only)

Monitoring & Alerting:

  • Spike in lockouts → security team alerted (potential attack)
  • Lockout metrics visible in dashboard (locked accounts count, trend)
  • Audit log captures all lockout events with context"

Framework/Diagram

Account Lockout State Diagram
                    ┌──────────────────┐
                    │      ACTIVE      │
                    │ (attempts = 0)   │
                    └────────┬─────────┘
                             │ wrong password
                             ▼
                    ┌──────────────────┐
                    │    ATTEMPTING    │
                    │ (attempts < N)   │◀─── wrong password (increment)
                    └────────┬─────────┘
                             │ attempts = N
                             ▼
                    ┌──────────────────┐
        ┌──────────│     LOCKED       │──────────┐
        │          │ (timer starts)   │          │
        │          └──────────────────┘          │
        │                                         │
        ▼                                         ▼
┌──────────────┐                          ┌──────────────┐
│ TIMED UNLOCK │                          │ MANUAL/SELF  │
│ (30m elapsed)│                          │ UNLOCK       │
└──────┬───────┘                          └──────┬───────┘
       │                                          │
       └──────────────┬───────────────────────────┘
                      ▼
              ┌──────────────────┐
              │   ACTIVE         │
              │ (counter reset)  │
              └──────────────────┘

Worked Example

Scenario: Testing lockout for an enterprise SaaS platform

Test Case ID Category Steps Expected Result
LOCK-001 Threshold Enter wrong password 5 times (threshold = 5) Account locked, "Account locked" message
LOCK-002 Duration Wait 30 min after lockout, try correct password Login succeeds, counter reset
LOCK-003 Notification Trigger lockout Email sent: "Account locked due to multiple failed attempts"
LOCK-004 DoS resistance Attacker locks victim's account Victim uses "Unlock via email" self-service
LOCK-005 Enumeration Lock existing account vs. attempt non-existent Same response: "Invalid credentials" (no difference)
LOCK-006 API parity Trigger lockout via API (not UI) Same lockout applies, rate limit returns 429

Common Mistakes to Avoid

  1. Only testing from the user's perspective — Test from the attacker's perspective too
  2. Not verifying info leak prevention — Locked accounts must not be distinguishable from non-existent ones
  3. Ignoring the DoS angle — If an attacker can lock out your CEO, that's a vulnerability
  4. Testing only UI lockout — API endpoints must enforce the same policy
  5. Forgetting to verify counter reset — Counter should reset on successful login (otherwise users get locked out from occasional typos)

Follow-up Questions

  • "How would you test lockout in a distributed system with multiple auth servers?"
  • "What's the trade-off between lockout strictness and user experience?"
  • "How would you test CAPTCHA as an alternative to hard lockout?"
  • "How would you detect and alert on credential stuffing attacks?"

Q16How would you test password reset? #

Objective

Assess understanding of security-sensitive workflows where usability and protection against account takeover must be balanced.

Interview Answer

"Password reset is an account recovery mechanism that, if flawed, becomes an account takeover vector. It's often the weakest link in authentication because it bypasses the password entirely. I'd test security rigorously while ensuring legitimate users can recover access.

Clarifying questions: What reset method — email link, SMS code, security questions? Token expiration time? Can reset be initiated while logged in (password change) vs. logged out (forgot password)? Are there additional verification steps for high-security accounts?

Risk analysis: Token prediction/brute force allows account takeover, email enumeration reveals registered users, missing token expiration allows indefinite replay, password reset links in logs/referrer headers leak tokens.

Test design:

Happy Path:

  • Click "Forgot password" → enter email → receive reset link within 60 seconds
  • Click link → enter new password → confirm → password updated
  • Login with new password → success
  • Old password no longer works

Token Security:

  • Reset token is cryptographically random (not sequential, not predictable)
  • Token is minimum 128 bits of entropy (32+ hex characters)
  • Token expires after configured time (e.g., 1 hour)
  • Token is single-use (clicking link twice → second time shows "Link expired")
  • Token is invalidated if user requests a new reset link
  • Token is invalidated after successful password change
  • Token in URL → verify no referrer leakage (Referrer-Policy: no-referrer on reset page)

Email/User Enumeration Prevention:

  • Enter registered email → "If an account exists, we sent a reset link" (generic)
  • Enter non-existent email → same message (no "Email not found" error)
  • Response timing consistent for both cases (prevent timing attacks)

Password Requirements:

  • New password must meet complexity requirements (shown clearly)
  • New password cannot be same as current/previous N passwords
  • Password strength meter provides real-time feedback
  • Confirm password field must match
  • Common/breached passwords rejected (haveibeenpwned check)

Session & Security Impact:

  • After password reset → all existing sessions invalidated (force re-login everywhere)
  • Active sessions on other devices terminated immediately
  • Notification email sent: "Your password was changed" (to detect unauthorized reset)
  • If user didn't initiate reset → "secure your account" link in notification

Rate Limiting:

  • Request reset 10 times for same email → rate limited after 3 (prevent email bombing)
  • Request reset for many different emails from same IP → blocked (credential stuffing)
  • Rate limiting doesn't reveal which emails exist

Edge Cases:

  • Request reset → change email address before clicking link → token invalidated
  • Request reset → account disabled by admin → token invalid
  • Multiple pending reset tokens → only latest should work
  • Reset link opened in different browser/device → should still work (token-based, not session-based)
  • Reset link with modified email parameter → rejected (token bound to specific email)
  • Password reset for OAuth-only account → "Use Google/SSO to sign in" message

Platform-specific:

  • iOS: Universal link opens app to reset screen (not Safari)
  • Android: Deep link opens app to reset screen
  • Email client: link renders correctly in Gmail, Outlook, Apple Mail
  • Mobile: reset form usable on small screen, password field with show toggle"

Framework/Diagram

Password Reset Security Checklist
┌─────────────────────────────────────────────────────┐
│ Token Properties                                     │
│ ☐ Cryptographically random (CSPRNG)                 │
│ ☐ Sufficient entropy (≥128 bits)                    │
│ ☐ Time-limited (1h recommended)                     │
│ ☐ Single-use (invalidated after use)                │
│ ☐ Bound to specific account                         │
│ ☐ Invalidated on new request                        │
│ ☐ Not in server logs                                │
│ ☐ No referrer leakage                               │
├─────────────────────────────────────────────────────┤
│ Flow Security                                        │
│ ☐ No user enumeration                               │
│ ☐ Rate limiting per email and per IP                │
│ ☐ All sessions invalidated after reset              │
│ ☐ Notification email sent on change                 │
│ ☐ Password history check                            │
│ ☐ Breach database check                             │
├─────────────────────────────────────────────────────┤
│ UX Requirements                                      │
│ ☐ Clear password requirements shown                 │
│ ☐ Real-time strength meter                          │
│ ☐ Accessible form (labels, errors)                  │
│ ☐ Works on mobile (responsive)                      │
│ ☐ Deep link to app (iOS/Android)                    │
└─────────────────────────────────────────────────────┘

Worked Example

Scenario: Testing password reset for a healthcare platform (HIPAA context)

Test Case ID Category Steps Expected Result
RESET-001 Happy path Request reset, click link, set new password Password updated, all sessions invalidated
RESET-002 Token expiry Click reset link after 61 minutes "Link expired" page, option to request new
RESET-003 Single use Click reset link twice First: reset form. Second: "Link already used"
RESET-004 Enumeration Request reset for non-existent email Same response as valid email, no timing diff
RESET-005 Session kill Reset password while logged in elsewhere All other sessions terminated immediately
RESET-006 History Set new password same as previous "Cannot reuse recent passwords" error

Common Mistakes to Avoid

  1. Not testing token security — Predictable or non-expiring tokens are critical vulnerabilities
  2. Ignoring session invalidation — Old sessions must die after password reset
  3. Allowing user enumeration — "Email not found" messages help attackers
  4. Not testing the email notification — Users must be alerted to password changes they didn't initiate
  5. Testing only the happy path — Expired tokens, reused tokens, and tampered tokens are key scenarios

Follow-up Questions

  • "How would you test password reset if the email provider is slow/unreliable?"
  • "What's the security difference between reset link and OTP-based reset?"
  • "How would you handle password reset for accounts with MFA enabled?"
  • "How would you test the account recovery flow when all methods are lost?"

Q17How would you test a mobile app on iOS and Android? #

Objective

Demonstrate comprehensive knowledge of platform differences, testing tools, and strategies for ensuring quality across both major mobile platforms.

Interview Answer

"Testing across iOS and Android requires understanding fundamental platform differences — not just screen sizes, but lifecycle management, permission models, storage, and distribution mechanisms. I'd build a testing strategy that maximizes shared coverage while addressing platform-specific risks.

Clarifying questions: Is this a native app (Swift/Kotlin), cross-platform (React Native/Flutter), or hybrid (WebView)? What minimum OS versions are supported? What devices are in the target demographic? Are there platform-exclusive features?

Risk analysis: Platform-specific crashes (lifecycle bugs), inconsistent behavior between platforms (users compare), performance differences on lower-end Android devices, and permission handling discrepancies.

Test design:

App Lifecycle (Critical Platform Difference):

  • iOS: App goes to background → suspended → terminated by OS → state preserved?
  • Android: Activity recreated on config change (rotation) → state preserved?
  • Both: Force-kill app mid-operation → graceful recovery on relaunch
  • Both: Incoming phone call during critical flow → flow state preserved after call
  • iOS: Memory warning → app responds appropriately (releases cache)
  • Android: Low memory → system may kill background activities → state restoration

Permissions:

  • iOS: Permission dialog shown on first use (camera, location, notifications)
  • iOS: User denies permission → app handles gracefully, shows explanation, Settings link
  • Android: Runtime permission request (camera, storage, location)
  • Android: "Don't ask again" checked → future requests silently denied → guide to Settings
  • Both: Permission revoked in Settings while app is in background → behavior on resume
  • Android 13+: Notification permission required (previously implicit)

Storage & Data:

  • iOS: Data stored in appropriate sandbox location (Documents vs. Caches)
  • iOS: iCloud backup includes/excludes appropriate data
  • Android: Scoped storage (Android 10+) → correct file access patterns
  • Both: App uses 500MB+ storage → iOS storage warning, Android behavior
  • Both: Clear app data → app resets cleanly, no crash on next launch

Network Handling:

  • Both: Switch from WiFi to cellular → no interruption in ongoing operations
  • Both: Airplane mode → appropriate offline UI shown
  • Both: Slow network (2G simulation) → timeouts handled, loading states shown
  • iOS: Network reachability monitoring via NWPathMonitor
  • Android: ConnectivityManager callbacks for network state

UI/UX Platform Conventions:

  • iOS: Navigation via back swipe gesture (edge swipe) works correctly
  • iOS: Tab bar at bottom, navigation bar at top (standard patterns)
  • Android: Hardware/gesture back button behavior correct for all screens
  • Android: Material Design components (FAB, bottom navigation, snackbars)
  • Both: System font scaling (accessibility text size) → layouts adapt without overflow
  • Both: Dark mode / Light mode toggle → correct theme application

Push Notifications:

  • iOS: APNs token registration, notification categories with actions
  • Android: FCM token registration, notification channels (Android 8+)
  • Both: Notification tap opens correct screen (deep link handling)
  • Both: Notification received in foreground vs. background behavior

Performance:

  • iOS: Test on oldest supported device (e.g., iPhone 8 if targeting iOS 15+)
  • Android: Test on low-end device (2GB RAM, older chipset)
  • Both: App cold start < 3 seconds
  • Both: Scrolling lists at 60fps (no frame drops)
  • Both: Memory usage reasonable, no leaks over time (Instruments/Profiler)
  • Android: Battery usage not excessive (check Battery Stats)

Installation & Updates:

  • iOS: Fresh install from TestFlight → onboarding flow
  • Android: Fresh install from Play Store Internal Testing → onboarding
  • Both: Update from previous version → data migration successful
  • Both: Downgrade protection (if applicable)
  • Android: Install on device without Google Play Services → appropriate handling

Testing Tools:

  • iOS: XCTest + XCUITest for UI automation, Instruments for profiling
  • Android: Espresso + UIAutomator for UI automation, Android Profiler
  • Cross-platform: Appium, Detox (React Native), Flutter Driver
  • Both: Firebase Test Lab / AWS Device Farm for real device testing"

Framework/Diagram

Mobile Testing Strategy Matrix
┌──────────────────┬────────────────────┬────────────────────┐
│    Category      │       iOS          │      Android       │
├──────────────────┼────────────────────┼────────────────────┤
│ Lifecycle        │ App states:        │ Activity lifecycle: │
│                  │ Active/Background/ │ onCreate/onResume/ │
│                  │ Suspended/Terminal │ onPause/onDestroy  │
├──────────────────┼────────────────────┼────────────────────┤
│ Permissions      │ Info.plist +       │ Manifest +         │
│                  │ runtime prompt     │ runtime request    │
├──────────────────┼────────────────────┼────────────────────┤
│ Navigation       │ UINavigationCtrl   │ Jetpack Navigation │
│                  │ Edge swipe back    │ System back button │
├──────────────────┼────────────────────┼────────────────────┤
│ Storage          │ Keychain, CoreData │ Keystore, Room     │
│                  │ UserDefaults       │ SharedPreferences  │
├──────────────────┼────────────────────┼────────────────────┤
│ Notifications    │ APNs + categories  │ FCM + channels     │
├──────────────────┼────────────────────┼────────────────────┤
│ Testing Tools    │ XCUITest,          │ Espresso,          │
│                  │ Instruments        │ UIAutomator        │
├──────────────────┼────────────────────┼────────────────────┤
│ Distribution     │ TestFlight         │ Play Internal Test │
│                  │ App Store (1-7d)   │ Play Store (hours) │
└──────────────────┴────────────────────┴────────────────────┘

Worked Example

Scenario: Testing a fintech app on both platforms

Test Case ID Platform Category Test Expected
MOB-001 iOS Lifecycle Receive call during transfer Transfer state preserved, resume after call
MOB-002 Android Lifecycle Rotate during form entry Form data preserved, layout adapts
MOB-003 iOS Permission Deny camera for check deposit Error with "Enable in Settings" link
MOB-004 Android Permission "Don't ask again" for storage App guides to Settings, explains why needed
MOB-005 Both Performance Cold start on oldest target device Launch < 3s, no ANR/watchdog kill
MOB-006 Both Update Update from v2.0 to v3.0 Data migrates, no crash, user stays logged in

Common Mistakes to Avoid

  1. Testing only on latest OS/device — Real users have older phones and OS versions
  2. Assuming identical behavior — iOS and Android handle lifecycle, back navigation, and permissions differently
  3. Ignoring low-end Android devices — Fragmentation means 2GB RAM devices are still common
  4. Not testing config changes — Rotation, multi-window, and font size changes break many apps
  5. Forgetting about platform conventions — iOS swipe-back and Android system back must both work

Follow-up Questions

  • "How would you prioritize which devices to test on with limited budget?"
  • "What's your strategy for testing platform-specific accessibility features?"
  • "How would you handle a bug that only reproduces on specific Android OEMs?"
  • "How do you test app behavior during OS updates?"

Q18How would you handle device/browser fragmentation? #

Objective

Assess strategic thinking about coverage vs. cost tradeoffs in fragmented ecosystems, and practical approaches to achieving confidence without testing every combination.

Interview Answer

"With thousands of Android devices, dozens of iOS versions, and multiple browser engines, exhaustive testing is impossible. The goal is risk-based coverage that maximizes confidence per testing dollar. I'd use analytics-driven device selection, layered automation, and strategic real-device testing.

Clarifying questions: What does our analytics show for device/browser distribution? What's our market — enterprise (newer devices) or consumer (wider spread)? What budget do we have for device labs? Are there known problem devices from support tickets?

Risk analysis: Rendering differences across browsers cause visual bugs, different JS engine behaviors cause functional failures, Android OEM customizations break standard APIs, and older devices lack performance for modern features.

Test design:

Analytics-Driven Device Matrix:

  • Pull analytics: top 10 devices = 60% of users → these are mandatory test targets
  • Top 3 browsers + versions = 75% of web users → primary browser matrix
  • Include one device from each tier: flagship, mid-range, low-end
  • Include oldest supported OS version (the floor)
  • Include newest OS version (regression from OS updates)

Tiered Testing Strategy:

  • Tier 1 (Every build): Top 3 devices/browsers — full functional test
  • Tier 2 (Weekly): Next 7 devices/browsers — smoke test + critical paths
  • Tier 3 (Release): Extended set of 20+ — critical path only
  • Tier 4 (Quarterly): Exploratory on exotic devices (foldables, tablets, TVs)

Browser-specific Testing:

  • Chrome, Safari, Firefox, Edge → verify rendering consistency
  • Safari iOS vs. Safari macOS → WebKit differences in viewport handling
  • Chrome on Android vs. Chrome on Desktop → mobile-specific behaviors
  • Samsung Internet Browser (5%+ Android market share) → often forgotten
  • WebView (in-app browsers) → LinkedIn, Facebook, Twitter in-app browsers

Android Fragmentation Specifics:

  • Test on Samsung, Xiaomi, Huawei (top OEMs with custom skins)
  • Battery optimization: Xiaomi MIUI kills background processes → test background features
  • Notification customization: Samsung OneUI notification behavior differences
  • Camera API differences across OEMs
  • Different default keyboards (Samsung Keyboard vs. Gboard behavior)

iOS Fragmentation:

  • Test on supported iOS versions (typically current and current-1)
  • iPhone SE (small screen) vs. iPhone Pro Max (large screen) vs. iPad
  • Notch/Dynamic Island handling → content not obscured
  • ProMotion (120Hz) vs. 60Hz → animation smoothness parity

Automation & Cloud Devices:

  • Use BrowserStack/Sauce Labs/AWS Device Farm for cloud device access
  • Run automated suite on top 20 device/browser configs nightly
  • Visual regression testing (Percy, Applitools) catches rendering differences across devices
  • Performance budgets per device tier (acceptable LCP on low-end)

Responsive Breakpoints:

  • Test at all design breakpoints (320px, 768px, 1024px, 1440px)
  • Test between breakpoints (unusual widths like 500px)
  • Test on actual devices, not just browser resize (touch behavior differs)
  • Foldable devices: test folded, unfolded, and mid-fold states

Practical Coverage Approach:

Coverage = Σ(device_market_share × test_depth)
Target: 95% of users covered by Tier 1 + Tier 2 testing

Framework/Diagram

Fragmentation Testing Pyramid
           ┌─────────────┐
           │  Tier 4:    │  Quarterly
           │  Exploratory │  (exotic devices)
           │  5 devices   │
          ┌┴─────────────┴┐
          │   Tier 3:      │  Per Release
          │   Critical Path │  (20+ configs)
          │   + Visual Reg  │
         ┌┴────────────────┴┐
         │    Tier 2:        │  Weekly
         │    Smoke + Core   │  (10 configs)
         │    Flows          │
        ┌┴──────────────────┴┐
        │     Tier 1:         │  Every Build
        │     Full Functional │  (3 configs)
        │     Top Devices     │
        └─────────────────────┘

Device Selection Matrix:
┌─────────┬────────────────┬────────────┬───────────┐
│ Segment │ iOS            │ Android    │ Web       │
├─────────┼────────────────┼────────────┼───────────┤
│ High-end│ iPhone 15 Pro  │ Galaxy S24 │ Chrome 120│
│ Mid-tier│ iPhone 13      │ Pixel 7a   │ Safari 17 │
│ Low-end │ iPhone SE      │ Galaxy A14 │ Firefox   │
│ Edge    │ iPad (tablet)  │ Xiaomi/fold│ Samsung   │
└─────────┴────────────────┴────────────┴───────────┘

Worked Example

Scenario: Managing fragmentation for a banking app with 2M users

Analytics Insight Test Decision Implementation
45% iOS 17, 30% iOS 16, 15% iOS 15 Support iOS 15+, test all three Device farm configs
Samsung 35%, Xiaomi 15%, Pixel 10% of Android Mandatory test on all three OEMs Physical + cloud devices
Chrome 55%, Safari 25%, Samsung Internet 8% Tier 1 browsers, Samsung in Tier 2 BrowserStack suite
5% on foldable devices Tier 3 coverage with fold/unfold Quarterly on Samsung Fold
3% still on Android 10 Support but Tier 3 only Smoke test before release
40% use accessibility features Test with VoiceOver + TalkBack Every build on Tier 1 devices

Common Mistakes to Avoid

  1. Testing only on developer's latest iPhone — Real users have older, cheaper devices
  2. Treating browser resize as device testing — Touch behavior, performance, and APIs differ on real devices
  3. Equal coverage across all devices — Analytics should drive priority, not equal time
  4. Forgetting about in-app browsers (WebView) — Many users open links from social apps
  5. Not updating the device matrix — Market share shifts; review quarterly

Follow-up Questions

  • "How would you justify device lab costs to management?"
  • "When a bug is reported on a device you don't have, what's your process?"
  • "How would you test for foldable device support?"
  • "What's your approach to testing on unreleased OS betas?"

Q19How would you test app upgrade and backward compatibility? #

Objective

Evaluate understanding of version migration, data persistence across upgrades, API backward compatibility, and the challenges of supporting multiple live versions simultaneously.

Interview Answer

"Unlike web apps where everyone gets the latest version instantly, mobile apps have multiple versions in production simultaneously. Users update at different times, and a forced update is a last resort. I'd test the upgrade path itself and the coexistence of versions.

Clarifying questions: How many previous versions do we support? Is there a forced update mechanism? What data migrations are needed? Are there API version changes? What about users who skip versions (v2 → v5)?

Risk analysis: Data loss during upgrade, crashes on first launch after update, API incompatibility between old client and new server, database schema migration failures, and users stuck on unrecoverable state.

Test design:

Direct Upgrade (N to N+1):

  • Install previous version → add data (login, create content, save preferences) → upgrade → all data intact
  • Verify database schema migration runs successfully (no corruption)
  • Verify cached data (images, files) survives or is properly invalidated
  • Verify auth token remains valid (user stays logged in)
  • First launch after upgrade: no crash, no ANR, reasonable startup time

Skip-version Upgrade (N to N+3):

  • Install version 2.0 → add data → upgrade directly to 5.0 → verify migration chain works
  • Database migrations must be sequential and idempotent (2→3→4→5)
  • Test the longest realistic skip (based on analytics of update frequency)

Fresh Install vs. Upgrade:

  • Fresh install of latest version → compare behavior with upgraded version
  • Verify no "ghost data" from previous versions causing issues
  • Onboarding: fresh install shows tutorial; upgrade does not (or shows "what's new")

Data Migration:

  • Verify all user data persists: login state, preferences, drafts, downloads
  • Verify data format changes handled: e.g., date format changed, old dates migrated
  • Large local database (10,000 records) → migration completes without timeout
  • Encryption key rotation during upgrade → data re-encrypted successfully

API Backward Compatibility:

  • New server deployed → old app version still functions (API versioning)
  • Old server (during rollback) → new app version handles gracefully
  • Deprecated API endpoints → old client gets appropriate response (not 404)
  • New required field in API response → old client ignores it (doesn't crash)
  • Removed field from API response → new client handles absence gracefully

Rollback & Downgrade:

  • User downgrades app (uncommon but possible on Android) → app handles newer DB schema
  • Server rollback to previous version → current clients still work
  • Feature flag turns off new feature → app degrades gracefully to old behavior

Platform-specific Upgrade:

  • iOS: TestFlight beta → App Store release upgrade path
  • iOS: Background app refresh after update (silent migration)
  • Android: Auto-update at night → user opens to new version next morning
  • Android: In-app update (flexible vs. immediate) flow tested

Forced Update:

  • App version below minimum → forced update screen shown
  • Forced update screen: no way to dismiss, clear instructions to update
  • Verify minimum version endpoint is checked on app launch
  • Network failure during version check → grace period or cached decision

Coexistence Testing:

  • User A on v4, User B on v5, both in same chat → messages compatible
  • New features only visible to v5 users → v4 users don't see broken UI
  • Data created by v5 user → viewed by v4 user → graceful degradation"

Framework/Diagram

Version Compatibility Matrix
┌──────────────────────────────────────────────┐
│ Server API v3                                 │
├──────────┬───────────┬───────────┬──────────┤
│Client v3 │ Client v4 │ Client v5 │Client v6 │
│ ✓ Full   │ ✓ Full    │ ✓ Full    │ ⚠ Partial│
│ compat   │ compat    │ compat    │ (new feat│
│          │           │           │  fallback)│
└──────────┴───────────┴───────────┴──────────┘

Upgrade Path Testing:
  v2.0 → v3.0 → v4.0 → v5.0 (sequential)
  v2.0 ────────────────→ v5.0 (skip-version)
  v4.0 → v5.0 → v4.0 (downgrade - edge case)

Migration Chain:
  DB Schema v2 → [migration_2_to_3] → v3 → [migration_3_to_4] → v4
  Each migration: idempotent + reversible + tested independently

Worked Example

Scenario: Testing upgrade for a note-taking app (Notion-like)

Test Case ID Category Steps Expected Result
UPG-001 Direct upgrade v3.0 (100 notes, 5 tags) → v4.0 All notes, tags present, new features available
UPG-002 Skip version v2.0 → v4.0 (skipping v3) Sequential migrations run, data intact
UPG-003 API compat Old client v3 with new server v4 API All existing features work, new endpoints ignored
UPG-004 Data migration 10K notes with old date format → upgrade All dates migrated to new format correctly
UPG-005 Auth persist Upgrade app User remains logged in, token valid
UPG-006 Coexistence User A (v3) and User B (v4) share document Both can view/edit, new v4 features graceful-degrade for v3

Common Mistakes to Avoid

  1. Only testing fresh installs — Most users are upgrading, not installing fresh
  2. Ignoring skip-version upgrades — Many users skip 2-3 versions before updating
  3. Not testing data migration at scale — 10 records migrates fine; 100,000 may timeout
  4. Forgetting API backward compatibility — Server deploys shouldn't break old clients
  5. Assuming everyone updates immediately — Active version fragmentation is reality

Follow-up Questions

  • "How would you test a database migration that takes 30+ seconds on large datasets?"
  • "What's your strategy when a bug is found only in the upgrade path, not fresh install?"
  • "How would you handle a breaking API change that requires forced update?"
  • "How would you test rollback scenarios when a release has critical bugs?"

Q20How would you test deep links? #

Objective

Test understanding of URI scheme handling, universal/app links, deferred deep linking, and the complex routing logic that maps URLs to in-app screens.

Interview Answer

"Deep links are the bridge between the external world (web, email, notifications, QR codes) and specific in-app content. They're critical for user acquisition, engagement campaigns, and cross-platform navigation — but they're fragile and platform-specific.

Clarifying questions: What types of deep links — custom URI scheme, Universal Links (iOS), App Links (Android), or deferred deep links? What happens if the app isn't installed? What screens are deep-linkable? Are there authentication requirements?

Risk analysis: Broken deep links damage marketing campaigns and user experience, incorrect routing shows wrong content, unauthenticated deep links expose private content, and platform verification failures cause links to open in browser instead of app.

Test design:

Basic Deep Link Routing:

  • Click deep link to product page → app opens to that specific product
  • Click deep link to user profile → app opens to that profile
  • Click deep link to settings page → app opens to settings
  • Invalid deep link path → app opens to fallback (home screen), no crash
  • Deep link with query parameters → parameters parsed and applied correctly

Platform-specific Verification:

  • iOS Universal Links: apple-app-site-association file served correctly from domain
  • iOS: Link tapped in Safari → opens in app (not browser)
  • iOS: Long-press link → shows app name in context menu (association verified)
  • Android App Links: assetlinks.json served correctly, intent filter configured
  • Android: Verified link opens app directly (no disambiguation dialog)
  • Android: Non-verified link shows "Open with" chooser

App Not Installed (Deferred Deep Linking):

  • Click deep link, app not installed → redirect to App Store / Play Store
  • Install app from store → first launch → routed to deep link destination (deferred)
  • Deferred deep link with attribution parameters → marketing source tracked
  • Web fallback: if user chooses not to install → web page shown with same content

Authentication States:

  • Deep link to authenticated content, user logged in → direct navigation
  • Deep link to authenticated content, user logged out → login screen, then redirect to destination
  • Deep link to content user doesn't have access to → appropriate error (403), not crash
  • Deep link preserves destination through login/signup flow

Entry Points:

  • From email → deep link works (different email clients: Gmail, Outlook, Apple Mail)
  • From SMS/iMessage → link opens app
  • From push notification → tap navigates to correct screen
  • From QR code scan → app opens to linked content
  • From social media (Facebook, Twitter in-app browser) → handles WebView behavior
  • From another app (e.g., Maps, Contacts) → link resolution works

Edge Cases:

  • Deep link to deleted/expired content → friendly "Content not found" screen
  • Deep link with extremely long URL (2000+ chars) → handled without crash
  • Deep link with encoded special characters → decoded correctly
  • Multiple rapid deep link taps → last one wins, no navigation stack corruption
  • Deep link during app update → behavior defined (queue or drop)
  • Universal Link opened in private/incognito mode → still works

Testing Approach:

  • Use xcrun simctl openurl for iOS simulator testing
  • Use adb shell am start -a android.intent.action.VIEW -d "URL" for Android
  • Verify AASA and assetlinks.json with Apple/Google validation tools
  • Test with actual messaging apps (WhatsApp, Slack) for real-world behavior"

Framework/Diagram

Deep Link Resolution Flow
┌────────────────┐
│  External Link │ (email, SMS, QR, notification)
└───────┬────────┘
        │
        ▼
┌────────────────┐    ┌──────────────────┐
│ App Installed? │─NO─▶│ Deferred Deep    │
│                │    │ Link Service     │
└───────┬────────┘    │ → Store redirect │
        │YES          │ → Install        │
        ▼             │ → First launch   │
┌────────────────┐    │ → Route to dest  │
│ Platform       │    └──────────────────┘
│ Resolution     │
├────────────────┤
│ iOS: AASA      │
│ Android: Intent│
│ Fallback: URI  │
└───────┬────────┘
        │
        ▼
┌────────────────┐
│ Auth Check     │
├────────────────┤
│ Logged in → Navigate to destination
│ Logged out → Login → Navigate
│ No access → Error page
└────────────────┘

Verification Commands:
  iOS:    xcrun simctl openurl booted "myapp://product/123"
  Android: adb shell am start -d "https://myapp.com/product/123"
  Web:    curl -I https://myapp.com/.well-known/assetlinks.json

Worked Example

Scenario: Testing deep links for an e-commerce app

Test Case ID Entry Point Deep Link Expected Result
DEEP-001 Email "Your order shipped" myapp.com/orders/12345 App opens to order #12345 details
DEEP-002 SMS marketing myapp.com/sale/summer App opens to summer sale category
DEEP-003 QR code in store myapp.com/product/SKU789 App opens to product page with Add to Cart
DEEP-004 App not installed myapp.com/product/SKU789 App Store → install → opens to product
DEEP-005 Not logged in myapp.com/account/settings Login screen → after login → settings page
DEEP-006 Deleted product myapp.com/product/DELETED "Product no longer available" friendly page

Common Mistakes to Avoid

  1. Only testing from the simulator command line — Real-world links from email/SMS apps behave differently
  2. Forgetting the "not installed" scenario — Deferred deep linking is critical for marketing
  3. Not testing authentication state — Deep links to protected content need login-then-redirect
  4. Ignoring in-app browsers — Facebook/Twitter/LinkedIn open links in WebViews with restrictions
  5. Missing AASA/assetlinks validation — Server misconfiguration silently breaks deep links

Follow-up Questions

  • "How would you test deep link attribution for marketing campaigns?"
  • "What happens when a deep link conflicts with a web route?"
  • "How would you test deep links during A/B tests or feature flags?"
  • "How would you handle deep link versioning when app navigation changes?"

Q21How would you test session expiry? #

Objective

Evaluate understanding of session management, token lifecycle, graceful expiration handling, and security implications of session policies.

Interview Answer

"Session expiry is a security mechanism that must be invisible when working correctly but graceful when triggered. Users should never lose work, and the transition to re-authentication must be smooth. I'd test both the security enforcement and the user experience.

Clarifying questions: What's the session duration (idle timeout vs. absolute timeout)? Is there token refresh? What triggers expiry — inactivity, absolute time, or both? What happens to in-progress work? Are there different policies for different security levels?

Risk analysis: Sessions that never expire are security vulnerabilities, abrupt expiry causes data loss, inconsistent expiry across tabs/devices confuses users, and expired tokens not properly rejected create authorization bypass.

Test design:

Idle Timeout:

  • Stay inactive for timeout duration → session expires, redirect to login
  • Activity resets the timer (click, scroll, type) → session extends
  • Activity in one tab → all tabs stay alive (shared session heartbeat)
  • Inactive for timeout-1 minute → activity → session continues normally
  • Warning shown 5 minutes before expiry ("Your session expires soon. Click to extend.")

Absolute Timeout:

  • Login → regardless of activity, session expires after absolute duration (e.g., 8 hours)
  • Verify absolute timeout cannot be extended by activity (security policy for sensitive apps)
  • Banking context: 15-minute absolute timeout regardless of clicks

Token Refresh:

  • Access token expires → refresh token silently obtains new access token (no user disruption)
  • Refresh token expires → user must re-authenticate
  • API call with expired access token during refresh → queued and retried after refresh
  • Refresh token stolen → rotation mechanism invalidates old refresh token

Graceful Expiration UX:

  • Session expires during form entry → work saved locally, restored after re-login
  • Session expires during file upload → upload paused, resumed after re-login (or lost gracefully)
  • Session expires with unsaved changes → prompt to save before redirect
  • Warning modal: "Extend session" button works, "Log out" button works
  • Warning modal countdown timer accurate

API-level Enforcement:

  • Expired session token sent to API → 401 Unauthorized (not 500 or success)
  • All API endpoints check session validity (no unprotected endpoints)
  • Expired token cannot access any resource (test multiple endpoints)
  • Tampered token (modified payload) → rejected immediately

Multi-tab / Multi-device:

  • Login on two tabs → expire session → both tabs redirect to login
  • Login on browser + mobile → expire on server → both clients detect and redirect
  • Logout in one tab → all tabs redirect to login (session invalidation propagation)
  • Browser stores expired token in cookie → verify server rejects on next request

Edge Cases:

  • System clock change → session expiry based on server time, not client time
  • Device sleeps (laptop lid close) for hours → wake up → session expired gracefully
  • Slow network: session expires, user clicks button → loading then redirect (not infinite spinner)
  • Back button after session expiry → cannot access cached authenticated pages
  • Session expires during OAuth flow → restart flow cleanly"

Framework/Diagram

Session Lifecycle
┌─────────┐    ┌──────────┐    ┌──────────┐    ┌─────────┐
│  LOGIN  │───▶│  ACTIVE  │───▶│ WARNING  │───▶│ EXPIRED │
│         │    │          │    │ (5m left)│    │         │
└─────────┘    └──────────┘    └──────────┘    └─────────┘
                    │                │               │
              [activity resets   [extend →      [re-login
               idle timer]        ACTIVE]        required]

Token Refresh Flow:
  Access Token (15 min)  ──expires──▶  Refresh Token (7 days)
       │                                      │
  [API calls use this]              [Silently get new access token]
       │                                      │
  [If expired, queue request]       [If expired, force re-login]

Security Properties:
  ✓ Server-side session store (not just client token)
  ✓ Token cannot be extended by client manipulation
  ✓ Expired tokens rejected on ALL endpoints
  ✓ Session ID rotated after privilege escalation
  ✓ Secure cookie flags (HttpOnly, Secure, SameSite)

Worked Example

Scenario: Testing session management for a healthcare SaaS (strict security requirements)

Test Case ID Category Steps Expected Result
SESS-001 Idle timeout Leave app idle for 15 minutes Warning at 10 min, logout at 15 min
SESS-002 Warning extend Click "Stay logged in" on warning modal Session extended, timer resets
SESS-003 Absolute timeout Active for 8 hours continuously Forced logout regardless of activity
SESS-004 Data preservation Expire while editing patient note Draft saved locally, restored after re-login
SESS-005 Multi-tab Expire session, check 3 open tabs All 3 tabs redirect to login within 30s
SESS-006 API enforcement Send expired token to /api/patients 401 response, no data leaked

Common Mistakes to Avoid

  1. Only testing happy expiration — Test what happens to in-progress work and unsaved data
  2. Ignoring token refresh flows — Silent refresh is complex and often buggy
  3. Not testing multi-tab synchronization — Users have many tabs open
  4. Checking only client-side expiry — Server must independently enforce expiration
  5. Missing the device sleep scenario — Laptop lid close/open is a very common trigger

Follow-up Questions

  • "How would you test session fixation vulnerability?"
  • "What's the difference between sliding and absolute session timeout?"
  • "How would you test session behavior during a backend deployment?"
  • "How do you handle session expiry for WebSocket connections?"

Q22How would you test user permissions? #

Objective

Assess ability to test authorization (not authentication), role-based access control (RBAC), attribute-based access control (ABAC), and the principle of least privilege across UI and API layers.

Interview Answer

"Permissions testing ensures users can only access what they're authorized to. I'd test both that authorized users CAN access resources and that unauthorized users CANNOT — at both UI and API levels.

Clarifying questions: What permission model — RBAC, ABAC, or custom? What roles exist (admin, manager, member, viewer)? Can permissions be customized per resource? Are permissions inherited (org → team → project)? Is there a super-admin/bypass role?

Risk analysis: Unauthorized data access (data breach), privilege escalation (user gains admin), horizontal privilege violation (user A accesses user B's data), and UI-only restrictions without API enforcement (bypassable).

Test design:

Role-Based Access (Vertical):

  • Admin role → can access all features (user management, billing, settings)
  • Member role → cannot access admin features (menu items hidden + API returns 403)
  • Viewer role → can read but not write/edit/delete
  • Each role tested against every feature → permission matrix verified
  • New feature added → verify it's restricted to appropriate roles by default

Horizontal Access Control:

  • User A accesses their own data → success
  • User A modifies API request to access User B's data → 403 (not 404 — debatable)
  • User A's list endpoint only returns their own resources (no data from other users)
  • Shared resource: User A shares with User B → B can access; User C cannot

UI vs. API Enforcement:

  • Restricted feature: button hidden in UI → also returns 403 from API
  • Verify you cannot bypass UI restrictions by calling the API directly
  • Test with curl/Postman using the user's token against restricted endpoints
  • Disabled buttons in UI → verify the action is also server-side rejected

Permission Changes (Dynamic):

  • Admin removes user's permission → immediate effect (next request rejected)
  • User upgraded from Member to Admin → new features available immediately
  • Permission revoked while user is actively using feature → current session behavior
  • Team membership removed → all team resources inaccessible

Inheritance & Hierarchy:

  • Org admin → automatically has admin on all teams within org
  • Team permission doesn't grant org-level access
  • Project-level permission overrides team-level (if applicable)
  • Removing parent permission cascades to children

Permission Boundaries:

  • Viewer can't delete resources (UI hides button AND API rejects)
  • Member can't invite users (if that's admin-only)
  • User can't elevate their own permissions (even through API)
  • Non-owner can't transfer ownership
  • Deactivated user's token immediately rejected

Edge Cases:

  • User with multiple roles → effective permission is union (or most permissive)
  • Last admin leaves team → system prevents removal (at least one admin required)
  • User's role changed while they have pending actions → actions validated at execution time
  • Permission for resource that doesn't exist → 404 (not 403, avoid revealing existence)
  • Concurrent permission check: permission revoked at same millisecond as API call → consistent result

Automation Strategy:

  • Build permission matrix test: iterate all roles × all endpoints × all methods
  • Run as integration tests: create users with each role, attempt all actions
  • Flag any endpoint without authorization check (security audit tool)"

Framework/Diagram

Permission Testing Matrix (RBAC)
┌───────────────────┬───────┬─────────┬────────┬────────┐
│    Action         │ Admin │ Manager │ Member │ Viewer │
├───────────────────┼───────┼─────────┼────────┼────────┤
│ View dashboard    │  ✓    │    ✓    │   ✓    │   ✓    │
│ Create content    │  ✓    │    ✓    │   ✓    │   ✗    │
│ Edit own content  │  ✓    │    ✓    │   ✓    │   ✗    │
│ Edit any content  │  ✓    │    ✓    │   ✗    │   ✗    │
│ Delete content    │  ✓    │    ✓    │   ✗    │   ✗    │
│ Manage members    │  ✓    │    ✗    │   ✗    │   ✗    │
│ Billing settings  │  ✓    │    ✗    │   ✗    │   ✗    │
│ Delete org        │  ✓    │    ✗    │   ✗    │   ✗    │
└───────────────────┴───────┴─────────┴────────┴────────┘

Enforcement Layers:
  Layer 1: UI (hide/disable elements)     → Can be bypassed
  Layer 2: API middleware (check token)   → Must enforce
  Layer 3: Database (row-level security)  → Defense in depth
  
  Test at ALL layers, not just UI!

Worked Example

Scenario: Testing permissions for a project management tool (Jira-like)

Test Case ID Category Steps Expected Result
PERM-001 RBAC Login as Viewer, attempt to create task Create button hidden + API returns 403
PERM-002 Horizontal Login as User A, call GET /projects/userB-project 403 Forbidden (not 200 or 404)
PERM-003 Privilege escalation Member calls PUT /users/self with role="admin" 403, role unchanged
PERM-004 Dynamic change Admin demotes User from Member to Viewer User's next action returns 403, UI updates
PERM-005 Inheritance Remove user from Team → check project access All team projects inaccessible
PERM-006 Last admin Only admin tries to leave/be removed Blocked: "Team must have at least one admin"

Common Mistakes to Avoid

  1. Testing only UI restrictions — The real security is at the API level; always test with direct API calls
  2. Only testing "can't access" — Also verify authorized users CAN access (regression in both directions)
  3. Ignoring horizontal access — User A accessing User B's data is as bad as privilege escalation
  4. Not testing permission changes in real-time — Revoked permissions must be effective immediately
  5. Missing the self-escalation test — Users should never be able to grant themselves higher permissions

Follow-up Questions

  • "How would you automate permission testing across 50+ API endpoints?"
  • "How would you test ABAC (attribute-based) where permissions depend on context?"
  • "What's the difference between 403 and 404 for unauthorized resource access?"
  • "How would you test permissions for shared/collaborative resources?"

Q23How would you test a feature flag? #

Objective

Demonstrate understanding of feature flag lifecycle, testing flag states independently, gradual rollouts, and the complexity of flag-dependent interactions.

Interview Answer

"Feature flags add a dimension to testing — every feature now has multiple states, and the flag system itself needs testing. I'd approach this by testing the flag mechanism, each feature state, and the transitions between states.

Clarifying questions: What flag system is used (LaunchDarkly, Split, custom)? What targeting rules — percentage, user segment, geography? Kill switch capabilities? How are flags managed (dashboard, config file, API)? What's the flag cleanup strategy?

Risk analysis: Flag misconfiguration exposing unfinished features, flags creating inconsistent state for users, stale flags accumulating technical debt, flag-dependent code paths untested, and flag evaluation performance impact.

Test design:

Basic Flag States:

  • Flag ON → feature visible and functional
  • Flag OFF → feature hidden, no traces in UI, no API endpoints exposed
  • Flag default (no explicit value) → falls back to defined default (usually OFF)
  • Flag deleted from system → code uses hardcoded default, no crash

Targeting Rules:

  • Flag ON for 10% of users → verify approximately 10% see it (statistical test)
  • Flag ON for specific user segment (beta users) → beta users see it, others don't
  • Flag ON for geographic region (US only) → US users see it, EU users don't
  • Flag ON for specific user IDs → only those IDs affected
  • User moves between segments → flag state updates accordingly

Rollout Progression:

  • 1% → verify no errors/crashes at scale
  • 10% → monitor error rates, verify feature works
  • 50% → load test at half capacity
  • 100% → full rollout, final verification
  • At each stage: performance metrics, error rates, user feedback

Kill Switch (Emergency OFF):

  • Feature causing errors → toggle flag OFF → feature immediately disappears
  • Verify kill switch takes effect within seconds (not cached for hours)
  • Verify users mid-flow when flag toggles → graceful handling (not crash)
  • After kill switch: verify no partial state left (e.g., half-processed data)

Flag Interactions:

  • Flag A and Flag B both ON → test combined behavior (feature interactions)
  • Flag A ON, dependency Flag B OFF → verify graceful fallback
  • Multiple flags controlling same feature (override logic) → priority defined and tested
  • Flag controlling flag evaluation (meta-flags) → tested at all levels

Code Path Testing:

  • Verify both code paths (flag ON and OFF) have test coverage
  • No dead code when flag is permanently ON (cleanup verification)
  • Flag evaluation doesn't cause performance issues (evaluated per request? cached?)
  • Flag evaluation failures (service down) → fallback to safe default

Consistency:

  • Same user always sees same flag state within a session (sticky bucketing)
  • Flag state doesn't change mid-flow (e.g., start checkout with new UI, finish with new UI)
  • Logged out → logged in: flag state transfers correctly
  • Multiple devices: flag state consistent for same user

Testing Approach:

  • Unit tests: force flag value, test both code paths
  • Integration tests: test with real flag service, verify targeting
  • Staging environment mirrors production flag configuration
  • Monitor: flag evaluation metrics, error rates per flag state"

Framework/Diagram

Feature Flag Testing Matrix
┌────────────────────────────────────────────────────┐
│ Flag States to Test                                 │
├────────────┬───────────────────────────────────────┤
│ ON         │ Feature works correctly, no regression │
│ OFF        │ Feature invisible, no side effects     │
│ Partial    │ % rollout works, targeting correct     │
│ Transition │ ON→OFF and OFF→ON mid-session safe     │
│ Default    │ Service down → safe fallback value     │
│ Interaction│ Multiple flags combined states         │
└────────────┴───────────────────────────────────────┘

Rollout Testing Flow:
  ┌──────┐    ┌──────┐    ┌──────┐    ┌──────┐    ┌──────┐
  │  1%  │───▶│ 10%  │───▶│ 50%  │───▶│ 100% │───▶│Remove│
  │canary│    │early │    │wide  │    │full  │    │flag  │
  └──┬───┘    └──┬───┘    └──┬───┘    └──┬───┘    └──┬───┘
     │           │           │           │           │
  Monitor     Monitor     Load test   Final QA    Code cleanup
  errors      metrics     at 50%     sign-off    (remove flag)

Flag Lifecycle:
  Created → Targeting Set → Tested → Rolled Out → Permanent → Removed

Worked Example

Scenario: Testing a "New Checkout" feature flag rollout

Test Case ID Flag State Steps Expected Result
FLAG-001 ON (100%) Complete checkout flow New checkout UI, all functionality works
FLAG-002 OFF Navigate to checkout Old checkout UI, no traces of new design
FLAG-003 50% rollout 100 test users go to checkout ~50 see new, ~50 see old (±10% variance OK)
FLAG-004 Kill switch Toggle OFF during active session Graceful return to old UI, no data loss
FLAG-005 Targeting Flag ON for "beta" segment only Beta user sees new, regular user sees old
FLAG-006 Service down Flag service unreachable Fallback to OFF (safe default), no crash

Common Mistakes to Avoid

  1. Only testing the "ON" state — The "OFF" state and transitions need equal coverage
  2. Ignoring flag cleanup — Stale flags create maintenance burden and confusing test matrices
  3. Not testing the kill switch — This is the safety net; it must work instantly
  4. Missing flag interaction testing — Multiple flags can create unexpected combined states
  5. Assuming flags are instant — Caching can delay flag changes; verify propagation time

Follow-up Questions

  • "How would you manage technical debt from accumulating feature flags?"
  • "How would you test a feature flag that controls a database migration?"
  • "What's your approach to testing flag-dependent A/B experiments?"
  • "How would you verify flag targeting rules are working correctly at scale?"

Q24How would you test a dark-mode UI? #

Objective

Evaluate understanding of theming, visual consistency, contrast requirements, dynamic switching, and platform-specific dark mode implementations.

Interview Answer

"Dark mode is more than inverting colors — it requires careful testing of contrast ratios, image handling, dynamic switching, and platform integration. A bad dark mode is worse than no dark mode at all. I'd test visual correctness, accessibility compliance, and transition behavior.

Clarifying questions: Is dark mode system-controlled, app-controlled, or both? Does it follow system preference automatically? Are all screens supported? What about emails, PDFs, and third-party components? OLED optimization (true black)?

Risk analysis: Unreadable text (white on light gray), invisible UI elements, images with transparent backgrounds looking wrong, inconsistent theming across screens, and accessibility failures (contrast below 4.5:1).

Test design:

Visual Correctness (Every Screen):

  • All text readable against dark background (no white-on-light-gray)
  • All icons visible (colored icons may disappear on dark backgrounds)
  • All interactive elements distinguishable (buttons, links, inputs)
  • Status indicators still meaningful (red/green/yellow on dark background)
  • Shadows and elevation still visible (different approach needed in dark mode)
  • Brand colors adapted (pure brand colors may need dark-mode variants)

Contrast & Accessibility:

  • Body text: minimum 4.5:1 contrast ratio (WCAG AA)
  • Large text: minimum 3:1 contrast ratio
  • Interactive elements: minimum 3:1 against adjacent colors
  • Use automated tools (axe-core, Colour Contrast Analyzer) across all screens
  • Disabled states still distinguishable from enabled
  • Focus indicators visible in dark mode (not just a light glow)

Images & Media:

  • Images with transparent backgrounds → verify against dark background (no invisible logos)
  • User-uploaded images → appropriate container/border treatment
  • App icons and illustrations → dark-mode variants if needed
  • Charts and graphs → colors adjusted for dark backgrounds
  • Maps → dark mode map tiles used (Google Maps/Mapbox dark style)
  • QR codes → still scannable on dark background

Dynamic Switching:

  • Toggle dark/light mode → all elements update immediately (no stale colors)
  • Switch mode mid-scroll → no flash of wrong theme
  • Switch mode with modal/dialog open → dialog also updates
  • Switch via system settings (iOS/Android) → app follows immediately
  • No page reload required on web (CSS custom properties or class toggle)

System Integration:

  • iOS: Follows UIUserInterfaceStyle, respects system toggle
  • Android: Follows AppCompatDelegate night mode, respects system toggle
  • Web: Respects prefers-color-scheme media query
  • Schedule: "Dark mode at sunset" → triggers at correct time
  • Per-app override: user sets dark in app but light in system → app preference wins

Component-Level Testing:

  • Forms: input fields, borders, placeholder text visible
  • Tables: row striping visible, header distinguishable
  • Modals/dialogs: proper backdrop, content readable
  • Toast/snackbar messages: visible against dark background
  • Loading states (skeletons, spinners): visible and aesthetic
  • Third-party components (payment forms, embedded content): theming applied or isolated

Edge Cases:

  • PDF/document viewer in dark mode → content readable (most PDFs are white)
  • Email templates → typically light (email clients control rendering)
  • Print mode from dark mode → prints with light theme (not dark backgrounds)
  • Screenshot/screen recording → dark mode appearance captured correctly
  • Shared links from dark mode user → recipient sees their own preference
  • OLED screens: true black (#000000) vs. dark gray (#121212) for burn-in prevention"

Framework/Diagram

Dark Mode Testing Checklist
┌─────────────────────────────────────────────────────┐
│ Visual Layer                                         │
│ ☐ All text readable (no white-on-light-gray)        │
│ ☐ Icons visible (check SVGs with currentColor)      │
│ ☐ Images with transparency handled                  │
│ ☐ Shadows replaced with borders/elevation           │
│ ☐ Brand colors adapted for dark surfaces            │
├─────────────────────────────────────────────────────┤
│ Accessibility Layer                                  │
│ ☐ Text contrast ≥ 4.5:1 (WCAG AA)                  │
│ ☐ Interactive element contrast ≥ 3:1                │
│ ☐ Focus indicators visible                          │
│ ☐ Color not sole indicator of state                 │
├─────────────────────────────────────────────────────┤
│ Behavioral Layer                                     │
│ ☐ System preference respected                       │
│ ☐ Toggle is immediate (no flash/reload)             │
│ ☐ Sticky preference (remembers across sessions)     │
│ ☐ All screens/modals/components themed              │
│ ☐ Third-party content handled gracefully            │
├─────────────────────────────────────────────────────┤
│ Platform Layer                                       │
│ ☐ iOS: UIUserInterfaceStyle support                 │
│ ☐ Android: Night mode + force-dark handling         │
│ ☐ Web: prefers-color-scheme + manual toggle         │
│ ☐ OLED: true black optimization (optional)          │
└─────────────────────────────────────────────────────┘

Worked Example

Scenario: Testing dark mode for a productivity SaaS (Notion-like)

Test Case ID Category Steps Expected Result
DARK-001 Visual Navigate all main screens in dark mode All text readable, no invisible elements
DARK-002 Contrast Run automated contrast check on dark mode All elements pass WCAG AA (4.5:1 text, 3:1 UI)
DARK-003 Switching Toggle system dark mode while app is open App theme updates instantly, no flash
DARK-004 Images View page with transparent PNG logo Logo has background or border, visible
DARK-005 Third-party Open embedded Google Map in dark mode Map uses dark tiles, readable
DARK-006 Persistence Set dark mode, close app, reopen Dark mode still active (preference saved)

Common Mistakes to Avoid

  1. Only checking the home screen — Every screen, modal, and component needs dark mode coverage
  2. Ignoring contrast ratios — "It looks fine to me" isn't sufficient; measure scientifically
  3. Forgetting transparent images — Logos and icons with transparency break on dark backgrounds
  4. Not testing the transition — Users toggle frequently; the switch must be instant and complete
  5. Missing third-party components — Payment forms, embedded maps, and iframes may not respect your theme

Follow-up Questions

  • "How would you automate dark mode visual regression testing?"
  • "How would you handle dark mode for email templates that your app sends?"
  • "What's the difference between OLED-optimized dark and standard dark mode?"
  • "How would you test dark mode performance impact (battery savings claims)?"

Q25How would you test a responsive layout? #

Objective

Demonstrate systematic approach to testing layouts across viewport sizes, understanding of breakpoints, and awareness of real-world responsive design challenges.

Interview Answer

"Responsive layout testing goes beyond resizing a browser window. I'd test at defined breakpoints, between breakpoints, with real content, and on actual devices — because responsive behavior involves touch targets, scrolling behavior, and performance differences that browser DevTools don't fully replicate.

Clarifying questions: What are the design breakpoints? What's the minimum supported width? Are there specific devices in the target market (tablets, foldables)? Is it fluid or adaptive layout? What about landscape orientation on mobile?

Risk analysis: Content overflow or truncation, overlapping elements, tiny touch targets on mobile, invisible elements pushed off-screen, and performance degradation from loading desktop assets on mobile.

Test design:

Breakpoint Testing:

  • Test at each defined breakpoint (e.g., 320px, 768px, 1024px, 1440px, 1920px)
  • Test at 1px below each breakpoint (767px) → previous layout style
  • Test at 1px above each breakpoint (769px) → next layout style
  • Verify transitions between breakpoints are smooth (no jump/flash)

Content Behavior:

  • Long text → wraps or truncates with ellipsis (not overflow hidden without indicator)
  • Long words/URLs → break-word applied (not breaking layout)
  • Dynamic content: card with 3 lines vs. 30 lines → layout handles both
  • Empty states → appropriate messaging at all sizes
  • Tables on mobile → horizontal scroll, or responsive restructuring

Navigation:

  • Desktop: full navigation bar visible
  • Mobile: hamburger menu, correct animation, all items accessible
  • Tablet: may use a different navigation pattern (sidebar + content)
  • Menu items with long text → handled at all widths
  • Navigation accessible by keyboard at all breakpoints

Touch Targets (Mobile):

  • All interactive elements minimum 44x44px on touch devices
  • Spacing between touch targets sufficient to prevent mis-taps
  • Hover-dependent interactions have touch alternatives
  • Dropdown/select elements large enough on mobile

Images & Media:

  • Images scale proportionally (no distortion)
  • High-DPI (retina) images served for appropriate screens
  • Large images don't block page load on mobile (lazy loading)
  • Videos resize proportionally, controls usable on small screens
  • Background images positioned correctly at all widths

Forms:

  • Form fields full-width on mobile (not tiny input boxes)
  • Labels above inputs on mobile (not inline if they don't fit)
  • Virtual keyboard doesn't obscure active input (scroll into view)
  • Form validation messages visible at all sizes
  • Multi-column forms collapse to single column on mobile

Orientation:

  • Portrait to landscape rotation → layout adapts immediately
  • Content doesn't disappear or overlap after rotation
  • Fixed elements (headers, footers) reposition correctly
  • Form in progress → data preserved through rotation

Real-World Scenarios:

  • Split-screen mode (iPad, Android multi-window) → layout handles half-width
  • Foldable devices (Samsung Fold) → inner/outer display transitions
  • Browser zoom (200%) → layout remains usable (accessibility requirement)
  • System font size increased (accessibility) → no text overflow or overlap"

Framework/Diagram

Responsive Testing Grid
┌──────────┬──────────┬───────────┬───────────┬──────────┐
│ 320px    │ 768px    │ 1024px    │ 1440px    │ 1920px   │
│ Mobile S │ Tablet   │ Tablet L  │ Desktop   │ Desktop L│
├──────────┼──────────┼───────────┼───────────┼──────────┤
│ 1 column │ 2 column │ 2-3 col   │ Full nav  │ Max-width│
│ Hamburger│ Tab bar  │ Sidebar   │ Sidebar   │ centered │
│ Stacked  │ Grid     │ Grid      │ Grid      │ Grid     │
│ cards    │ 2-col    │ 3-col     │ 4-col     │ 4-col    │
└──────────┴──────────┴───────────┴───────────┴──────────┘

Test Between Breakpoints:
  320|---test---|767|BP|769|---test---|1023|BP|1025|---test---|1439

Automated Verification:
  - Percy/Applitools: Screenshot at each breakpoint
  - axe-core: Accessibility at each breakpoint
  - Lighthouse: Performance at each breakpoint (mobile especially)
  - Custom: Touch target size verification

Worked Example

Scenario: Testing responsive design for a news website

Test Case ID Viewport Element Expected Behavior
RESP-001 320px (iPhone SE) Article grid Single column, full-width cards
RESP-002 768px (iPad) Navigation Condensed nav with key items + "More" menu
RESP-003 375px Long headline (80 chars) Wraps to 3 lines, no truncation of meaning
RESP-004 1024px Sidebar + content Two-column layout, sidebar doesn't overlap
RESP-005 320px → rotate → 568px Article page Layout adapts, reading position preserved
RESP-006 200% browser zoom All pages Layout usable, no overflow, content accessible

Common Mistakes to Avoid

  1. Only testing at exact breakpoints — Bugs often appear between breakpoints at unusual widths
  2. Using only browser DevTools — Real devices have different touch behavior, scrolling, and performance
  3. Ignoring content length variation — Layouts break with real content (long names, empty states)
  4. Forgetting about zoom/font scaling — WCAG requires usability at 200% zoom
  5. Not testing orientation changes — Many apps only work in one orientation, which is a poor experience

Follow-up Questions

  • "How would you automate responsive layout testing in CI?"
  • "How do you test responsive email templates?"
  • "What's your approach to testing CSS container queries vs. media queries?"
  • "How would you test responsive behavior for a data-heavy dashboard?"

Q26How would you test a real-time dashboard? #

Objective

Assess ability to test live data systems including WebSocket connections, data freshness, visualization accuracy, and performance under high-throughput updates.

Interview Answer

"Real-time dashboards combine data accuracy, visualization correctness, WebSocket reliability, and performance under continuous updates. I'd test data integrity, update mechanisms, and behavior under stress.

Clarifying questions: What refresh mechanism — WebSocket, SSE, polling? What's the expected update frequency? What data visualizations — charts, tables, maps, gauges? How many concurrent viewers? Is there historical comparison?

Risk analysis: Stale data displayed as current (dangerous for monitoring), memory leaks from continuous updates, chart rendering lag under high throughput, WebSocket disconnection going unnoticed, and data inconsistency between dashboard and source.

Test design:

Data Accuracy:

  • Dashboard value matches source database/API query (cross-verify)
  • Aggregations (sum, average, count) are mathematically correct
  • Time-series data points match actual events (no missing data)
  • Percentages sum to 100% (or explained if they don't due to rounding)
  • Currency/number formatting correct (commas, decimals, locale)

Real-time Updates:

  • New event in system → dashboard updates within SLA (e.g., < 2 seconds)
  • Counter increments → dashboard reflects new count
  • Status change (e.g., server goes down) → indicator changes color immediately
  • Multiple rapid updates → final state is correct (not out-of-date intermediate state)
  • Timestamp on dashboard shows "Last updated: X seconds ago" and is accurate

Connection Management:

  • WebSocket connects on page load, stays connected during idle
  • WebSocket disconnects → visual indicator ("Reconnecting..."), auto-retry
  • Reconnect after 30 seconds of disconnection → data catches up (no gap)
  • Network change (WiFi → cellular) → reconnection handled gracefully
  • Server restart → all connected clients reconnect seamlessly

Performance Under Load:

  • 100 updates per second → UI remains responsive (no frame drops)
  • 1000 data points rendered on chart → smooth scrolling and interaction
  • Dashboard open for 8 hours → no memory leak (heap stays stable)
  • 500 concurrent viewers → server handles all WebSocket connections
  • Large initial data load → progressive rendering (not blank screen for 10 seconds)

Visualization Correctness:

  • Line chart: data points at correct x/y positions
  • Bar chart: bar heights proportional to values
  • Pie chart: slices proportional, labels readable
  • Gauge: needle position corresponds to actual value
  • Map: markers at correct geo-coordinates
  • Tooltips show correct data on hover

Filtering & Interaction:

  • Apply time range filter → data and charts update correctly
  • Drill down from summary → detailed view shows matching data
  • Change aggregation (hourly → daily) → values recalculated correctly
  • Export current view → exported data matches displayed data
  • Bookmark/share dashboard state → recipient sees same view

Edge Cases:

  • Zero data scenario → appropriate "No data" message, charts handle gracefully
  • Extreme values (0, negative, very large) → visualizations handle without distortion
  • Missing data points → gap in chart or interpolation (defined behavior)
  • Browser tab in background → updates resume or catch up on tab focus
  • Dashboard with 50+ widgets → all load without blocking each other"

Framework/Diagram

Real-time Dashboard Test Architecture
┌─────────────┐     ┌─────────────┐     ┌──────────────┐
│ Data Source │────▶│ Server/API  │────▶│ WebSocket/   │
│ (DB/Events) │     │ (Aggregate) │     │ SSE/Poll     │
└─────────────┘     └─────────────┘     └──────┬───────┘
                                                │
                         ┌──────────────────────┘
                         ▼
                ┌─────────────────┐
                │   Dashboard UI  │
                │ ┌─────┐ ┌─────┐│
                │ │Chart│ │Table││
                │ └─────┘ └─────┘│
                │ ┌─────┐ ┌─────┐│
                │ │Gauge│ │Map  ││
                │ └─────┘ └─────┘│
                └─────────────────┘

Test Points:
  A. Data Source → Server: Aggregation correctness
  B. Server → Client: Update delivery latency
  C. Client rendering: Visualization accuracy
  D. Connection: Resilience and reconnection
  E. Performance: Memory, CPU, frame rate over time

Worked Example

Scenario: Testing a monitoring dashboard (Datadog-like)

Test Case ID Category Steps Expected Result
DASH-001 Accuracy Generate 100 errors in service → check error count widget Widget shows 100 (±1 for timing)
DASH-002 Latency Create event in system, start timer Dashboard updates within 2 seconds
DASH-003 Reconnection Disconnect network for 30s, reconnect "Reconnecting" shown, data catches up after reconnect
DASH-004 Performance Leave dashboard open 8 hours with continuous updates Memory usage stable (no growth beyond 50MB)
DASH-005 Visualization Chart shows 1000 data points over 24h Points plotted at correct positions, interactive tooltips work
DASH-006 Load 500 users viewing same dashboard simultaneously All receive updates, server CPU < 80%

Common Mistakes to Avoid

  1. Trusting the dashboard without verifying against source — Always cross-check with raw data
  2. Not testing long-duration sessions — Memory leaks only appear after hours of continuous updates
  3. Ignoring reconnection scenarios — Network blips are common; dashboard must recover
  4. Only testing with small datasets — Performance degrades with large amounts of data
  5. Missing the "stale data" indicator — Users must know if they're looking at outdated information

Follow-up Questions

  • "How would you test dashboard accuracy during data pipeline failures?"
  • "How would you performance test a dashboard with 100+ concurrent viewers?"
  • "What's your approach to testing chart rendering correctness automatically?"
  • "How would you test dashboard behavior during a deployment (brief downtime)?"

Q27How would you test an attachment preview? #

Objective

Evaluate ability to test file handling, rendering pipelines, security concerns with user-uploaded content, and cross-platform display consistency.

Interview Answer

"Attachment previews involve rendering diverse file types securely in the browser or app. The challenge is supporting many formats while preventing security vulnerabilities from malicious files and ensuring performance with large files.

Clarifying questions: What file types are supported for preview (images, PDFs, documents, spreadsheets, videos, audio)? Is preview generated server-side or client-side? Maximum file size for preview? Is there a download fallback for unsupported types?

Risk analysis: Malicious files exploiting preview renderer, memory exhaustion from large files, incorrect rendering misleading users, missing previews for supported types, and slow generation blocking the UI.

Test design:

Supported Format Verification:

  • JPEG, PNG, GIF, WebP, SVG → image preview renders correctly
  • PDF (1 page, 100 pages) → preview renders, pagination works
  • DOCX, XLSX, PPTX → converted preview or native preview
  • MP4, WebM → video player with playback controls
  • MP3, WAV → audio player with waveform/progress
  • ZIP, EXE, unknown → no preview, clear "Download to view" fallback
  • Each format tested with variety of valid files (different sizes, dimensions)

Image Preview:

  • Small image (100x100px) → displayed at actual size or minimum size
  • Large image (8000x8000px) → resized/compressed for preview, no memory crash
  • Animated GIF → plays animation, reasonable file size
  • EXIF orientation → image displayed right-side-up regardless of EXIF rotation
  • Transparent PNG → rendered with appropriate background (checkerboard or solid)

Document Preview:

  • PDF with forms → displays content (forms may not be interactive)
  • Password-protected PDF → message "Enter password" or "Cannot preview"
  • 500-page PDF → first pages load quickly, lazy loading for rest
  • Spreadsheet with 100 columns → horizontal scrolling or responsive display
  • Document with embedded images → images render in preview

Performance:

  • Preview generates within 3 seconds for typical files (< 10MB)
  • Large file (100MB PDF) → progress indicator while generating
  • Multiple attachments → previews load in parallel, don't block each other
  • Preview doesn't re-generate on every view (caching)
  • Memory usage stable even with large file preview (streaming, not loading all in memory)

Security:

  • SVG with embedded JavaScript → script not executed in preview context
  • PDF with embedded scripts → sandboxed rendering
  • Filename with XSS payload → filename displayed safely (escaped)
  • Server-side preview generation in sandbox (isolated from main application)
  • Virus-infected file → blocked before preview generation
  • Path traversal in filename (../../etc/passwd) → sanitized

Error Handling:

  • Corrupted file → "Unable to generate preview" message with download option
  • Unsupported format → clear indication + download button
  • Preview generation timeout → graceful failure with retry option
  • Network error loading preview → retry button, cached if previously loaded
  • Zero-byte file → appropriate "Empty file" message

Accessibility:

  • Image previews have alt text (filename or user-provided description)
  • Document preview text is selectable/copyable
  • Preview controls (zoom, page navigation) keyboard accessible
  • Screen reader announces file type and name for unsupported previews

Platform-specific:

  • iOS: Quick Look framework for native file preview
  • Android: Intent-based preview or in-app WebView rendering
  • Web: PDF.js for PDFs, native <img> for images, <video> for videos
  • Mobile: pinch-to-zoom on image/document previews"

Framework/Diagram

Attachment Preview Pipeline
┌──────────────┐    ┌──────────────┐    ┌──────────────┐
│   Upload     │───▶│  Processing  │───▶│   Preview    │
│   (file)     │    │  (server)    │    │   (client)   │
└──────────────┘    └──────────────┘    └──────────────┘
     │                    │                    │
  Validate           Generate              Render
  - Type check       - Thumbnail           - Lazy load
  - Size check       - PDF render          - Zoom/pan
  - Virus scan       - Video transcode     - Pagination
  - Sanitize name    - Cache preview       - Accessibility

Supported Formats Matrix:
┌──────────────┬──────────┬────────────┬──────────────┐
│ Format       │ Preview  │ Inline     │ Max Size     │
├──────────────┼──────────┼────────────┼──────────────┤
│ JPEG/PNG/GIF │ Image    │ Yes        │ 25MB         │
│ SVG          │ Image*   │ Sandboxed  │ 5MB          │
│ PDF          │ Document │ Yes        │ 100MB        │
│ DOCX/XLSX    │ Converted│ Yes        │ 50MB         │
│ MP4/WebM     │ Video    │ Yes        │ 500MB        │
│ ZIP/EXE      │ None     │ Download   │ 2GB          │
└──────────────┴──────────┴────────────┴──────────────┘
* SVG sandboxed to prevent XSS

Worked Example

Scenario: Testing attachment preview in a team collaboration tool (Slack-like)

Test Case ID File Type Test Expected Result
ATTACH-001 JPEG (5MB) Upload and view in chat Inline preview, click to expand, zoom works
ATTACH-002 PDF (50 pages) Upload and preview First page renders < 2s, pagination available
ATTACH-003 SVG with script Upload SVG containing <script>alert(1)</script> Renders image, script NOT executed
ATTACH-004 200MB video Upload and preview Progress indicator, then video player with controls
ATTACH-005 Corrupted DOCX Upload broken file "Unable to preview" with download fallback
ATTACH-006 Unknown (.xyz) Upload custom format No preview, file icon + "Download" button

Common Mistakes to Avoid

  1. Only testing with clean, small files — Real files are large, malformed, or potentially malicious
  2. Ignoring SVG security — SVGs can contain JavaScript and execute in browser context
  3. Not testing the fallback path — When preview fails, download option must work
  4. Forgetting about EXIF orientation — Photos from phones often have rotation metadata
  5. Missing performance testing — Preview generation for large files can block server resources

Follow-up Questions

  • "How would you test preview generation at scale (1000 files per minute)?"
  • "How would you handle preview for encrypted/DRM-protected files?"
  • "What's your approach to testing preview accuracy (does it look like the actual file)?"
  • "How would you test preview caching and invalidation?"

Q28How would you test a notification preference center? #

Objective

Test understanding of preference management, settings propagation, multi-channel coordination, and the interplay between user preferences and system behavior.

Interview Answer

"A notification preference center is the control panel for all user communications. It must accurately reflect current state, propagate changes to all delivery systems, and comply with regulatory requirements. I'd test preferences, propagation, and compliance.

Clarifying questions: What channels — push, email, SMS, in-app? What categories — marketing, transactional, security alerts? Can users set preferences per channel per category (granular matrix)? Are some notifications non-disableable (security)? Regulatory requirements (GDPR, CAN-SPAM)?

Risk analysis: Preferences not respected (user opted out but still receives), inconsistent state across channels, inability to unsubscribe (legal violation), and preferences reset on app update.

Test design:

Preference Display:

  • All notification categories shown with current state (on/off)
  • Current state matches actual backend preference (not cached stale state)
  • Categories organized logically (marketing, social, transactional, security)
  • Per-channel toggles visible (push, email, SMS separately controllable)
  • Master toggle "Disable all non-essential" works

Preference Changes:

  • Toggle category OFF → change persisted immediately (verify via API)
  • Toggle channel OFF for specific category → only that channel affected
  • Turn off push for "Marketing" → still receive marketing email (channel independence)
  • Turn off all channels for a category → no notifications of that type via any channel
  • Changes saved even if app crashes immediately after toggle

Propagation & Enforcement:

  • Disable email marketing → trigger marketing event → no email sent (verify mail server)
  • Disable push for social → receive social event → no push, but in-app notification shown
  • Re-enable preference → next event triggers notification (no longer suppressed)
  • Propagation time: preference change → effective within 30 seconds for all systems

Non-disableable Notifications:

  • Security alerts (suspicious login, password change) → cannot be turned off
  • Toggle is either hidden or disabled with explanation
  • Transactional (order confirmation, receipts) → cannot disable (legal requirement)
  • Verify these still deliver even when "Disable all" master toggle is on

Multi-device Consistency:

  • Change preference on phone → reflected on web when page loads
  • Change on web → phone respects immediately (next notification)
  • No conflict: simultaneous changes on two devices → last write wins, both show consistent final state

Email-specific:

  • Unsubscribe link in email → opens preference center with category pre-selected
  • One-click unsubscribe (RFC 8058 / List-Unsubscribe) → processes without login
  • Email preferences sync with preference center (not separate system)
  • Unsubscribe from email → preference center shows updated state

Regulatory Compliance:

  • GDPR: explicit consent required for marketing (opt-in, not opt-out)
  • CAN-SPAM: unsubscribe processed within 10 business days (usually immediate)
  • CCPA: "Do Not Sell" preference respected
  • Consent receipt stored: timestamp + what user agreed to + version of terms
  • Audit trail: all preference changes logged with timestamp

Edge Cases:

  • New notification category added → default state for existing users (opted in? opted out?)
  • User deletes account → all preferences removed, no further communications
  • Re-register with same email → preferences start fresh (not inherited)
  • Preference center during account lockout → still accessible (for unsubscribe)"

Framework/Diagram

Notification Preference Matrix
┌──────────────────┬──────┬───────┬─────┬────────┐
│ Category         │ Push │ Email │ SMS │ In-App │
├──────────────────┼──────┼───────┼─────┼────────┤
│ Marketing        │  ◻   │   ◻   │  ◻  │   ◻    │
│ Social (likes)   │  ☑   │   ◻   │  ◻  │   ☑    │
│ Messages         │  ☑   │   ☑   │  ◻  │   ☑    │
│ Order updates    │  ☑   │   ☑   │  ☑  │   ☑    │ (cannot disable)
│ Security alerts  │  ☑   │   ☑   │  ☑  │   ☑    │ (cannot disable)
└──────────────────┴──────┴───────┴─────┴────────┘
◻ = disabled by user  ☑ = enabled  🔒 = locked (non-disableable)

Propagation Flow:
  User toggles OFF ──▶ API saves ──▶ Notification service checks ──▶ Suppressed
                                            │
                                     Audit log entry
                                     Consent record updated

Worked Example

Scenario: Testing notification preferences for a social media app

Test Case ID Category Steps Expected Result
PREF-001 Display Open preference center All categories shown with correct current state
PREF-002 Propagation Disable push for "Likes" → trigger like event No push notification, in-app counter still updates
PREF-003 Non-disable Attempt to disable "Security Alerts" Toggle disabled/hidden, explanation shown
PREF-004 Email unsub Click unsubscribe in marketing email Marketing email turned off, preference center reflects
PREF-005 Multi-device Disable "Messages" push on phone, check web Web also shows Messages push as disabled
PREF-006 Compliance View consent record in admin panel Timestamp, version, and explicit consent recorded

Common Mistakes to Avoid

  1. Only testing the UI toggle — Verify that the preference is actually enforced (no notification sent)
  2. Forgetting non-disableable categories — Security and transactional notifications must always send
  3. Not testing the email unsubscribe link — This is legally required and often broken
  4. Ignoring propagation delay — Preference changes must be near-instant to all systems
  5. Missing compliance requirements — GDPR/CAN-SPAM violations carry significant fines

Follow-up Questions

  • "How would you test preference migration when notification categories change?"
  • "How would you verify that unsubscribe is working across all email systems?"
  • "What's your approach to testing preference center for users in different regulatory regions?"
  • "How would you handle preference conflicts (user disables, but system needs to send for compliance)?"

Q29How would you test deletion and retention? #

Objective

Evaluate understanding of data lifecycle management, soft vs. hard delete, retention policies, compliance requirements (GDPR right-to-erasure), and cascading deletion effects.

Interview Answer

"Deletion testing is more complex than it appears — data exists in multiple places (databases, caches, backups, search indexes, CDNs), and regulatory requirements demand different behaviors for different data types. I'd test both the user-facing deletion and the backend completeness.

Clarifying questions: Soft delete (reversible) or hard delete? What retention period before permanent deletion? Where does data exist (primary DB, replicas, search index, CDN, backups, logs)? What regulations apply (GDPR, CCPA, HIPAA)? What about shared data (messages sent to others)?

Risk analysis: Data persisting after user requests deletion (compliance violation), cascading deletes breaking related data, inability to recover from accidental deletion, and deletion not propagating to all data stores.

Test design:

User-initiated Deletion:

  • Delete a message → message disappears from sender's view
  • Delete a message → behavior for recipients (still visible? "Deleted message" placeholder?)
  • Delete all data (account deletion) → confirmation prompt with consequences explained
  • Undo period: within 30 seconds → undo successful, data restored
  • After undo period → data removed from view, enters retention period

Soft Delete & Recovery:

  • Deleted item moves to "Trash" / "Recently Deleted"
  • Item in trash still counts against storage? (product decision)
  • Recover from trash → item fully restored to original location
  • Trash auto-empties after retention period (e.g., 30 days)
  • Admin can recover items during retention period (support use case)

Hard Delete (Permanent):

  • After retention period → data permanently removed from primary database
  • Verify: direct database query returns no record (not just flagged)
  • Search index updated → deleted content not searchable
  • CDN cache purged → media files not accessible via direct URL
  • Backup retention: data exists in backups for X days (compliance documentation)

Cascading Effects:

  • Delete user → what happens to their content in shared spaces?
  • Delete conversation → all messages deleted? Or just membership removed?
  • Delete parent resource → child resources cascade deleted (with confirmation)
  • Delete file → all references/previews/thumbnails also cleaned up

GDPR Right to Erasure (Article 17):

  • User requests data deletion → processed within 30 days
  • Deletion scope: all personal data across all systems
  • Third-party data sharing: notify partners to delete (documented)
  • Exceptions: data required for legal obligation retained with justification
  • Deletion certificate/confirmation provided to user

Retention Policies:

  • Data type A retained for 7 years (financial regulations)
  • Data type B retained for 90 days (analytics)
  • Data type C deleted immediately on request (personal messages)
  • Automated enforcement: verify scheduled jobs actually delete on time
  • Retention policy displayed to users (transparency)

Multi-location Verification:

  • Primary database: record deleted ✓
  • Read replicas: propagation within replication lag window ✓
  • Elasticsearch/search index: removed from search results ✓
  • Redis/cache: evicted or invalidated ✓
  • CDN: purge sent, asset returns 404 ✓
  • Data warehouse: anonymized or deleted per retention ✓
  • Audit logs: maintain who deleted, but content redacted ✓

Edge Cases:

  • Delete data referenced by other users (tagged in photo, mentioned in comment)
  • Delete during ongoing export/download → export doesn't include deleted data
  • Delete data that's currently being processed by async job
  • Bulk delete (10,000 records) → completes without timeout, rate limited if needed
  • API-level delete vs. UI delete → same outcome"

Framework/Diagram

Data Deletion Lifecycle
┌──────────┐    ┌──────────┐    ┌──────────────┐    ┌──────────┐
│  ACTIVE  │───▶│  SOFT    │───▶│  RETENTION   │───▶│  PURGED  │
│  (live)  │    │  DELETED │    │  (30 days)   │    │(permanent)│
└──────────┘    └──────────┘    └──────────────┘    └──────────┘
     │               │                │                   │
  User sees      In "Trash"      Not visible         Removed from:
  normally       Recoverable     Not recoverable     - Primary DB
                 Admin access    by user              - Replicas
                 Still in DB     Admin can recover    - Search index
                                                     - CDN
                                                     - Cache

Multi-system Deletion Verification:
  ┌─────────────────────────────────────────────┐
  │ DELETE request received                      │
  ├─────────────────────────────────────────────┤
  │ ☐ Primary DB record removed/flagged         │
  │ ☐ Search index entry removed                │
  │ ☐ Cache keys invalidated                    │
  │ ☐ CDN assets purged                         │
  │ ☐ Media storage files deleted               │
  │ ☐ Data warehouse anonymized                 │
  │ ☐ Third-party notifications sent            │
  │ ☐ Audit log entry created (metadata only)   │
  └─────────────────────────────────────────────┘

Worked Example

Scenario: Testing deletion for a cloud storage app (Dropbox-like)

Test Case ID Category Steps Expected Result
DEL-001 Soft delete Delete file from folder File moves to Trash, recoverable
DEL-002 Recovery Recover file from Trash File restored to original folder with metadata
DEL-003 Auto-purge File in Trash for 31 days (retention = 30) File permanently deleted, not in DB
DEL-004 Multi-system Permanently delete image CDN returns 404, search doesn't find it, thumbnail gone
DEL-005 GDPR Request full account deletion All personal data purged within 30 days, confirmation sent
DEL-006 Cascading Delete shared folder All files inside deleted, collaborators notified, shares revoked

Common Mistakes to Avoid

  1. Testing only UI-level deletion — Data often persists in databases, caches, search indexes, and backups
  2. Ignoring shared data — When User A deletes their message, what does User B see?
  3. Not verifying automatic retention enforcement — Scheduled deletion jobs must actually run
  4. Forgetting about CDN and edge caches — Files can persist at edge locations after deletion
  5. Missing the compliance angle — GDPR right-to-erasure has legal timelines and documentation requirements

Follow-up Questions

  • "How would you verify deletion across all microservices in a distributed system?"
  • "How do you handle deletion of data that's in offline backups?"
  • "What's your approach to testing anonymization vs. deletion?"
  • "How would you test the 'right to be forgotten' for data shared with third-party integrations?"

Q30How would you test an accessibility regression? #

Objective

Assess comprehensive knowledge of accessibility testing — automated scanning, manual verification with assistive technology, and building accessibility into the CI/CD pipeline to prevent regressions.

Interview Answer

"Accessibility regression testing ensures that new changes don't break existing accessible experiences. Since about 15-20% of the global population has some form of disability, and legal requirements (ADA, EAA, WCAG) apply to most commercial software, this is both a moral and business imperative. I'd combine automated scanning with manual assistive technology testing and embed it into CI.

Clarifying questions: What WCAG level are we targeting (A, AA, AAA)? What assistive technologies do our users actually use? What's the current accessibility baseline (passing or already has known issues)? Is there an accessibility design system/component library?

Risk analysis: Regressions in keyboard navigation trap users, broken screen reader announcements make features invisible, insufficient contrast makes text unreadable, and missing labels make forms unusable — all of which can trigger legal action.

Test design:

Automated Scanning (CI Integration):

  • axe-core / axe DevTools on every PR → fail build on new violations
  • Lighthouse accessibility score tracked over time → alert on regression (drop > 5 points)
  • Pa11y CI for page-level automated accessibility checking
  • Custom rules for project-specific patterns (e.g., all modals must trap focus)
  • Scan all page states: empty, loading, error, populated, interactive

Keyboard Navigation:

  • Tab through entire page → all interactive elements reachable
  • Tab order follows visual/logical order (no random jumps)
  • Focus indicator visible on every focused element (high contrast outline)
  • No keyboard traps (can always Tab out of any component)
  • Modal/dialog: focus trapped inside while open, restored on close
  • Skip navigation link present and functional
  • Escape key closes modals/dropdowns/overlays

Screen Reader Testing:

  • VoiceOver (iOS/Mac) + TalkBack (Android) + NVDA/JAWS (Windows)
  • All images have appropriate alt text (decorative images have empty alt)
  • Form labels correctly associated with inputs (using for/id or aria-labelledby)
  • Error messages announced when they appear (aria-live or role="alert")
  • Dynamic content changes announced (new messages, notifications, loading states)
  • Headings hierarchy correct (H1 → H2 → H3, no skipped levels)
  • Buttons and links have descriptive accessible names (not "Click here" or "Button")
  • Tables have proper header cells (<th>) and scope attributes

Visual Accessibility:

  • Color contrast meets WCAG AA (4.5:1 for text, 3:1 for UI elements)
  • Color is not the only indicator (error fields have icons, not just red border)
  • Text resizable to 200% without loss of content or functionality
  • Content reflows at 320px width (responsive at high zoom)
  • Motion/animation can be disabled (prefers-reduced-motion respected)
  • High contrast mode (Windows) → content still usable

ARIA & Semantics:

  • Landmark regions defined (nav, main, header, footer, aside)
  • ARIA roles used correctly (not overriding native semantics unnecessarily)
  • aria-expanded, aria-selected, aria-pressed states correct and updating
  • Live regions (aria-live) announce dynamic content appropriately
  • Custom components (accordion, tabs, datepicker) follow WAI-ARIA patterns

Regression Scenarios:

  • New modal added → verify focus management (trap, restore)
  • New form field added → verify label association, error handling
  • UI redesign → re-verify contrast ratios, focus indicators
  • New interactive component → keyboard operable, screen reader compatible
  • Third-party component added → meets same accessibility standards

Platform-specific:

  • iOS: VoiceOver gestures work correctly, rotor navigation functional
  • iOS: Dynamic Type (system font scaling) supported
  • Android: TalkBack navigation, touch exploration, switch access
  • Android: System font size and display size scaling
  • Web: Works with browser zoom, text-only zoom, and OS-level zoom"

Framework/Diagram

Accessibility Testing Pyramid
            ┌──────────────────┐
            │   Manual with    │  Per Sprint
            │   Assistive Tech │  (VoiceOver, NVDA, TalkBack)
            │   + Real Users   │
           ┌┴──────────────────┴┐
           │  Semi-automated     │  Per Feature
           │  Keyboard nav audit │
           │  + Screen reader    │
           │  walkthrough        │
          ┌┴────────────────────┴┐
          │   Automated Scanning  │  Every PR
          │   axe-core, Pa11y    │  (CI/CD gate)
          │   Lighthouse a11y    │
          └───────────────────────┘

WCAG Regression Checklist (Per Component):
  ☐ Keyboard navigable (Tab, Enter, Escape, Arrow keys)
  ☐ Focus visible and logically ordered
  ☐ Screen reader announces role, name, value, state
  ☐ Color contrast meets AA (4.5:1 text, 3:1 UI)
  ☐ Color not sole differentiator
  ☐ Resizable to 200% without loss
  ☐ Motion reducible (prefers-reduced-motion)
  ☐ Labels and errors programmatically associated
  ☐ Dynamic changes announced (aria-live)
  ☐ No keyboard traps

Worked Example

Scenario: Accessibility regression testing after a major UI redesign

Test Case ID Category Steps Expected Result
A11Y-001 Automated Run axe-core on all pages post-redesign Zero new critical/serious violations
A11Y-002 Keyboard Tab through new checkout flow All fields reachable, logical order, visible focus
A11Y-003 Screen reader Navigate new dashboard with VoiceOver All widgets announced with name and value
A11Y-004 Contrast Check new color palette against WCAG All text passes 4.5:1, all UI elements pass 3:1
A11Y-005 Dynamic Trigger form error with screen reader active Error message announced immediately via aria-live
A11Y-006 Zoom Set browser zoom to 200%, use entire app No content hidden, all features functional

Common Mistakes to Avoid

  1. Relying solely on automated scanning — Automated tools catch ~30-40% of issues; manual testing is essential
  2. Testing only with keyboard — Keyboard alone doesn't verify screen reader announcements
  3. Checking accessibility once, not continuously — Accessibility regresses with every code change
  4. Ignoring dynamic content — Modals, live updates, and AJAX content need special ARIA handling
  5. Treating accessibility as a QA-only concern — It starts at design and development; QA verifies

Follow-up Questions

  • "How would you build an accessibility testing culture across the engineering team?"
  • "What's your approach to testing accessibility with actual users with disabilities?"
  • "How would you prioritize fixing existing accessibility issues vs. preventing new ones?"
  • "How would you test accessibility for a complex interactive component like a data grid?"

Chapter Summary #

Key Themes Across All 30 Questions

  1. The CROSS Framework applies to every scenario question: Clarify scope → identify Risks → Outline test categories → Specify concrete cases → Summarize with automation strategy.

  2. Multi-layer thinking is essential: UI testing alone is never sufficient. Every scenario requires testing at API level, database level, and across network conditions.

  3. Platform awareness differentiates senior candidates: Understanding iOS vs. Android vs. Web differences in lifecycle, permissions, storage, and user expectations.

  4. Security is always relevant: Whether testing a chat app or a dark mode toggle, senior engineers identify security implications (injection, access control, data exposure).

  5. Accessibility is non-negotiable: Every user-facing feature must be keyboard navigable, screen reader compatible, and meet contrast requirements.

  6. Performance degrades at scale: Features that work with 10 items break with 10,000. Senior engineers test at realistic scale.

Coverage Matrix by Question Category

Category Questions Key Skills Tested
Messaging & Real-time 2-6 State sync, offline handling, distributed systems
E-commerce & Payments 8-9 Financial accuracy, concurrency, compliance
Platform & Mobile 7, 10-12, 17-20 Platform APIs, lifecycle, fragmentation
Authentication & Security 1, 14-16, 21-22 Token management, attack prevention
Infrastructure & Config 23, 28-29 Feature flags, data lifecycle, preferences
UI & Accessibility 24-25, 27, 30 Visual testing, WCAG, assistive tech
Complex Flows 10-11, 13, 26 Multi-party coordination, real-time data

Interview Success Patterns

What distinguishes a senior answer:

  • Opens with clarifying questions (shows real-world experience)
  • Identifies 3-5 specific risk areas before diving into test cases
  • Provides concrete test cases with specific steps and expected results
  • Covers functional, security, performance, and accessibility dimensions
  • Mentions automation strategy and CI/CD integration
  • Acknowledges platform differences where relevant
  • Closes with what they'd monitor in production

What to avoid:

  • Generic answers ("I'd test positive and negative cases")
  • Only listing test categories without specific cases
  • Ignoring security or accessibility entirely
  • Not mentioning automation or CI/CD
  • Platform-agnostic answers for platform-specific questions
  • Not asking clarifying questions (assumes one-size-fits-all)

Quick Reference: Non-functional Testing Dimensions

Dimension What to Test Common Tools
Performance Response time, throughput, resource usage k6, Gatling, Lighthouse
Security Injection, auth bypass, data exposure OWASP ZAP, Burp Suite
Accessibility Keyboard, screen reader, contrast axe-core, VoiceOver, NVDA
Reliability Offline, reconnection, failover Charles Proxy, Toxiproxy
Scalability Concurrent users, large datasets Load testing tools
Compatibility Devices, browsers, OS versions BrowserStack, Device Farm

Preparing for Your Interview

  1. Practice the CROSS framework on each question until it's natural (< 30 seconds to set up)
  2. Memorize 3-5 concrete test cases per question type (specificity impresses)
  3. Have platform-specific examples ready — iOS/Android/Web differences show depth
  4. Know your tools — mention specific tools you've used (axe-core, k6, Charles Proxy)
  5. Connect testing to business impact — "This test prevents revenue loss because..."
  6. Practice timing — Interview answers should be 2-3 minutes, not 10 minutes

End of Chapter C: Web & Mobile Testing

Finished this chapter?

Mark it as done to track your progress on the guide overview. Progress is kept only while this browser tab is open.

← Back to chapters