QAVeda Start Learning Free →
Interview Prep · TypeScript for QA

TypeScript for QA
Interview Questions

Real questions asked in actual QA interviews — 150 Q&As across Junior, Mid and Senior levels. Full answers, examples & real scenarios on QAVeda.

Practice Full Answers on QAVeda → Free · No credit card · 200+ lessons + quizzes included
150
Questions
3
Levels
Free
On QAVeda

Junior (0–2 years)

1
Fundamentals

What is TypeScript, and how does it differ from JavaScript?

TypeScript is a superset of JavaScript — that means everything you can already write in JavaScript also works in TypeScript, and TypeScript adds extra features on top. The biggest addition is static types: you tell…

↳ Includes walked-through example, real-world QA scenario & rule of thumb

Get the full answer on QAVeda →
2
Types

What are the basic types in TypeScript?

TypeScript adds type annotations on top of JavaScript values. You tell TypeScript what kind of data each variable holds, and it makes sure you never accidentally put the wrong kind in.

↳ Includes walked-through example, real-world QA scenario & rule of thumb

Get the full answer on QAVeda →
3
Types

What is the difference between type inference and type annotation?

TypeScript figures out the type of a value in two ways: either you spell it out explicitly (annotation), or TypeScript works it out from the value itself (inference).

↳ Includes walked-through example, real-world QA scenario & rule of thumb

Get the full answer on QAVeda →
4
JavaScript Basics

What is the difference between let, const, and var?

All three declare a variable, but they behave very differently in terms of *scope*, *reassignment*, and old-JavaScript quirks.

↳ Includes walked-through example, real-world QA scenario & rule of thumb

Get the full answer on QAVeda →
5
Types

What is the difference between any, unknown, and never?

These three look similar at first glance but solve completely different problems. Getting them right is one of the biggest signals of how well you actually understand TypeScript.

↳ Includes walked-through example, real-world QA scenario & rule of thumb

Get the full answer on QAVeda →
6
Types

What is the difference between an interface and a type?

Both interface and type describe the *shape* of data — like a blueprint that says "an object of this kind has these properties." For most everyday object shapes, they're interchangeable. But each has things the…

↳ Includes walked-through example, real-world QA scenario & rule of thumb

Get the full answer on QAVeda →
7
Types

What are union and intersection types?

Union and intersection are two ways to combine existing types into new ones. They sound similar but mean opposite things.

↳ Includes walked-through example, real-world QA scenario & rule of thumb

Get the full answer on QAVeda →
8
Types

What are optional properties in TypeScript?

An optional property is a field that may or may not be present on an object. You mark it with a ? after the property name.

↳ Includes walked-through example, real-world QA scenario & rule of thumb

Get the full answer on QAVeda →
9
OOP

What is a TypeScript class and how do you use one in a Page Object for Playwright?

A class in TypeScript is a blueprint for creating objects that combine data (properties) and behaviour (methods) in one place. TypeScript adds type annotations and access modifiers on top of JavaScript's class syntax.

↳ Includes walked-through example, real-world QA scenario & rule of thumb

Get the full answer on QAVeda →
10
Types

What is an enum in TypeScript?

An enum (short for "enumeration") is a way to give friendly names to a fixed set of related values. Instead of scattering "magic numbers" or hardcoded strings through your code, you collect the allowed options…

↳ Includes walked-through example, real-world QA scenario & rule of thumb

Get the full answer on QAVeda →
11
Functions

How do you type a function's parameters and return value?

Typing a function means saying two things: what kinds of values it accepts (parameters) and what kind of value it gives back (return type).

↳ Includes walked-through example, real-world QA scenario & rule of thumb

Get the full answer on QAVeda →
12
Types

What is type assertion (`as`), and when do you use it?

A type assertion is you telling TypeScript "trust me, I know this value's type better than you do." You use the as keyword to override what TypeScript inferred.

↳ Includes walked-through example, real-world QA scenario & rule of thumb

Get the full answer on QAVeda →
13
Types

How do you type an array in TypeScript?

TypeScript gives you two equivalent ways to declare the type of an array — they mean exactly the same thing, just written differently.

↳ Includes walked-through example, real-world QA scenario & rule of thumb

Get the full answer on QAVeda →
14
Types

What does `readonly` do?

readonly marks a property as set-once — it can be assigned when the object is first created, but never reassigned afterwards. It's TypeScript's way of saying "this value is fixed once it exists."

↳ Includes walked-through example, real-world QA scenario & rule of thumb

Get the full answer on QAVeda →
15
Functions

What does the `void` type mean?

void is the return type for a function that does something but gives nothing back. The function runs, has some effect — prints to the console, updates the DOM, sends a request — but doesn't…

↳ Includes walked-through example, real-world QA scenario & rule of thumb

Get the full answer on QAVeda →
🔓
You're reading previews.
Full answers with walked-through examples, real-world QA scenarios and rules of thumb are free on QAVeda.
Open QAVeda — it's free →
16
Types

What are literal types?

A literal type is a type that allows only one *specific value*, not a whole category. Instead of "any string," it's "the exact string "left"." Combined with a union, this becomes one of TypeScript's most…

↳ Includes walked-through example, real-world QA scenario & rule of thumb

Get the full answer on QAVeda →
17
Types

What is a type alias?

A type alias is a custom name you give to an existing type. It doesn't create a new type — it just provides a shorter, more meaningful name for something you'll use repeatedly. You declare…

↳ Includes walked-through example, real-world QA scenario & rule of thumb

Get the full answer on QAVeda →
18
JavaScript Basics

What is the difference between == and === ?

Both check equality between two values, but they do it very differently. Choosing the wrong one is one of the classic sources of silent JavaScript bugs.

↳ Includes walked-through example, real-world QA scenario & rule of thumb

Get the full answer on QAVeda →
19
JavaScript Basics

What is the difference between null and undefined?

Both null and undefined represent "no value," but they signal different things: one means "nothing was ever set," the other means "set to nothing, on purpose."

↳ Includes walked-through example, real-world QA scenario & rule of thumb

Get the full answer on QAVeda →
20
Fundamentals

Does the browser or Node run TypeScript directly? How does it run?

No — browsers and Node.js only run JavaScript. They have no idea what TypeScript is. Before your TypeScript code can run, the TypeScript compiler must convert it into plain JavaScript.

↳ Includes walked-through example, real-world QA scenario & rule of thumb

Get the full answer on QAVeda →
21
Tooling

What is tsconfig.json, and what does strict mode do?

tsconfig.json is the configuration file that tells the TypeScript compiler (tsc) how to handle your project — which files to include, what version of JavaScript to output, where to put compiled files, and how strict…

