Skip to main content
HireStepX is now in Beta! Be among the first to practice smarter and land your dream role.
Technical

TypeScript Interview Questions for Indian Developers 2026

Types vs interfaces, generics, utility types, strict mode, and TypeScript with React: asked at Razorpay, Flipkart, and Indian startups in 2026.

General12 March 202612 min read5 sections

TypeScript has become the default for frontend and increasingly backend development at Indian product companies in 2026. Razorpay, PhonePe, Flipkart, and most tech-forward Indian startups now write TypeScript by default. This guide covers the TypeScript interview questions you will encounter at these companies: from type fundamentals to generics and the practical patterns that distinguish strong TypeScript engineers.

5 sections

TypeScript is a superset of JavaScript that adds static typing. Every valid JavaScript is valid TypeScript, but TypeScript adds type annotations that are checked at compile time and stripped at runtime. The core value proposition: catching type errors at development time rather than at runtime. Basic types: string, number, boolean, null, undefined, void (for functions returning nothing), never (for functions that never return: throw or infinite loop), any (escape hatch: avoid in production code), unknown (type-safe alternative to any: must narrow before use). Primitive literals: 'red' | 'green' | 'blue' is a union of string literals: more precise than just string. The difference between null and undefined: null is explicitly 'no value', undefined is 'not assigned'. TypeScript's strictNullChecks (part of strict mode) prevents assigning null to a variable typed as string unless explicitly allowed with string | null.

The type vs interface question appears in nearly every TypeScript interview. Both define object shapes. Key differences: Interfaces can be extended with extends and can be merged (declaration merging: two interface declarations with the same name merge their properties). Types use intersection (&) for composition and cannot be merged. Types are more flexible: they can represent union types (A | B), intersection types (A & B), mapped types, and conditional types: things interfaces cannot express. Interface: best for defining the shape of objects and class contracts (implements), especially when you want extendability and declaration merging. Type: best for unions, intersections, computed/mapped types, and aliases for primitives. The honest answer in an interview: 'I prefer interface for objects and type for everything else, unless I need a union or computed type.' Both are acceptable in most codebases.

Generics allow writing reusable code that works across types. The classic example: function identity<T>(arg: T): T { return arg; }: the function accepts any type and returns that same type, preserving type information. Where generics shine: utility functions (pick, omit, filter), data structures (Stack<T>, Queue<T>), API response wrappers (ApiResponse<T extends object>), and React component props. Constraints: function longest<T extends { length: number }>(a: T, b: T): T: T must have a length property. Multiple type parameters: function zip<A, B>(a: A[], b: B[]): [A, B][]: pairs elements from two arrays. Generic interfaces: interface Repository<T> { findById(id: string): Promise<T>; save(entity: T): Promise<T>; }: the Repository pattern typed generically. Common interview question: 'Write a generic function that extracts a specific property from an array of objects': uses keyof T constraint.

TypeScript's built-in utility types are heavily tested. Partial<T>: makes all properties of T optional. Required<T>: makes all properties required. Readonly<T>: makes all properties read-only (prevents mutation). Pick<T, K>: creates a type with only the specified keys from T. Omit<T, K>: creates a type excluding the specified keys. Record<K, V>: creates an object type with keys of type K and values of type V. ReturnType<T>: extracts the return type of a function type. Parameters<T>: extracts the parameter types of a function as a tuple. NonNullable<T>: removes null and undefined from T. Awaited<T>: unwraps the type of a Promise. The practical interview question: 'How would you create a type for a form that makes all fields optional for a partial update (PATCH) request?': answer: Partial<FormSchema>.

Beyond syntax, Indian product company interviews test practical TypeScript judgment. Strict mode: always enable strict in tsconfig.json (strictNullChecks, noImplicitAny, strictFunctionTypes). Non-strict TypeScript is only marginally better than JavaScript. Type narrowing: using typeof, instanceof, 'key' in obj, and custom type guards (function isCat(animal: Animal): animal is Cat) to narrow union types. Discriminated unions: a pattern for exhaustive type checking: each union member has a unique literal 'kind' or 'type' field that TypeScript uses to narrow. Type assertion vs type casting: as SomeType is an assertion (you are telling TypeScript you know better); use only when you have information the compiler doesn't. Avoid as any and as unknown as T: they silence the type system entirely. Declaration files (.d.ts): how to type third-party libraries that don't include TypeScript definitions.

Frequently asked questions

Is TypeScript required for frontend jobs in India in 2026?

At established product companies (Flipkart, Razorpay, Swiggy, PhonePe): TypeScript is the default and expected. At startups: varies: many use TypeScript, some use JavaScript. Service IT companies (TCS, Infosys): TypeScript is not required for most roles. If you know React in JavaScript, learning TypeScript adds significant employability.

How long does it take to learn TypeScript if I know JavaScript?

Basic TypeScript (types, interfaces, generics basics): 2-3 weeks of focused learning. Proficient TypeScript (advanced generics, utility types, strict mode): 2-3 months of daily use. The fastest path: enable TypeScript in a project you are already building in JavaScript and fix the type errors incrementally.

What TypeScript topics are tested at FAANG India vs Indian startups?

FAANG India: advanced generics, conditional types, mapped types, strict mode, discriminated unions. Indian product unicorns: interfaces, generics basics, utility types, TypeScript with React, strict null checks. Startups: type annotation basics, interface vs type, any vs unknown. Calibrate your depth to your target company tier.

Do I need to know TypeScript for backend Node.js roles in India?

Increasingly yes: most serious Node.js codebases at Indian product companies use TypeScript. Express + TypeScript, NestJS (TypeScript-first framework), and tRPC are all TypeScript-native. For service IT or older Node.js codebases: JavaScript knowledge is sufficient.

Explore more

Continue reading

All posts

Practice

Know the answer. Now say it.

TypeScript interviews test how you reason about types under pressure. Practise explaining your type decisions out loud with HireStepX before your frontend interview.