Curated interview practice questions with answers. These are practice scenarios, not a verified list of past interview questions.
About Mastercard hiring for Playwright Testing roles
Mastercard operates a global payments network and provides cyber, data and analytics services to banks, merchants and governments. Its India technology hubs, including Pune and Vadodara, support global payment products and data services. It hires in India for software engineers, QA engineers, data engineers, data scientists and analytics consultants.
For Playwright Testing roles, this Mastercard practice set focuses most on Visual & Accessibility Testing (6), Framework Design and CI/CD (5), JavaScript and TypeScript (5), Network Mocking (5). It has 5 easy, 33 medium, 2 hard questions, so you can start easy and work up to the harder ones.
Company type
Fintech
Headquarters
Purchase, New York, USA
Main India offices
Pune, Vadodara, Gurugram, Mumbai
Mastercard Playwright Testing interview process
Online coding assessment
Technical round 1
Technical round 2
Hiring manager round
HR round
Typical pattern based on public candidate experiences. Rounds vary by role, team and year.
Solved for MastercardStart practicing
3 QUESTIONS FREESign up to unlock the full question bank and track your progress.Unlock every question and answer, then continue practising company-wise and package-wise.
✓ 3 questions free • Unlock the rest in seconds
01
How do you check colour contrast in Playwright tests?
Playwright has no built-in contrast assertion, so you run axe-core through @axe-core/playwright, whose color-contrast rule checks text against WCAG ratios such as 4.5 to 1 for normal text. Scan pages in each theme, for example after emulating dark mode with colorScheme. Axe may report some elements as needing review, for example text over images, and those need a manual look.
Use the official Playwright image which contains browsers and dependencies, mount the project and run npx playwright test for consistent CI environments.
A browser context is an isolated session inside one browser, like a fresh incognito profile with its own cookies, storage and cache. Creating one takes milliseconds, unlike launching a new browser. Playwright gives every test a new context, so tests do not leak state into each other, and you can open several contexts to simulate different users.
forEach does not wait for async callbacks, so it starts each callback and returns at once. The test may finish before the assertions run, or their errors are lost. Use for...of with await to run steps in order, or Promise.all with map when the steps can safely run in parallel. A lint rule can flag this pattern.
Record once with page.routeFromHAR('data/orders.har', { url: '**/api/**', update: true }) while running against a real server. Later runs replay the saved responses from the HAR instead of hitting the backend. You can edit the stored JSON to create edge cases. Re-record when the API changes, otherwise the replay drifts from reality.
12
Tell me about a time an accessibility check caught a real issue before release.
Situation: a new checkout redesign was ready for release. Task: I had just added an axe scan to our Playwright smoke tests. Action: the scan flagged that the payment form inputs had placeholder text but no labels, and a keyboard test showed the pay button was unreachable with Tab. I raised it with screenshots and the rule links. Result: the developer fixed both in a day and the release went out on time.
13
Why are screenshot baselines specific to browser and operating system?
Each browser engine lays out and paints text, shadows and form controls slightly differently, and each operating system has its own fonts and smoothing. A Chromium image on Linux will rarely match WebKit on macOS pixel for pixel. That is why Playwright includes project and platform in the file name and why teams fix one rendering environment for baselines.
14
How do you run the same visual tests at mobile, tablet and desktop sizes?
Create one project per size in playwright.config, for example using devices['Pixel 7'], devices['iPad Mini'] and a desktop viewport, and point them at the same visual test files with testMatch or a tag. Because the project name is part of the baseline file name, each size keeps its own images automatically. This keeps the test code identical while covering responsive layouts.
Main options are testDir for where tests live, timeout, retries, workers, fullyParallel, reporter, and the use block for shared settings like baseURL, trace, screenshot and video. projects define browsers or setups, and webServer can start the app before tests. Most values can depend on process.env.CI so local and CI runs behave differently.
Both describe object shapes. Interfaces can be extended and merged; type aliases can also describe unions and primitives. Use interfaces for page or test-data shapes, types for unions.
18
How do you test a dropdown component's keyboard support in a component test?
Mount the dropdown, focus the trigger and press Enter or ArrowDown to open it. Assert the listbox is visible and the first option has aria-selected or focus. Press ArrowDown again and check the active option moves, then press Enter and assert the trigger shows the chosen value and the list is closed. Finally press Escape on an open list to confirm it closes without changing the value.
19
A component test passes alone but fails when the full component suite runs. What do you check?
Look for state that leaks between mounts: global stores or singletons created at module level in index.tsx, timers or listeners not cleaned up on unmount, and shared mock data mutated by one test. Make the providers create fresh state in beforeMount each time and reset mocks per test. Running with --repeat-each and a single worker often reproduces the leak quickly.
20
How do you handle token refresh in long API test runs?
Scanners like axe find rule-based problems such as missing labels, bad contrast or invalid ARIA, which is roughly a third to a half of real issues. They cannot judge whether alt text is meaningful, whether focus order makes sense, whether error messages are understandable, or whether a screen reader user can actually finish the task. So automated scans are combined with keyboard tests and periodic manual checks with screen readers.
22
A beforeAll creates one user and tests in the same file fail randomly in parallel mode. Why?
With fullyParallel, the file's tests run in different workers, so each worker creates its own user, or tests in one worker share one user and change its state. Shared mutable data causes random failures. Give each test its own data through a test-scoped fixture, or create a unique user per worker with workerInfo.workerIndex in the name.
23
Component tests fail because imports like @/utils cannot be resolved, though the app builds fine. How do you fix it?
The app uses a bundler alias that the component test bundle does not know. Add the same alias in ctViteConfig under resolve.alias, or reuse the project's Vite config by importing it. Also make sure tsconfig paths match, so editors and type checks agree. After that, clear the cache folder that the component bundler writes under playwright/.cache so the bundle rebuilds.
24
What do maxDiffPixels, maxDiffPixelRatio and threshold control in a screenshot comparison?
threshold sets how different two pixels can be in colour, from 0 to 1, before they count as different; the default is 0.2. maxDiffPixels allows a fixed number of differing pixels, and maxDiffPixelRatio allows a fraction of the total image. Keep them tight so real regressions fail, and set them in the expect section of the config rather than loosening single tests one by one.
25
How do you share one authenticated API context across all tests in a worker?
Create a worker-scoped fixture that calls request.newContext with baseURL and an auth header, or logs in through the API and keeps the cookies. Pass it to use, and dispose it after use returns. Every test in that worker gets the same ready context, so login happens once per worker. Do not store per-test data on it, or tests start depending on each other.
26
How do you handle authentication to avoid logging in every test?
workerIndex is a unique number for every worker process started during the run, so it keeps growing when a worker is restarted after a failure. parallelIndex is a slot number from 0 to workers minus 1, and a restarted worker reuses its slot. Use parallelIndex, also exposed as TEST_PARALLEL_INDEX, to pick a fixed test account or database per slot.
30
Write a GitHub Actions job that runs the suite in four shards.
A failed test may leave the browser or worker-scoped fixtures in a bad state, such as an open dialog or corrupted login. To protect the remaining tests, Playwright throws that worker away and starts a fresh one for the next tests. This means worker fixtures run again and beforeAll hooks may run more than once, which is normal and something your setup must tolerate.
32
Why did you choose to build a career in Playwright automation?
I like that automation combines coding with product quality. I learned Selenium first, then moved to Playwright because auto-waiting, tracing and API support let me write stable tests faster. In my college project I automated twenty flows with TypeScript and a CI pipeline. I want a role where I can grow into framework design and CI ownership.
33
Mocked responses drift from the real API and tests pass while production breaks. How do you prevent this?
Generate mock data from the API schema or real recorded responses instead of hand-writing it. Validate mocks against the OpenAPI schema in a unit test. Add contract tests on the backend side and re-record HAR files on a schedule. Keep a few unmocked end-to-end tests that run after each deploy. Treat mock files as code with owners and reviews.
34
How do you publish the Playwright HTML report from a CI pipeline?
Keep the html reporter in the config. After the test step, add an upload-artifact step that runs even when tests fail, using a condition like always(), and upload the playwright-report folder with a retention period. Team members download and open it with npx playwright show-report. Some teams also publish it to static hosting for direct links.
JavaScript runs one call stack and uses queues for async work; the event loop pushes callbacks from the microtask (promises) and task queues when the stack is empty.
The action runs without waiting, so the next step may run first — causing flaky failures or 'Target closed' errors. The @typescript-eslint/no-floating-promises rule catches it.
37
How do you read a Playwright timeout error message?
The error names the action and locator, for example locator.click: Timeout 30000ms exceeded, followed by a call log. The call log lists each attempt, such as waiting for the element to be visible, enabled and stable, or another element intercepting pointer events. The last lines show what blocked the action. Read it before changing timeouts.
38
How do you handle date pickers and custom dropdowns?
all waits for every promise and rejects on the first failure; allSettled waits for all and reports each outcome; race settles with the first one to finish.
Tips to crack the Mastercard Playwright Testing interview
Understand card network basics and how Mastercard uses data for fraud scoring and loyalty analytics.
Practise Java, Spring Boot or Python basics along with SQL, as these appear often in Mastercard job descriptions.
Read about Mastercard's Decency Quotient culture and its financial inclusion work for behavioural questions.
Keep a one-minute story ready for every project on your CV: problem, your part, tools, result.
Practise the hard questions on this page aloud; Mastercard interviewers usually ask follow-ups on your first answer.
Frequently asked questions
How many rounds are there in the Mastercard Playwright Testing interview?
Candidates usually go through 5 stages: Online coding assessment; Technical round 1; Technical round 2; Hiring manager round; HR round. The exact rounds change with the role, team, location and your experience, so confirm the process with the recruiter.
Which topics should I prepare for the Mastercard Playwright Testing interview?
This practice set leans on Visual & Accessibility Testing (6), Framework Design and CI/CD (5), JavaScript and TypeScript (5), Network Mocking (5). Revise those first, then practise explaining one or two of your own projects end to end, because most Mastercard interviewers ask you to walk through real work.
Are these the exact questions asked at Mastercard?
No. These are curated practice questions that match the skills and difficulty usually tested in fintech interviews like Mastercard's. They are not a leaked or verified list of past questions.
Where does Mastercard hire Playwright Testing professionals in India?
Mastercard has large teams in Pune, Vadodara, Gurugram, Mumbai. Openings and locations change often, so check the Mastercard careers page and filter by city and experience.
Playwright Testing questions for similar companies