↳ Includes walked-through example, real-world QA scenario & rule of thumb

Get the full answer on QAVeda →
22
Functions

What are optional and default function parameters?

TypeScript gives you two ways to handle function parameters that don't always need to be supplied: mark them optional, or give them a default value. Both let callers omit the argument, but they behave differently…

↳ Includes walked-through example, real-world QA scenario & rule of thumb

Get the full answer on QAVeda →
23
JavaScript Basics

What is destructuring, and how does it work with types?

Destructuring is a JavaScript syntax that lets you pull values out of an object or an array into individual named variables, all in one line. TypeScript infers the type of each extracted variable from the…

↳ Includes walked-through example, real-world QA scenario & rule of thumb

Get the full answer on QAVeda →
24
Types

How do you describe the shape of an object in TypeScript?

In TypeScript, you describe an object's shape — what properties it has and what types those properties hold — using one of three approaches: an inline type, a type alias, or an interface.

↳ Includes walked-through example, real-world QA scenario & rule of thumb

Get the full answer on QAVeda →
25
Types

What is structural typing (duck typing) in TypeScript?

Structural typing means TypeScript compares types by their *shape* — what properties and methods they have — not by their *name*. If an object has all the required properties of a type, it counts as…

↳ Includes walked-through example, real-world QA scenario & rule of thumb

Get the full answer on QAVeda →
26
JavaScript Basics

What are optional chaining (?.) and nullish coalescing (??)?

Optional chaining (?.) and nullish coalescing (??) are two modern JavaScript operators that handle missing or null values cleanly. Both also exist in TypeScript with full type inference.

↳ Includes walked-through example, real-world QA scenario & rule of thumb

Get the full answer on QAVeda →
27
Practical

You are getting "Object is possibly null" errors everywhere. How do you fix them?

This error means TypeScript found a code path where a value could be null (or undefined) and you tried to use it without checking. It's TypeScript doing its job — protecting you from runtime crashes.

↳ Includes walked-through example, real-world QA scenario & rule of thumb

Get the full answer on QAVeda →
28
Practical

Your colleague used `any` everywhere in a TypeScript file. What is the problem and how do you start fixing it?

any turns off TypeScript's type checking entirely for that value. It's effectively writing JavaScript inside a TypeScript file. A few anys here and there are usually fine; a whole file full of them defeats the…

↳ Includes walked-through example, real-world QA scenario & rule of thumb

Get the full answer on QAVeda →
29
Types

You have a function that searches a database and might find nothing. How do you type the return value?

When a function might *not* find a result, the type should make that absence visible. The standard pattern is to return a union of the success type with null (or undefined).

↳ Includes walked-through example, real-world QA scenario & rule of thumb

Get the full answer on QAVeda →
30
Tooling

How would you add TypeScript to an existing JavaScript project?

The golden rule: do it incrementally. Forcing a big-bang conversion blocks the team for weeks and almost always introduces regressions. The right approach lets the project keep running while you tighten one file at a…

↳ Includes walked-through example, real-world QA scenario & rule of thumb

Get the full answer on QAVeda →
🔓
You're reading previews.
Full answers with walked-through examples, real-world QA scenarios and rules of thumb are free on QAVeda.
Open QAVeda — it's free →
31
Practical

How do you import the `Page` type from Playwright and use it to type a helper function?

When you write helper functions for your Playwright tests — things like loginAs(), navigateToDashboard(), or fillCheckoutForm() — those functions need a Playwright Page object to interact with the browser. TypeScript requires you to declare what…

↳ Includes walked-through example, real-world QA scenario & rule of thumb

Get the full answer on QAVeda →
32
Types

What is a type guard and when do you actually need one?

A type guard is any check in your code that lets TypeScript narrow a value from a broad type (like a union or unknown) to a more specific type *inside* a branch. After the check,…

↳ Includes walked-through example, real-world QA scenario & rule of thumb

Get the full answer on QAVeda →
33
Types

You have a function that needs to accept either a string ID or a numeric ID. How do you type it?

When a function needs to accept more than one type of input, use a union type (A | B) and narrow inside the function to handle each case.

↳ Includes walked-through example, real-world QA scenario & rule of thumb

Get the full answer on QAVeda →
34
Practical

How do you share a TypeScript interface across multiple test files without redefining it each time?

As your test suite grows, you'll define types for things like users, products, orders, and API responses. If you copy those interface definitions into each test file, you end up with multiple slightly-different versions that…

↳ Includes walked-through example, real-world QA scenario & rule of thumb

Get the full answer on QAVeda →
35
Practical

An API returns an object with keys you don't know in advance. How do you type it?

When you don't know the specific keys ahead of time — for example, a dictionary of HTTP headers, a translation lookup table, or a user-defined config — you describe the *pattern* of keys and values…

↳ Includes walked-through example, real-world QA scenario & rule of thumb

Get the full answer on QAVeda →
36
Types

What does TypeScript do when you pass extra properties to a typed function?

This is one of TypeScript's most confusing behaviors at first — the answer depends on how you pass the object, not just what it contains.

↳ Includes walked-through example, real-world QA scenario & rule of thumb

Get the full answer on QAVeda →
37
Types

How do you make one interface extend another in TypeScript?

Use the extends keyword to build a new interface that inherits all the properties of a parent interface and adds (or overrides) its own. This is TypeScript's way of expressing "A is a B, plus…

↳ Includes walked-through example, real-world QA scenario & rule of thumb

Get the full answer on QAVeda →
38
Practical

How do you write a TypeScript function that creates test user data with defaults but lets the caller override specific fields?

One of the most common patterns in test automation is a test data factory — a function that produces a ready-to-use test object with sensible defaults, but lets each test override only the fields it…

↳ Includes walked-through example, real-world QA scenario & rule of thumb

Get the full answer on QAVeda →
39
Functions

How do you type a function that accepts a callback in TypeScript?

A callback is a function passed as an argument to another function, to be called back later. To type one, you write its full signature — its parameters and return type — using TypeScript's arrow-function…

↳ Includes walked-through example, real-world QA scenario & rule of thumb

Get the full answer on QAVeda →
40
Practical

How do you avoid using `any` when you don't know the shape of data coming from an API?

TypeScript types exist only in your source code — they are erased completely at runtime. The JSON your API returns is whatever the server actually sends, regardless of what your TypeScript says it should be.…

↳ Includes walked-through example, real-world QA scenario & rule of thumb

Get the full answer on QAVeda →
41
Practical

You are seeing "Property 'x' does not exist on type 'Y'" — what does this mean and how do you fix it?

