21. Invalid state transitions
An order moves Placed -> Packed -> Shipped -> Delivered, and can be Cancelled only before Shipped. Which test is the most valuable negative test?
- A.Move an order from Placed to Packed
- B.Move an order from Shipped to Delivered
- C.View a Delivered order
- D.Try to cancel an order that is already Shipped
Show answer
Answer: D. Try to cancel an order that is already Shipped
State transition testing checks both valid and invalid transitions. Cancelling after shipping is not allowed, so the system must reject it. Invalid transitions are a common source of serious bugs, like refunding shipped goods.
22. The test pyramid
According to the test pyramid, how should automated tests usually be balanced?
- A.Mostly end-to-end UI tests, a few unit tests
- B.Only manual tests, no automation
- C.Many fast unit tests, fewer integration tests, and a small number of end-to-end UI tests
- D.Equal numbers of every type
Show answer
Answer: C. Many fast unit tests, fewer integration tests, and a small number of end-to-end UI tests
Unit tests are fast, cheap and stable, so they form the base. UI end-to-end tests are slow and flaky but test real user flows, so you keep only the most important ones. An "ice cream cone" with mostly UI tests is slow and fragile.
23. Decision table size
A pricing rule depends on: is the customer a member (yes/no), is it a weekend (yes/no), and the customer tier (Silver, Gold or Platinum). How many rules does the full, uncollapsed decision table have?
- A.7
- B.6
- C.8
- D.12
Show answer
Answer: D. 12
The number of rules is the product of the number of values for each condition: 2 × 2 × 3 = 12. Adding instead of multiplying gives 7, which is a common mistake. After building the full table you can collapse rules where a condition does not change the outcome.
24. Different users in JMeter
In JMeter, each thread must log in with a different username and password from a file. Which element is used?
- A.Constant Timer
- B.View Results Tree
- C.CSV Data Set Config
- D.Response Assertion
Show answer
Answer: C. CSV Data Set Config
CSV Data Set Config reads a file line by line and puts each column into a variable such as ${username}. You can set whether threads share the file and what happens at the end of it. Timers control pauses, listeners show results and assertions validate responses.
25. Robust BVA for two inputs
A function takes two independent integer inputs, each with a range. Using robust boundary value analysis (min-, min, min+, nominal, max-, max, max+ for one variable while the other stays nominal), how many test cases do you get?
- A.13
- B.9
- C.25
- D.49
Show answer
Answer: A. 13
Robust BVA gives 6n + 1 tests: six non-nominal values per variable plus one all-nominal case. For n = 2 that is 13. Normal BVA gives 4n + 1 = 9, and worst-case BVA uses every combination of 5 values, 5² = 25.
26. Scenario Outline in Gherkin
You need the same login scenario with five different username and password pairs. What is the cleanest way in Gherkin?
- A.Five copies of the same Scenario
- B.One Scenario with five When steps
- C.A Scenario Outline with an Examples table
- D.A Background step listing all five users
Show answer
Answer: C. A Scenario Outline with an Examples table
A Scenario Outline uses placeholders like <username>, and the Examples table supplies one row per run. It keeps one readable scenario while running it five times. Copies are hard to maintain, and Background runs before every scenario, not per data row.
27. Largest 32-bit integer
An ID column uses a signed 32-bit integer. Which value is the upper boundary you should test near?
- A.4,294,967,295
- B.65,535
- C.9,223,372,036,854,775,807
- D.2,147,483,647
Show answer
Answer: D. 2,147,483,647
A signed 32-bit integer ranges from −2,147,483,648 to 2,147,483,647 (2³¹ − 1). Going one past may overflow or fail. 4,294,967,295 is the unsigned 32-bit max and the last option is the signed 64-bit max.
28. Top-down or bottom-up
In bottom-up integration testing, what do you usually need to build?
- A.Drivers to call the low-level modules
- B.Stubs to stand in for low-level modules
- C.Both a full UI and a real database
- D.Nothing, since all modules are ready
Show answer
Answer: A. Drivers to call the low-level modules
Bottom-up starts with the lowest modules, so nothing calls them yet; drivers fill that gap. Top-down starts at the top and needs stubs for missing lower modules. Both are incremental, unlike big-bang.
29. Killing the main database
During a test window, the team shuts down the primary database to see if the standby takes over and no orders are lost. What is this?
- A.Regression testing
- B.Usability testing
- C.Recovery (failover) testing
- D.Installation and upgrade testing
Show answer
Answer: C. Recovery (failover) testing
Recovery testing forces failures, like a crashed server or lost network, and checks the system recovers in the expected time with no data loss. It verifies backup, failover and restart plans really work.
30. Canary release
A team sends 5% of real traffic to a new version and watches error rates before rolling it out to everyone. What is this practice?
- A.A smoke test run on the staging server
- B.An alpha test with a group of internal users
- C.A load test using generated fake traffic
- D.A canary release, a form of shift-right testing
Show answer
Answer: D. A canary release, a form of shift-right testing
A canary exposes a small share of real users to a change and compares key metrics with the old version. If errors rise, the team rolls back, limiting harm. It complements, but does not replace, testing before release.
31. Upgrading from an old version
Version 5.0 changes how the app stores saved addresses. What test is essential before release?
- A.Fresh install of 5.0 on a new phone
- B.Install 4.x, add data, upgrade to 5.0, check data
- C.Install 5.0, then uninstall it
- D.Run unit tests on the new storage code
Show answer
Answer: B. Install 4.x, add data, upgrade to 5.0, check data
Most users upgrade rather than install fresh, so the data migration on upgrade must work. Testing only clean installs misses lost or corrupted data from the old format. Test upgrades from several older versions.
32. Sync delayed overnight
A field-sales app syncs orders every 15 minutes. Overnight, with the phone idle and unplugged, syncs stop for hours. What should testing take into account?
- A.Android battery saving (Doze) delays background work
- B.The server is turned off every night
- C.The app was deleted by the operating system
- D.The phone clock goes back one hour at night
Show answer
Answer: A. Android battery saving (Doze) delays background work
Android Doze and app standby batch or delay background jobs on idle devices to save battery, and iOS has similar limits. Background features must be tested with the device idle, on battery saver and with app restrictions.
33. Hindi text shown wrongly
In the Hindi version, some words show as separate broken letters instead of joined shapes. What is the likely cause to check?
- A.The translation file has spelling mistakes
- B.The phone language is set to English
- C.The server sends the text too slowly
- D.A font or renderer that does not shape conjuncts
Show answer
Answer: D. A font or renderer that does not shape conjuncts
Devanagari joins consonants into conjunct shapes. If the font or text engine does not support complex script shaping, letters show broken apart. Testers should check real devices and fonts used in each script.
34. Measuring defect age
A bug was logged on day 3 of a sprint and closed after a verified fix on day 10. What is its defect age?
- A.10 days
- B.7 days
- C.3 days
- D.13 days
Show answer
Answer: B. 7 days
Defect age is the time from when a defect is found to when it is resolved: 10 − 3 = 7 days. Tracking average age by severity shows whether critical bugs get fixed fast enough.
35. When to start testing a story
In a two-week sprint, when should a tester start work on a story?
- A.Only after the developer moves it to "Done"
- B.Only in the last two days of the sprint
- C.In the following sprint, once it has been delivered
- D.At refinement and planning, with tests ready before code
Show answer
Answer: D. At refinement and planning, with tests ready before code
Testers add most value early: asking questions, writing acceptance tests and preparing data while the story is built. Waiting until the end creates a testing crunch and pushes bugs into later sprints.
36. Making a system testable
Which change most improves the testability of a backend service?
- A.A faster CPU on all of the production servers
- B.Clear logs, health endpoints and a way to set test data
- C.A more colourful dashboard for the admin team
- D.Removing all error messages from the responses
Show answer
Answer: B. Clear logs, health endpoints and a way to set test data
Testability is how easily a system can be controlled and observed in testing. Good logs, status endpoints, configurable dependencies and test-data hooks let testers set up states and see what happened.
37. Staging not like production
All tests pass on staging, but in production file uploads fail. Staging stores files on local disk; production uses cloud object storage. What does this show?
- A.The tests were run in the wrong order
- B.Production needs more unit tests
- C.File upload cannot be tested before release
- D.Environment differences can hide defects
Show answer
Answer: D. Environment differences can hide defects
Results only predict production if the environment is similar where it matters: services, configuration, permissions and data size. Differences like local disk versus cloud storage should be removed or tested separately.
38. A bug only on Safari
A date picker works in Chrome and Edge but breaks on Safari, including Chrome on iPhone. Why does Chrome on iPhone show the same bug?
- A.Chrome on iPhone is an old version of Chrome
- B.iPhones block JavaScript in all browsers
- C.Safari and Chrome share the same settings
- D.Browsers on iOS have used Apple's WebKit engine
Show answer
Answer: D. Browsers on iOS have used Apple's WebKit engine
For years, Apple required all iOS browsers to use WebKit, so Chrome on iPhone renders like Safari. Rules have started to change in some regions, such as the EU, but most iPhone users still get WebKit, so iOS needs its own testing.
39. Making test objects readable
Tests need many Invoice objects with 15 fields each, but each test cares about only one or two fields. Which pattern keeps tests short and clear?
const invoice = anInvoice().withStatus("OVERDUE").withAmount(12_000).build()- A.A single shared invoice object that every test modifies
- B.A test data builder with sensible defaults and override methods
- C.Copying a full 15-field object literal into every test
- D.Reading every invoice from a production database export
Show answer
Answer: B. A test data builder with sensible defaults and override methods
A builder fills in valid defaults, so each test states only what matters to it, which documents intent. A shared mutable object leaks changes between tests, and full literals hide the important field among noise.
40. Testing the Arabic version
You have tested the English version of a UAE banking app. Why should you also test the Arabic version with Arabic-first users?
- A.Layout, mirroring and wording can create new problems
- B.The results will be exactly the same
- C.Arabic users only need a survey
- D.Arabic versions never have usability issues
Show answer
Answer: A. Layout, mirroring and wording can create new problems
Right-to-left layouts change reading order, icon direction and navigation flow, and translations can be longer, unclear or too literal. Problems can appear that never show up in English testing.