Skip to content

Boarding pass · TypeScript Beginner

TypeScript · Beginner interview

An AI mock interview for developers new to TypeScript (0–2 years). Practise the type system basics — annotations, interfaces, unions, simple generics — and the tooling that makes it work, out loud with a readiness score.

20–30 minEstimated6 questionsTailored live12 model answersTo study
  • Voice interview
  • Live feedback
  • Browser-only
  • No installation required

Your report · sample

AI Readiness Score

/100
Content score English score

Finish the mock and get this report — scored on content and English, with concrete tips and a model answer for every question, plus a study plan.

Your flight path

Five steps to interview-ready.

From a quick warm-up to a personalised study plan — here's the whole loop, and what you get at each gate.

  1. Step 01

    Preparation

    Skim the topics and warm up — you're briefed before takeoff.

  2. Step 02

    AI Interview

    A realistic AI interviewer asks tailored questions — answer by voice or text.

  3. Step 03

    Instant Score

    Finish and get a 0–100 readiness score across content and English.

  4. Step 04

    AI Feedback

    Concrete tips and a rewritten model answer for every response.

  5. Step 05

    Study Plan

    A personalised plan targets your weakest areas — so the next run scores higher.

Preview the AI demo

See one answer scored, end to end.

The whole loop on sample data — question, your answer, instant feedback and a study plan. Hover to pause.

aevrofy.com/session · live demoPlaying

Interviewer · Question 1

“Tell me about yourself.”

Who it's for

  • JavaScript developers adopting TypeScript
  • Developers new to static typing
  • Anyone targeting junior roles that use TS
  • Self-taught devs prepping for interviews

What you'll practice

  • Annotating variables, functions and objects
  • interface vs type, unions and intersections
  • any vs unknown vs never
  • tsconfig, strict mode and declaration files

Topics covered

What this level expects.

Basics

  • What TS is
  • Compile-time vs runtime
  • any / unknown / never

Types & interfaces

  • interface vs type
  • Unions & intersections
  • Optional & readonly

Functions & generics

  • Typing functions
  • Generics intro
  • Type inference

Tooling

  • tsconfig & strict
  • Declaration files
  • Basic narrowing

Practice questions

12 questions, with model answers.

Read them, then run the live mock to answer out loud and get scored. Tap any question to reveal a model answer.

01What is TypeScript and what does it give you over JavaScript?

TypeScript is a superset of JavaScript that adds static types checked at compile time, then compiles down to plain JavaScript. It catches type errors, typos, and null mistakes before you run the code, and powers editor features like autocomplete and safe refactoring. You get JavaScript's flexibility plus a safety net and better tooling on large codebases.

02What happens to TypeScript types at runtime?

Nothing — types are erased during compilation. The emitted JavaScript has no interfaces or type annotations, so you can't check a TypeScript type at runtime the way you'd think (typeof still works on values, but an interface doesn't exist). If you need runtime validation, you use a library like Zod or write manual checks; the type system only protects you at compile time.

03What's the difference between any, unknown, and never?

any opts out of type checking entirely — anything goes, which defeats the purpose. unknown is the safe counterpart: it accepts any value but forces you to narrow or check it before using it. never is the empty type — a value that can't exist, used for things like a function that always throws or the exhaustive default of a union. Prefer unknown over any, and use never to prove exhaustiveness.

04When do you use an interface versus a type alias?

Both describe object shapes and are mostly interchangeable. interface is open — it supports declaration merging and is conventional for public object/class contracts. type is more flexible: it can also alias unions, intersections, tuples, primitives, and mapped/conditional types. A common rule: interface for object/class shapes, type when you need unions or other non-object types.

interface User { id: string; name: string }
type Status = "active" | "banned";
05What are union and intersection types?

A union (A | B) means a value is one of several types — e.g. string | number — and you must narrow it before using type-specific operations. An intersection (A & B) combines types so a value must satisfy all of them at once, often used to merge object shapes. Union is 'either/or'; intersection is 'both'.

06What do optional and readonly properties mean?

An optional property (name?: string) may be absent, so its type includes undefined and you must handle that case. A readonly property can be set when the object is created but not reassigned afterward, which the compiler enforces. Both are compile-time guarantees that document intent and prevent whole classes of mistakes.

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

You annotate each parameter and, optionally, the return type after the parameter list. TypeScript can usually infer the return type, but annotating it on public functions documents intent and catches mistakes where the body returns the wrong thing.

function add(a: number, b: number): number {
  return a + b;
}
08What is a generic and why would you use one?

A generic is a type parameter that lets a function or type work with many types while preserving the relationship between them. For example, an identity function typed <T>(x: T): T returns exactly the type it was given, instead of any. You use generics to write reusable, type-safe code — like a container or a function that maps over an array — without losing type information.

function first<T>(arr: T[]): T | undefined {
  return arr[0];
}
09What is type inference in TypeScript?

Inference is TypeScript working out a type you didn't write. If you say let n = 5, it infers number; map and filter infer element types; a function's return type is inferred from its body. Good TypeScript leans on inference for locals and annotates the boundaries — function parameters and public APIs — where inference can't help.

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

tsconfig.json configures the compiler — which files to include, the target JS version, module system, and type-checking options. strict turns on a bundle of stricter checks at once, most importantly strictNullChecks (null/undefined must be handled) and noImplicitAny (no silent any). Starting strict is strongly recommended; loosening later is harder than tightening.

11What are .d.ts declaration files and the @types packages?

A .d.ts file contains type declarations with no implementation — it describes the shape of existing JavaScript so TypeScript can check code that uses it. Many libraries ship their own; for those that don't, the community publishes types as @types/<package> on npm (DefinitelyTyped). Installing @types/node, for instance, gives you typings for Node's built-in modules.

12How does narrowing with typeof or instanceof work?

Inside a conditional, TypeScript narrows a union to a more specific type based on a runtime check. typeof x === 'string' narrows x to string in that branch; instanceof narrows to a class; a truthiness check removes null/undefined. This lets you safely use type-specific methods after proving the type.

function len(x: string | string[]) {
  return typeof x === "string" ? x.length : x.length;
}

Preparation tips

Walk in ready.

  • Turn on strict mode and learn what each error means
  • Practise typing a function's params and return
  • Know why types disappear at runtime
  • Use unknown instead of any when you're unsure

Ready for the real thing?

Run a 6-question TypeScript mock interview, answer out loud, and get a readiness score with tips and model answers.

More beginner interviews

Aevrofy · TypeScript beginner interview prep