TypeScript maintains a precise map of every type's shape — every field name and its exact type. When you write obj.something, it looks up "does this type have a field called something?" If not, it…

↳ Includes walked-through example, real-world QA scenario & rule of thumb

Get the full answer on QAVeda →
42
Practical

An API response returns a User object but without the password field. How do you type this cleanly without duplicating the interface?

This is a very common situation in test automation — your internal User model has a passwordHash or password field, but the GET /users API response deliberately strips it for security. You need a type…

↳ Includes walked-through example, real-world QA scenario & rule of thumb

Get the full answer on QAVeda →
43
Practical

How do you define and use a string enum for order statuses in an API response?

A string enum is TypeScript's way of defining a fixed, named set of string constants. Without one, order statuses in your codebase are just raw strings — and a typo like "SHIPED" is a perfectly…

↳ Includes walked-through example, real-world QA scenario & rule of thumb

Get the full answer on QAVeda →
44
Practical

How do you write a TypeScript factory function that creates test users with different roles — admin, guest, or regular — for use across test scenarios?

A test data factory is a function that builds a fully-typed test object with sensible defaults, but lets you override just the fields you care about in each test. Without one, every test file either…

↳ Includes walked-through example, real-world QA scenario & rule of thumb

Get the full answer on QAVeda →
45
Practical

How do you convert a simple JavaScript utility function to TypeScript?

Converting a JavaScript function to TypeScript is mostly about making existing assumptions explicit. The function already works — you're adding a written contract that describes what it accepts and what it returns, so TypeScript can…

↳ Includes walked-through example, real-world QA scenario & rule of thumb

Get the full answer on QAVeda →
🔓
You're reading previews.
Full answers with walked-through examples, real-world QA scenarios and rules of thumb are free on QAVeda.
Open QAVeda — it's free →
46
Types

What is the spread operator and how does TypeScript handle its types?

The spread operator (...) copies properties from one object (or elements from one array) into another. In JavaScript you use it constantly for immutable updates and merging. TypeScript's job is to track the resulting type…

↳ Includes walked-through example, real-world QA scenario & rule of thumb

Get the full answer on QAVeda →
47
Async

What happens in TypeScript when you forget to `await` an async function in a test, and how do you spot and fix it?

Forgetting await on an async call is one of the most common bugs in TypeScript test automation. The function call runs but returns a Promise object — not the resolved value you expected. Your code…

↳ Includes walked-through example, real-world QA scenario & rule of thumb

Get the full answer on QAVeda →
48
Practical

How do you type an async function that fetches and returns a list of users?

An async fetch function sits right at the TypeScript–runtime boundary: the return type tells every caller what they'll get, but the actual JSON from the server is untyped. Getting this right means being explicit about…

↳ Includes walked-through example, real-world QA scenario & rule of thumb

Get the full answer on QAVeda →
49
Types

What is the difference between `type` and `interface` and when do you pick each in practice?

Both type and interface let you describe the shape of an object in TypeScript. For plain object types, they are nearly interchangeable — TypeScript treats them structurally, so a type User and an interface User…

↳ Includes walked-through example, real-world QA scenario & rule of thumb

Get the full answer on QAVeda →
50
Practical

How does TypeScript help you when working with a Playwright or API test automation framework?

Test code has the same type-safety problems as application code — wrong argument order, renamed fields, incorrect property access — except the failures are often more confusing because they surface as mysterious test failures rather…

↳ Includes walked-through example, real-world QA scenario & rule of thumb

Get the full answer on QAVeda →

Mid-Level (2–5 years)

1
Generics

What are generics, and why use them?

A generic is a way to write a function, class, or interface that works with *any* type — but still gives you full type safety. Instead of hardcoding a specific type, you use a type…

↳ Includes walked-through example, real-world QA scenario & rule of thumb

Get the full answer on QAVeda →
2
Generics

What is a generic constraint?

A generic constraint limits which types can be passed as a type parameter. You write it as <T extends SomeType>. Without it, TypeScript treats T as completely unknown — you can't access any properties on…

↳ Includes walked-through example, real-world QA scenario & rule of thumb

Get the full answer on QAVeda →
3
Utility Types

What are utility types? Name the common ones.

Utility types are built-in TypeScript generics that *transform* an existing type into a new one. Instead of rewriting an interface from scratch, you derive a variant from it — keeping the two in sync automatically.

↳ Includes walked-through example, real-world QA scenario & rule of thumb

Get the full answer on QAVeda →
4
Utility Types

What is the Record<K, V> type?

Record<K, V> is a utility type that constructs an object type where all keys are of type K and all values are of type V. It's the right tool whenever you're building a dictionary, lookup…

↳ Includes walked-through example, real-world QA scenario & rule of thumb

Get the full answer on QAVeda →
5
Narrowing

What is type narrowing?

Type narrowing is TypeScript's ability to refine a broad type to a more specific one inside a conditional branch. When you check something about a value — "is this a string?", "does this have a…

↳ Includes walked-through example, real-world QA scenario & rule of thumb

Get the full answer on QAVeda →
6
Narrowing

What is a user-defined type guard?

A user-defined type guard is a function that tells TypeScript "if this returns true, treat this value as a specific type." You signal it by writing value is SomeType as the return type instead of…

↳ Includes walked-through example, real-world QA scenario & rule of thumb

Get the full answer on QAVeda →
7
Types

What is a discriminated (tagged) union?

A discriminated union is a set of object types that all share one common field with a literal value — that field is the "discriminant." TypeScript reads it and automatically narrows to the right shape…

↳ Includes walked-through example, real-world QA scenario & rule of thumb

Get the full answer on QAVeda →
8
Types

What does `keyof` do?

keyof T produces a union of all the property names of type T. It lets you write functions that only accept valid keys of an object — TypeScript catches typos and nonexistent properties at compile…

↳ Includes walked-through example, real-world QA scenario & rule of thumb

Get the full answer on QAVeda →
9
Types

What is the `typeof` type query (the type-level one)?

In a type position, typeof someVariable gives you the TypeScript type of that variable — without you having to write an interface manually. The value becomes the single source of truth; the type stays in…

↳ Includes walked-through example, real-world QA scenario & rule of thumb

Get the full answer on QAVeda →
10
Types

What is an index signature?

An index signature describes an object where you don't know the exact key names ahead of time, but you know every key will be a string (or number) and every value will be a specific…

↳ Includes walked-through example, real-world QA scenario & rule of thumb

Get the full answer on QAVeda →
11
Practical

How do you use TypeScript's `Record<K, V>` type to map test roles to their expected permissions in a data-driven test?

Record<K, V> creates an object type where every key is of type K and every value is of type V. In test automation it is perfect for building a lookup table that drives many test…

↳ Includes walked-through example, real-world QA scenario & rule of thumb

Get the full answer on QAVeda →
12
Async

How do you type async functions and Promises?

An async function always returns a Promise. You type the value that the promise will eventually resolve to — not the Promise wrapper itself. await unwraps the Promise<T> back to T so the rest of…

↳ Includes walked-through example, real-world QA scenario & rule of thumb

Get the full answer on QAVeda →
13
Async

How do you handle and type errors in async TypeScript?

You wrap await calls in try/catch. The critical detail: TypeScript types the caught value as unknown — not Error — because JavaScript lets you throw anything (a string, a number, a plain object). You must…

↳ Includes walked-through example, real-world QA scenario & rule of thumb

Get the full answer on QAVeda →
14
Modules

How do import/export work — named vs default?

TypeScript has two export styles. Named exports let a file export many things by name — callers import using those exact names. Default exports let a file export one main thing — callers can import…

↳ Includes walked-through example, real-world QA scenario & rule of thumb

Get the full answer on QAVeda →
15
Types

What does `as const` do?

as const tells TypeScript to treat a value as the most specific, read-only type possible — instead of widening it to a general type. An array of strings stays as a tuple of exact string…

↳ Includes walked-through example, real-world QA scenario & rule of thumb

Get the full answer on QAVeda →
🔓
You're reading previews.
Full answers with walked-through examples, real-world QA scenarios and rules of thumb are free on QAVeda.
Open QAVeda — it's free →
16
Types

What is the non-null assertion operator (`!`)?

The non-null assertion operator (!) is a postfix operator that tells TypeScript "I guarantee this value is not null or undefined right here." TypeScript removes those possibilities from the type and stops warning about them…

↳ Includes walked-through example, real-world QA scenario & rule of thumb

Get the full answer on QAVeda →
17
Practical

A shared Playwright helper should accept either a CSS selector string or a `Locator` object as its target. How do you type this correctly?

This is one of the most common typing challenges when building a shared Playwright helper layer. Some callers have a CSS selector string ready; others already hold a Locator from a previous call. The solution…

↳ Includes walked-through example, real-world QA scenario & rule of thumb

Get the full answer on QAVeda →
18
Types

Enums or a union of string literals — which should you use?

Both model a fixed set of allowed values, but they behave differently. A union of string literals is a pure compile-time type — zero runtime footprint, easy to narrow, and works naturally with as const.…

↳ Includes walked-through example, real-world QA scenario & rule of thumb

Get the full answer on QAVeda →
19
Functions

How do you type the callback you pass to `page.on("request", handler)` in Playwright — for example, to log or assert on outgoing API calls during a test?

Playwright fires network events during test execution and lets you hook into them with page.on(). The callback receives a strongly-typed Request object — importing and using this type gives you full autocomplete on URL, method,…

↳ Includes walked-through example, real-world QA scenario & rule of thumb

Get the full answer on QAVeda →
20
Tooling

How do you use types for a JavaScript library that doesn't ship its own?

When a JavaScript library doesn't include TypeScript types, you have three options in order of preference: check if the library already bundles types, install community types from DefinitelyTyped, or write a minimal declaration yourself.

↳ Includes walked-through example, real-world QA scenario & rule of thumb

Get the full answer on QAVeda →
21
Types

What does the `satisfies` operator do?

satisfies validates that a value matches a type at compile time, but without widening the value's inferred type. You get the safety of a type annotation and the specificity of direct inference — the best…

↳ Includes walked-through example, real-world QA scenario & rule of thumb

Get the full answer on QAVeda →
22
Narrowing

How do you safely use a value typed as `unknown`?

unknown is TypeScript's safe version of any. You cannot do anything with an unknown value — no property access, no method calls, no arithmetic — until you've proven what type it is through a narrowing…

↳ Includes walked-through example, real-world QA scenario & rule of thumb

Get the full answer on QAVeda →
23
Practical

How do you type the JSON response from an API?

You define an interface for the expected shape and then either cast the parsed result to that interface (quick but no runtime guarantee) or validate it with a schema library like Zod (slower to set…

↳ Includes walked-through example, real-world QA scenario & rule of thumb

Get the full answer on QAVeda →
24
Types

Why does assigning an object literal with an extra field sometimes error?

When you assign an object literal directly to a typed variable or parameter, TypeScript runs an extra check called *excess property checking* — it flags any property that doesn't exist in the target type. This…

↳ Includes walked-through example, real-world QA scenario & rule of thumb

Get the full answer on QAVeda →
25
Generics

How do you write a generic TypeScript helper for Playwright API testing that returns the response body typed as a specific interface?

When you write Playwright API tests, every request.get() or request.post() call returns a APIResponse object — and .json() returns any. Without a typed helper, every test has to cast the response manually. A generic helper…

↳ Includes walked-through example, real-world QA scenario & rule of thumb

Get the full answer on QAVeda →
26
Types

What is the difference between an optional property, a default value, and `| undefined`?

These three patterns look similar but mean different things to TypeScript — specifically around whether a field can be omitted entirely versus explicitly set to undefined, and whether a fallback value is guaranteed inside the…

↳ Includes walked-through example, real-world QA scenario & rule of thumb

Get the full answer on QAVeda →
27
Practical

Explain how you have used TypeScript in a test automation framework — what specific benefits did it give you?

TypeScript gives a test automation framework four concrete benefits: type-safe Page Object Models, typed test data factories, refactoring safety at scale, and self-documenting code that onboards engineers faster.

↳ Includes walked-through example, real-world QA scenario & rule of thumb

Get the full answer on QAVeda →
28
Generics

How do you use generics to build a type-safe API client?

A type-safe API client uses generics so that each endpoint call returns the correct type automatically — the caller passes a type parameter once, and everything downstream is typed without extra casting. The most powerful…

↳ Includes walked-through example, real-world QA scenario & rule of thumb

Get the full answer on QAVeda →
29
Types

How do you use a TypeScript discriminated union to represent test result states — pass, fail, and skip — so a custom reporter handles all three correctly?

A discriminated union is a TypeScript pattern where each member of the union has a literal "tag" field (like status) that distinguishes it. TypeScript uses the tag to narrow the type inside each branch —…

↳ Includes walked-through example, real-world QA scenario & rule of thumb

Get the full answer on QAVeda →
30
Utility Types

What is ReturnType<T> and when do you use it?

ReturnType<T> is a built-in TypeScript utility that extracts whatever type a function returns. You pass the function type in (usually via typeof myFunction), and you get the return type back — so you never have…

↳ Includes walked-through example, real-world QA scenario & rule of thumb

Get the full answer on QAVeda →
🔓
You're reading previews.
Full answers with walked-through examples, real-world QA scenarios and rules of thumb are free on QAVeda.
Open QAVeda — it's free →
31
Practical

How do you use TypeScript with Zod for runtime validation — walk me through a practical example.

TypeScript types exist only at compile time — they disappear completely in the compiled JavaScript. So a response body typed as User might actually be { user_id: ... } at runtime and TypeScript will never…

↳ Includes walked-through example, real-world QA scenario & rule of thumb

Get the full answer on QAVeda →
32
Practical

How do you manage turning on strict mode in a large existing TypeScript codebase?

You can't flip "strict": true overnight on a large codebase — it typically produces hundreds or thousands of errors. The safe approach is to enable strict flags one at a time, fix the errors each…

↳ Includes walked-through example, real-world QA scenario & rule of thumb

Get the full answer on QAVeda →
33
Types

What OOP concepts does TypeScript support and how have you used them in a test automation framework?

TypeScript supports the four core OOP concepts — encapsulation, inheritance, abstraction, and polymorphism — and all four have direct practical applications in a Playwright Page Object Model framework.

↳ Includes walked-through example, real-world QA scenario & rule of thumb

Get the full answer on QAVeda →
34
Practical

Your test suite has `TestStatus = "pass" | "fail" | "skip" | "blocked"`. How do you derive sub-types for only the terminal states and only the non-terminal states without repeating the values?

Exclude<T, U> and Extract<T, U> are TypeScript utility types that filter a union by removing or keeping members that match a condition. They let you derive precise sub-types from an existing union — no copy-pasting,…

↳ Includes walked-through example, real-world QA scenario & rule of thumb

Get the full answer on QAVeda →
35
Utility Types

What is NonNullable<T> and when is it useful?

NonNullable<T> is a built-in TypeScript utility that removes null and undefined from a type, leaving only the non-nullable version. It's useful in generic helpers that assert a value exists, and when you want to strip…

↳ Includes walked-through example, real-world QA scenario & rule of thumb

Get the full answer on QAVeda →
36
Practical

How do you write a typed custom Playwright fixture that gives every test in a suite a pre-authenticated Page — without repeating the login steps in each test?

Playwright's fixture system lets you extend the built-in test object with your own setup/teardown logic. TypeScript types the custom fixture so every test that uses it gets full autocomplete and type safety on the object…

↳ Includes walked-through example, real-world QA scenario & rule of thumb

Get the full answer on QAVeda →
37
Async

What is Awaited<T> and when do you actually need it?

Awaited<T> is a built-in TypeScript utility that unwraps the resolved type from a Promise<T> — recursively, through as many layers of nesting as needed. Its most common use in test automation is pairing it with…

↳ Includes walked-through example, real-world QA scenario & rule of thumb

Get the full answer on QAVeda →
38
Practical

How do you use TypeScript's strict null checks to avoid "cannot read property of undefined" crashes when working with optional API response fields in tests?

Strict null checks ("strictNullChecks": true in tsconfig) make TypeScript treat null and undefined as distinct types — not secretly present in every type. This means the compiler tells you BEFORE runtime when you're about to…

↳ Includes walked-through example, real-world QA scenario & rule of thumb

Get the full answer on QAVeda →
39
Practical

How do you type `page.evaluate()` in Playwright to get a typed return value instead of `any`?

page.evaluate() runs a function inside the browser context and returns the result. Without a type parameter, TypeScript infers the return as unknown — you lose all safety on what comes back. Passing a generic type…

↳ Includes walked-through example, real-world QA scenario & rule of thumb

Get the full answer on QAVeda →
40
Practical

How do you use `as const` to define test tags — like "smoke", "regression", "critical" — as a typed union so that incorrectly tagged tests are a compile error?

In test automation, you often tag tests with categories for CI filtering (run only smoke tests on every commit, full regression on nightly). Without types, tags are plain strings — a typo like 'smooke' slips…

↳ Includes walked-through example, real-world QA scenario & rule of thumb

Get the full answer on QAVeda →
41
Practical

How do you write a typed Playwright API assertion helper that validates both the HTTP status code and the response body shape in one call?

When you write Playwright API tests, every test needs two assertions: check the status code AND check the body shape. Without a helper, this logic is duplicated across tests. A generic typed helper centralises both…

↳ Includes walked-through example, real-world QA scenario & rule of thumb

Get the full answer on QAVeda →
42
Testing

How do you test TypeScript code — what tools and patterns do you use?

TypeScript test code uses the same tools as JavaScript tests — Playwright for E2E, Vitest or Jest for unit/integration — but with types giving you two extra guarantees: mock data that matches the real shape,…

↳ Includes walked-through example, real-world QA scenario & rule of thumb

Get the full answer on QAVeda →
43
Practical

How do you handle a third-party library with wrong or missing TypeScript type definitions?

When a library's types are missing or incorrect, you have four options in order of preference: install community types, patch with module augmentation, write a full declaration file, or (last resort) silence the module entirely.…

↳ Includes walked-through example, real-world QA scenario & rule of thumb

Get the full answer on QAVeda →
44
Types

What are the benefits of combining `readonly` and `as const` for configuration objects?

Using as const on a configuration object freezes every value to its most specific literal type and makes all properties deeply readonly. The combination means you can derive precise union types from the config, functions…

↳ Includes walked-through example, real-world QA scenario & rule of thumb

Get the full answer on QAVeda →
45
Practical

Walk me through how you would approach migrating a JavaScript test framework to TypeScript.

Migrate incrementally — never as a big-bang rewrite. The strategy is to set up TypeScript alongside JavaScript so both can run simultaneously, then migrate files in order of impact: shared utilities first (they flow types…

↳ Includes walked-through example, real-world QA scenario & rule of thumb

Get the full answer on QAVeda →
🔓
You're reading previews.
Full answers with walked-through examples, real-world QA scenarios and rules of thumb are free on QAVeda.
Open QAVeda — it's free →
46
Types

What is the difference between `any` and `unknown` in TypeScript, and which should you use when handling data from an API response in tests?

Both any and unknown represent "a value whose type we don't know yet," but they behave very differently. any turns off type checking entirely — you can access any property, call anything, and TypeScript stays…

↳ Includes walked-through example, real-world QA scenario & rule of thumb

Get the full answer on QAVeda →
47
Narrowing

How do you build a robust type guard for an unknown API response object?

A robust type guard checks not just that properties exist, but that each property has the right type — including enum membership for literal unions. The return type x is User tells TypeScript to narrow…

↳ Includes walked-through example, real-world QA scenario & rule of thumb

Get the full answer on QAVeda →
48
Practical

How do you type environment variables in a TypeScript Node.js project?

Every process.env value is typed as string | undefined by default — TypeScript has no idea which variables are required, which are optional, or what their values mean. The fix is a validated config module…

↳ Includes walked-through example, real-world QA scenario & rule of thumb

Get the full answer on QAVeda →
49
Generics

How do you write a typed `retry` helper in TypeScript that wraps any async test action and automatically returns the correct type?

A retry helper re-runs an async function on failure, up to a maximum number of attempts. Without generics, the return type would be any or unknown — the caller would lose type information about what…

↳ Includes walked-through example, real-world QA scenario & rule of thumb

Get the full answer on QAVeda →
50
Practical

How do you use TypeScript to keep test helper functions and fixtures type-safe across a large test suite?

The foundation is a set of typed factory functions — one per entity — that the whole suite imports. Each factory accepts a Partial<T> override so tests only specify what they care about, while TypeScript…

↳ Includes walked-through example, real-world QA scenario & rule of thumb

Get the full answer on QAVeda →

Senior (5+ years)

1
Playwright

How do you architect Playwright test sharding across CI workers for a large test suite?

Sharding splits your test suite into slices that run in parallel across multiple CI machines — if you have 500 tests and 5 workers, each worker runs ~100 tests independently, cutting total wall-clock time by…

↳ Includes walked-through example, real-world QA scenario & rule of thumb

Get the full answer on QAVeda →
2
TypeScript

How do you design a type-safe Page Object Model hierarchy using TypeScript generics and abstract classes?

A Page Object Model (POM) wraps page interactions into classes so tests read as business logic, not raw Playwright selectors. TypeScript abstract classes let you put shared infrastructure (navigation, waiting, error handling) in one place;…

↳ Includes walked-through example, real-world QA scenario & rule of thumb

Get the full answer on QAVeda →
3
Test Data

How do you manage test data at scale — typed factories, seed strategies, and teardown?

Hard-coded test data breaks the moment another parallel test edits the same record. The solution: each test creates exactly the data it needs, owns it for its lifetime, then cleans it up — regardless of…

↳ Includes walked-through example, real-world QA scenario & rule of thumb

Get the full answer on QAVeda →
4
Playwright

How do you design a type-safe custom Playwright reporter in TypeScript?

Playwright reporters receive lifecycle events as tests run and let you do anything with that data — post to Slack, write to a database, generate custom dashboards. You implement the Reporter interface and TypeScript enforces…

↳ Includes walked-through example, real-world QA scenario & rule of thumb

Get the full answer on QAVeda →
5
Declaration Files

How do you write a declaration file (.d.ts) for untyped JavaScript?

A .d.ts file is a pure type description — it contains no executable code, only the shapes of functions, classes, and values that a JavaScript module exports. TypeScript reads it to understand the module without…

↳ Includes walked-through example, real-world QA scenario & rule of thumb

Get the full answer on QAVeda →
6
Playwright

How do you implement Playwright fixtures for per-test authentication state isolation?

Re-authenticating before every test is slow and fragile. Playwright fixtures let you authenticate once per role, save that state to a file, then hand each test a fresh isolated browser context pre-loaded with the right…

↳ Includes walked-through example, real-world QA scenario & rule of thumb

Get the full answer on QAVeda →
7
Advanced Types

How do you simulate nominal typing (branded types)?

TypeScript uses structural typing — two types with the same shape are interchangeable, even if they represent semantically different things. A branded type adds a phantom property to a primitive (like number or string) that…

↳ Includes walked-through example, real-world QA scenario & rule of thumb

Get the full answer on QAVeda →
8
Advanced Types

How do you guarantee you handled every case of a union (exhaustiveness checking)?

Exhaustiveness checking is a TypeScript pattern that causes a compile error the moment you add a new variant to a discriminated union but forget to handle it somewhere. The mechanism: assign the unhandled value to…

↳ Includes walked-through example, real-world QA scenario & rule of thumb

Get the full answer on QAVeda →
9
Narrowing

What are assertion functions (`asserts x is T`)?

An assertion function is a function whose return type is declared as asserts x is T or asserts condition. When it returns normally (without throwing), TypeScript narrows the type for the rest of the calling…

↳ Includes walked-through example, real-world QA scenario & rule of thumb

Get the full answer on QAVeda →
10
TypeScript

How do you migrate a large JavaScript Playwright test suite to TypeScript incrementally?

Renaming every .js file to .ts and fixing all errors at once is impractical on a large suite. The right approach lets JS and TS coexist, tightens strictness file by file, and keeps the CI…

↳ Includes walked-through example, real-world QA scenario & rule of thumb

Get the full answer on QAVeda →
11
TypeScript

How do you configure TypeScript (tsconfig) correctly for a Playwright test project?

Playwright runs in Node.js and has its own type definitions. Getting tsconfig wrong produces "type not found" errors, broken path aliases, or slow CI builds. A few targeted settings give you maximum safety with minimum…

↳ Includes walked-through example, real-world QA scenario & rule of thumb

Get the full answer on QAVeda →
12
API Testing

How do you generate TypeScript types from an OpenAPI spec and use them for typed API contract testing?

When a backend publishes an OpenAPI spec, you can auto-generate TypeScript types from it — so your API tests always test against the actual contract. If the backend renames a field or changes a response…

↳ Includes walked-through example, real-world QA scenario & rule of thumb

Get the full answer on QAVeda →
13
Safety

TypeScript types are erased at runtime — how do you keep external data safe?

TypeScript types exist only at compile time — every interface, union, and type alias disappears completely in the compiled JavaScript. A value typed as User at compile time is just a plain JavaScript object at…

↳ Includes walked-through example, real-world QA scenario & rule of thumb

Get the full answer on QAVeda →
14
TypeScript

Walk me through how you debug a confusing TypeScript type error in a Playwright test file.

TypeScript error messages can be long and intimidating — pointing at the wrong line and burying the real cause. A systematic approach gets you to the root faster than re-reading the error.

↳ Includes walked-through example, real-world QA scenario & rule of thumb

Get the full answer on QAVeda →
15
Tooling

How do you configure tsconfig for a large project?

A large TypeScript project — whether a monorepo or a single large test suite — requires tsconfig to balance three competing concerns: maximum type safety, fast incremental build times, and maintainable import paths. The key…

↳ Includes walked-through example, real-world QA scenario & rule of thumb

Get the full answer on QAVeda →
🔓
You're reading previews.
Full answers with walked-through examples, real-world QA scenarios and rules of thumb are free on QAVeda.
Open QAVeda — it's free →
16
Playwright

How do you structure a large Playwright test project for a team of multiple QA engineers?

As the suite grows and more people contribute, an unstructured folder of spec files becomes a maintenance problem — duplicated selectors, clashing utilities, and no clear ownership. A deliberate structure makes tests easy to find,…

↳ Includes walked-through example, real-world QA scenario & rule of thumb

Get the full answer on QAVeda →
17
Playwright

How do you systematically diagnose and fix flaky tests in a Playwright TypeScript suite?

Flakiness is a symptom, not a root cause. The same "flaky" test can fail because of a timing gap, a test data collision, or state leaking from a previous test — treating all three the…

↳ Includes walked-through example, real-world QA scenario & rule of thumb

Get the full answer on QAVeda →
18
API Testing

How do you build a reusable type-safe API response validation helper for Playwright API tests?

Test files that manually check res.status() and body.field in every test become repetitive and miss edge cases — a 200 with the wrong body shape passes silently. A typed helper centralises both checks, enforces the…

↳ Includes walked-through example, real-world QA scenario & rule of thumb

Get the full answer on QAVeda →
19
TypeScript

How do you manage typed environment configuration — base URLs, credentials, feature flags — across multiple test environments?

Reaching for process.env.BASE_URL directly in test files is untyped and fragile — a missing variable silently becomes undefined and causes a confusing failure mid-test rather than a clear error at startup. A single typed config…

↳ Includes walked-through example, real-world QA scenario & rule of thumb

Get the full answer on QAVeda →
20
TypeScript

How do you build a type-safe generic retry helper for eventually-consistent operations in tests?

Some test operations can't use Playwright's built-in auto-wait — polling an external email service, waiting for a database record to be committed, or checking a webhook delivery. A typed generic retry helper handles these cases…

↳ Includes walked-through example, real-world QA scenario & rule of thumb

Get the full answer on QAVeda →
21
CI/CD

How do you design a TypeScript-aware CI pipeline for a Playwright test suite?

A naive pipeline that just runs npx playwright test skips type checking entirely — broken types ship silently. A properly designed pipeline fails fast on type errors, runs tests in parallel shards, and produces one…

↳ Includes walked-through example, real-world QA scenario & rule of thumb

Get the full answer on QAVeda →
22
Migration

How would you migrate a large JavaScript codebase to TypeScript?

At senior level, migrating a large JavaScript codebase to TypeScript is a team coordination problem as much as a technical one. The technical approach is always incremental — never a big-bang rewrite — but the…

↳ Includes walked-through example, real-world QA scenario & rule of thumb

Get the full answer on QAVeda →
23
Playwright

How do you test multi-user scenarios — where two roles interact simultaneously — in Playwright?

Some features only work correctly when two users are active at the same time — a sender and a recipient in a chat, an approver and a submitter in a workflow, or a buyer and…

↳ Includes walked-through example, real-world QA scenario & rule of thumb

Get the full answer on QAVeda →
24
Language Features

What are decorators, and where are they used?

Decorators are a TypeScript (and JavaScript stage 3) feature that lets you annotate or modify a class, method, property, or parameter with @decoratorName syntax. At runtime, the decorator is a function that receives the decorated…

↳ Includes walked-through example, real-world QA scenario & rule of thumb

Get the full answer on QAVeda →
25
Advanced Types

How do you type recursive or nested structures like JSON or a tree?

A recursive type is a type that references itself in its own definition. TypeScript supports this natively for interface and type alias definitions. It's essential for typing structures of arbitrary depth — JSON blobs, tree-shaped…

↳ Includes walked-through example, real-world QA scenario & rule of thumb

Get the full answer on QAVeda →
26
Types

When do you use `satisfies` vs `as` vs a plain type annotation?

These three constructs all involve telling TypeScript about a value's type, but they make fundamentally different promises — about safety, widening, and what TypeScript trusts you to know. Choosing the wrong one either loses type…

↳ Includes walked-through example, real-world QA scenario & rule of thumb

Get the full answer on QAVeda →
27
Playwright

How do you integrate performance assertions — page load times and Core Web Vitals — into a Playwright TypeScript suite?

Performance isn't just a monitoring concern — you can assert budget thresholds directly in Playwright tests so a slow page fails CI the same way a broken button does.

↳ Includes walked-through example, real-world QA scenario & rule of thumb

Get the full answer on QAVeda →
28
Playwright

How do you implement visual regression testing in a Playwright TypeScript suite?

Visual regression testing catches unexpected UI changes that functional tests miss — a CSS tweak that shifts a button, a font that fails to load, or a layout that breaks at a specific viewport. Playwright…

↳ Includes walked-through example, real-world QA scenario & rule of thumb

Get the full answer on QAVeda →
29
Playwright

How do you handle OAuth 2.0 and SSO authentication flows in Playwright tests?

OAuth and SSO redirect the browser to an external identity provider (Google, Azure AD, Okta) before returning to your app. Automating the real identity provider is fragile — account lockout policies, 2FA, and rate limits…

↳ Includes walked-through example, real-world QA scenario & rule of thumb

Get the full answer on QAVeda →
30
Playwright

How do you design a cross-browser and mobile testing strategy with Playwright?

Running every test in every browser on every device is slow and expensive — and provides diminishing returns. The goal is meaningful coverage at a manageable runtime: the right tests in the right browsers, not…

↳ Includes walked-through example, real-world QA scenario & rule of thumb

Get the full answer on QAVeda →
🔓
You're reading previews.
Full answers with walked-through examples, real-world QA scenarios and rules of thumb are free on QAVeda.
Open QAVeda — it's free →
31
Advanced Types

When do you write a custom utility type and what makes a good one?

Write a custom utility type when a transformation you need recurs across the codebase and no built-in utility expresses it cleanly. The bar should be high: if it's only needed once, inline it; if it's…

↳ Includes walked-through example, real-world QA scenario & rule of thumb

Get the full answer on QAVeda →
32
Playwright

How do you design an accessibility (a11y) testing strategy using Playwright and TypeScript?

Accessibility testing verifies that your application is usable by people with disabilities — screen readers, keyboard navigation, and colour contrast. Playwright integrates with axe-core to automate WCAG checks, but automated tools catch only ~30–40% of…

↳ Includes walked-through example, real-world QA scenario & rule of thumb

Get the full answer on QAVeda →
33
Safety

What are the most subtle TypeScript bugs you have encountered in real projects and how did you fix them?

Subtle TypeScript bugs are the ones that compile cleanly, pass the type checker, look reasonable on code review — and then fail at runtime with a cryptic error. They're almost always caused by one of…

↳ Includes walked-through example, real-world QA scenario & rule of thumb

Get the full answer on QAVeda →
34
Test Data

How do you manage database state in end-to-end tests — setup, isolation, and cleanup?

E2E tests that share a database without isolation are the most common cause of brittle, order-dependent test suites. The goal: every test starts with a known state, owns its data exclusively, and leaves no side…

↳ Includes walked-through example, real-world QA scenario & rule of thumb

Get the full answer on QAVeda →
35
Security Testing

How do you approach security testing in a Playwright suite — authentication bypass, authorization, and input validation?

Security testing in an automated suite means verifying that your access controls, session handling, and input validation work as designed — not waiting for a penetration test to find them in production. Most of this…

↳ Includes walked-through example, real-world QA scenario & rule of thumb

Get the full answer on QAVeda →
36
Leadership

What do you look for in a TypeScript code review from a senior perspective?

A TypeScript code review at senior level goes beyond style and formatting. The real value is catching patterns that compile cleanly but create runtime risk, reviewing whether the type system is actually providing safety or…

↳ Includes walked-through example, real-world QA scenario & rule of thumb

Get the full answer on QAVeda →
37
API Testing

How do you test a GraphQL API using Playwright and TypeScript?

Playwright's request fixture works perfectly for GraphQL — all queries go to a single endpoint via POST. The challenge is keeping tests readable and typed against the schema so a breaking schema change surfaces as…

↳ Includes walked-through example, real-world QA scenario & rule of thumb

Get the full answer on QAVeda →
38
Playwright

How do you build a Playwright suite that tests both the REST API and the UI in the same framework?

Running API and UI tests in the same framework eliminates tool-switching, lets you share fixtures and auth state across both layers, and enables hybrid tests that set up state via API and verify the result…

↳ Includes walked-through example, real-world QA scenario & rule of thumb

Get the full answer on QAVeda →
39
Playwright

How do you mock network requests and record API responses in Playwright tests?

Request interception lets you control what the app receives from the network — returning fixed responses, simulating errors, or replaying recorded real responses — without running a separate mock server.

↳ Includes walked-through example, real-world QA scenario & rule of thumb

Get the full answer on QAVeda →
40
Leadership

How do you onboard a team of engineers who know JavaScript but not TypeScript?

TypeScript onboarding fails when it's presented as "JavaScript but with errors." The goal is to change the mental model — TypeScript isn't about adding syntax; it's about making the editor and compiler do work that…

↳ Includes walked-through example, real-world QA scenario & rule of thumb

Get the full answer on QAVeda →
41
Playwright

How do you monitor and report on test suite health — flakiness, execution time, and pass rate trends over time?

A healthy test suite needs the same observability as a production service. Without metrics you don't know whether the suite is getting slower, which tests are flaky, or whether a flakiness-fixing sprint actually worked.

↳ Includes walked-through example, real-world QA scenario & rule of thumb

Get the full answer on QAVeda →
42
Playwright

How do you test file uploads and downloads in Playwright TypeScript tests?

File uploads and downloads are common in enterprise apps but have Playwright-specific mechanics that catch engineers out the first time.

↳ Includes walked-through example, real-world QA scenario & rule of thumb

Get the full answer on QAVeda →
43
Playwright

How do you test complex UI interactions — drag and drop, iframes, and shadow DOM — in Playwright TypeScript?

These interactions trip up most testing tools. Playwright has first-class support for all three, but each has its own mechanics.

↳ Includes walked-through example, real-world QA scenario & rule of thumb

Get the full answer on QAVeda →
44
Design

What is your philosophy on how much type complexity is too much in TypeScript?

Type complexity is a resource — like code complexity, it should be spent where it returns the most value and minimised everywhere else. The problem is that TypeScript's type system is Turing-complete, which means there's…

↳ Includes walked-through example, real-world QA scenario & rule of thumb

Get the full answer on QAVeda →
45
Architecture

How do you use TypeScript interfaces to define and maintain API contracts shared across frontend and backend teams?

A shared TypeScript contract package puts the API's request and response shapes in a single version-controlled source of truth. Every consumer — backend controller, frontend client, and test suite — imports from that package. When…

↳ Includes walked-through example, real-world QA scenario & rule of thumb

Get the full answer on QAVeda →
🔓
You're reading previews.
Full answers with walked-through examples, real-world QA scenarios and rules of thumb are free on QAVeda.
Open QAVeda — it's free →
46
TypeScript

How do you share Playwright test utilities, fixtures, and types across multiple apps in a TypeScript monorepo?

In a monorepo with multiple apps, you want shared auth fixtures, API clients, and data factories without duplicating code. The pattern: one shared package that any app can import, with each app extending it for…

↳ Includes walked-through example, real-world QA scenario & rule of thumb

Get the full answer on QAVeda →
47
Advanced Types

How do you use TypeScript to enforce that certain async operations are not accidentally awaited twice or missed?

A "floating promise" is an async operation that runs but nobody waits for the result — so if it fails, the error disappears silently. TypeScript plus two lint rules can catch both this problem and…

↳ Includes walked-through example, real-world QA scenario & rule of thumb

Get the full answer on QAVeda →
48
Playwright

How do you test WebSocket and Server-Sent Events (SSE) connections in Playwright TypeScript tests?

Real-time features — live notifications, chat, dashboards that update without a refresh — need a different testing approach than standard request/response. Playwright has specific APIs for intercepting and verifying both WebSocket frames and SSE streams.

↳ Includes walked-through example, real-world QA scenario & rule of thumb

Get the full answer on QAVeda →
49
API Testing

How do you set up contract testing between services using TypeScript — consumer-driven contracts and shared schema validation?

Integration tests catch when two services disagree on their API contract, but running the full system just to check that is slow and brittle. Contract testing decouples the two sides: the consumer records what it…

↳ Includes walked-through example, real-world QA scenario & rule of thumb

Get the full answer on QAVeda →
50
Leadership

How do you build a culture of TypeScript quality — strict types, runtime validation, and type testing — across multiple engineering teams?

TypeScript quality culture means teams automatically reach for strict types, runtime validation, and type tests — not because they're required, but because they've seen the bugs that happen without them.

↳ Includes walked-through example, real-world QA scenario & rule of thumb

Get the full answer on QAVeda →
Don't just read. Practice.
QAVeda has full answers with walked-through examples, 200+ structured lessons, Mastery Trial quizzes and certificates — all gamified with XP, badges and ranks.
Start for Free on QAVeda →
Free · No credit card required