Complete Node.js, Express.js & TypeScript Backend Course Online Mock Test (Free 50-MCQ Topic Practice)
Select any course and syllabus topic below to launch a timed topic MCQ engineering exam (up to 2 free attempts per topic daily) with instant code-level explanations.
Timed code-output & architecture MCQs with instant scorecard. Want spoken viva practice too?
Select Any IT Course (21 Courses • 100% Topics Covered)
Complete Node.js, Express.js & TypeScript Backend Course — Topic-Wise Mock Tests
Expand any module below to start a live timed MCQ exam across 170 Mock Test sets (max 2 free attempts per topic per day).
All Modules & Topics in Complete Node.js, Express.js & TypeScript Backend Course
Conditional Statements and Guard Clauses
`if / else if / else`, early-return guard clauses flattening nested arrow-antipatterns, and exhaustive `switch...
Loops: for, while, do-while, for...of and for...in
Indexed `for`, condition-driven `while`/`do-while`, iterable `for...of` (`Array`, `Map`, `Set`, `String`), why...
Strings and String Methods
Immutable UTF-16 strings, `slice`, `trim`, `toLowerCase`, `includes`, `startsWith`, `split`/`join`, `replaceAl...
Arrays and Functional Array Methods
Mutating (`push`, `pop`, `splice`, `sort`) vs non-mutating ES2023+ (`toSorted`, `map`, `filter`, `reduce`, `fi...
Objects and Object Manipulation
Object literals, computed keys `[key]`, dynamic property lookup (`Object.hasOwn(obj, key)`), `Object.keys`, `O...
Functions, Parameters and Return Values
First-class functions, arity, default parameter expressions (evaluated per call!), rest parameters `(...items)...
Function Declarations, Expressions and Arrow Functions
Hoisted declarations vs `const fn = function() {}` expressions vs concise `=>` arrow functions (lexical `this`...
Scope and Hoisting
Global, module, function, and `{}` block scopes, scope-chain resolution, function declaration hoisting vs `let...
Execution Context and the Call Stack
Global & Function Execution Contexts (Creation Phase vs Execution Phase), Variable Environment, Lexical Enviro...
Lexical Scope and Closures
How inner functions retain live references to outer lexical environments even after the outer function returns...
The this Keyword and Binding Rules
4 `this` binding rules in priority order: (1) `new` binding, (2) explicit `call`/`apply`/`bind`, (3) implicit...
call(), apply() and bind()
Invoking functions immediately with explicit `this` (`fn.call(ctx, a, b)` vs `fn.apply(ctx, argsArray)`) vs cr...
Prototypes and Prototypal Inheritance
`Object.getPrototypeOf()`, `Fn.prototype` vs instance `[[Prototype]]`, property lookup delegation along the pr...
Constructor Functions and ES6 Classes
How `new` works in 4 steps (create object -> link `[[Prototype]]` -> bind `this` -> return object) and modern...
Object-Oriented Programming in JavaScript
Modelling cohesive backend entities, value objects, services, and repositories with clear responsibilities rat...
Inheritance and Polymorphism
`extends`, `super()`, method overriding, polymorphic dispatch across notification/payment strategies (`EmailNo...
Encapsulation (#private Fields) and Abstraction
True runtime-enforced ECMAScript `#private` fields & `#private` methods (inaccessible even via `Object.keys` o...
Object and Array Destructuring
Nested destructuring, property aliasing (`{ user_id: userId }`), default values (`= 20` triggered ONLY on `und...
TypeScript Introduction, Installation and Build/Run Workflow
Static structural type system + full type erasure at runtime, installing `typescript` + `@types/node`, running...
Type Annotations and Type Inference
When TypeScript infers local constants/variables cleanly vs why explicit parameter and public function/method...
Primitive and Special Types: unknown, never, void and any
Why `unknown` is the type-safe top type (forces narrowing before property access!) vs unsafe `any` (disables t...
Typed Arrays, Readonly Arrays, Tuples and Enums vs Const Unions
`string[]`, `readonly string[]` (prevents accidental `.push()`/`.sort()` mutation!), fixed-position tuples `[n...
Function Types, Call Signatures and Overloads
Function type aliases `(req: AuthReq) => Promise<ResponseDto>`, callback typing, and function overload signatu...
Optional and Default Parameters in TypeScript
`limit?: number` (`number | undefined`) vs `limit = 20` (`number`), ordering required params before optional p...
Union and Intersection Types + Discriminated Unions
Tagged **Discriminated Unions** (`type Result<T, E = string> = { ok: true; data: T } | { ok: false; error: E }...
Type Aliases vs Interfaces
Structural compatibility, `interface` `extends` & declaration merging (needed for augmenting `Express.Request....
Type Narrowing and Custom Type Guards
Control-flow narrowing (`typeof`, `instanceof`, `"code" in err`, `Array.isArray`), user-defined type predicate...
Literal Types and Template Literal Types
Exact literal types (`HttpMethod = "GET" | "POST" | "PUT" | "PATCH" | "DELETE"`), template literal types (``Ev...
Generics and Generic Constraints
Type parameters `<T>`, `<K, V>`, constraining `<T extends { readonly id: string }>`, and default generic param...
Generic Functions, Interfaces and Classes
Designing `interface Repository<T, CreateInput, UpdateInput>` implemented identically by `InMemoryRepo` (unit...
Classes and Access Modifiers in TypeScript
Constructor parameter properties (`constructor(private readonly repo: UserRepo) {}`), `public` / `private` / `...
Inheritance and Abstract Classes
`abstract class BaseRepository<T>` sharing common pagination/logging helpers while enforcing `protected abstra...
Interfaces with Classes (Dependency Inversion)
`class RedisCacheService implements CachePort`, programming Services against `CachePort` / `MailPort` interfac...
Utility Types: Partial, Pick, Omit, Record, Required, Readonly
Deriving `PublicUser = Omit<UserEntity, "passwordHash">`, `UpdateEmployeeDto = Partial<Pick<Employee, "departm...
Introduction to Node.js and Backend Engineering Strengths
Why event-driven non-blocking Node.js excels at I/O-intensive REST APIs, API gateways, real-time WebSockets, a...
Installing Node.js LTS, Version Managers and Lockfile Discipline
Active LTS releases (Node 22 LTS), `.nvmrc` / `"engines": { "node": ">=22.0.0" }`, semantic versioning (`^` vs...
Node.js Layered Runtime Architecture
4-layer stack: Your TypeScript/JS App -> Node.js Standard Library (`node:fs`, `node:http`) -> C++ Node Binding...
V8 JavaScript Engine Internals
Parsing AST -> `Ignition` bytecode interpreter -> profiling hot functions -> `Sparkplug`/`Maglev`/`TurboFan` o...
libuv and Asynchronous I/O Delegation
How `libuv` routes TCP/HTTP sockets directly to non-blocking OS kernel multiplexers (`epoll` on Linux, `kqueue...
Single-Threaded JS Execution Model and Event-Loop Safety
Why shared-memory mutex races disappear in single-threaded JS, YET logical async interleaving races (`read bal...
Event-Driven Architecture in Node.js
Observer pattern across Node servers, sockets, streams, and domain buses (`server.on("request")`, `stream.on("...
Non-Blocking vs Blocking I/O in Practice
`fs.readFileSync` / `crypto.pbkdf2Sync` / `execSync` (acceptable ONLY once before `server.listen()` at cold bo...
CommonJS Module System Internals
How Node wraps CJS files `(function(exports, require, module, __filename, __dirname) { ... })`, synchronous lo...
ES Module System in Node.js
`"type": "module"` in `package.json`, `.mjs`/`.cjs` explicit extensions, asynchronous 3-phase loading (`Constr...
Module Exports, Imports and Subpath Exports
Named exports (preferred for refactoring & explicit contracts) vs default exports, and `package.json` `"export...
Module Resolution and Singleton Caching
How Node caches evaluated modules by resolved real file path (case-sensitivity trap: `./User.js` vs `./user.js...
File System Module (node:fs/promises)
`readFile`, `writeFile`, atomic temp-write + `rename`, `mkdir({ recursive: true })`, `stat`, `opendir` async d...
Path Module and Directory Traversal Defense (node:path)
`path.join`, `path.resolve`, `path.basename`, `path.extname`, `path.sep` (`\` vs `/`), and verifying `resolved...
OS Module Diagnostics (node:os)
`os.availableParallelism()` (cgroup/container-aware CPU count in Node 19.4+ — better than `os.cpus().length` i...
Raw HTTP and HTTPS Modules (node:http / node:https)
Building a framework-free `http.createServer((req, res) => ...)` understanding `IncomingMessage` (Readable str...
Events and Typed EventEmitter (node:events)
`on`, `once`, `off`, `emit` (synchronous listener invocation!), special `"error"` event (crashes process if un...
Introduction to Express.js and Minimalist Request Pipeline
How Express wraps `node:http` with routing tables, `req`/`res` prototype helpers, and a linear middleware stac...
Express Installation, TypeScript Types and Express 5 Readiness
Installing `express` + `@types/express`, strict `tsconfig.json`, and how Express 5 automatically forwards reje...
Creating an HTTP Server Cleanly (app.ts vs server.ts)
Wiring `const server = http.createServer(app)` with explicit `keepAliveTimeout` (`65s` > Nginx/ALB `60s` idle...
Scalable Express Application Folder Structure
Feature-first modular layout: `src/modules/employees/{employee.routes.ts, employee.controller.ts, employee.ser...
Routing and Route Parameters (req.params)
Route methods (`get`, `post`, `put`, `patch`, `delete`), `:id` parameters, route registration order (specific...
Query Parameters and Safe Coercion (req.query)
Why every `req.query.*` arrives as `string | string[] | ParsedQs | undefined` (`?role=a&role=b` becomes an ARR...
Express Request and Response Objects
`req.headers`, `req.get("Idempotency-Key")`, `req.ip`, `res.status(201).location(...).json(...)`, `res.set()`,...
Request Body Parsing and Payload Size Limits
`express.json({ limit: "100kb", strict: true })`, `express.urlencoded({ extended: false, limit: "100kb" })`, a...
Middleware Architecture and Execution Order
Exact production middleware order: (1) `requestId` + `pino-http` logger -> (2) `helmet` + `cors` -> (3) Rate l...
REST Principles and Resource Modelling
Turning imperative business actions (`"promote employee"`, `"deactivate account"`, `"issue refund"`) into clea...
REST vs RPC (gRPC / tRPC) Trade-Offs
When public/partner/CRUD HTTP resource APIs favor REST + OpenAPI vs when ultra-low-latency internal service-to...
Resource Naming Conventions
Lowercase kebab-case plural nouns (`/api/v1/purchase-orders`, never `/getPurchaseOrders` or `/Purchase_Order`)...
HTTP Methods and Idempotency Keys
Natural idempotency of `GET`, `PUT`, `DELETE` vs non-idempotent `POST` — and making `POST /orders` or `POST /p...
Status Codes and Actionable Error Contracts
Machine-parsable `error.code` (`EMAIL_ALREADY_EXISTS`, `DEPARTMENT_HAS_ACTIVE_EMPLOYEES`), human `message`, `r...
Request and Response DTO Contracts
Strict separation between `EmployeeCreateRequest`, `EmployeeDbRecord`, and `EmployeeResponse` (never exposing...
API Versioning Strategies in Production
URI prefix (`/api/v1`) vs Header (`Api-Version: 2026-01-01`), shared domain services serving both `v1Controlle...
Pagination Strategies: Offset vs Keyset Cursor
Why `OFFSET 100000 LIMIT 20` scans & discards `100,000` rows (`O(offset)` latency + skipped/duplicate rows on...
Filtering and Sorting Contract Design
Consistent filter query grammar (`status=ACTIVE`, `minSalary=50000`, `joinedAfter=2025-01-01`) and multi-colum...
Database Fundamentals: Storage Engines, Durability and Workload Fit
OLTP vs OLAP, write-ahead journaling, read/write amplification, working-set RAM sizing, and access-pattern ana...
SQL vs NoSQL Architectural Trade-Offs
Relational ACID tables (schema-on-write, arbitrary ad-hoc joins, foreign keys) vs Document/Key-Value/Wide-Colu...
MongoDB WiredTiger Architecture
WiredTiger cache (~50% of available RAM), document-level concurrency control, snappy/zstd block compression, `...
Databases, Collections and 16 MB BSON Documents
Dynamic vs JSON-Schema validated collections (`validator: { $jsonSchema: ... }`), `_id` immutability, and the...
BSON Data Types in Depth
12-byte `ObjectId` (`4B timestamp + 5B random + 3B counter` — naturally roughly time-ordered!), `Int32`/`Int64...
MongoDB Local & Docker Installation + mongosh
Running `mongo:7` in Docker with a single-node replica set (`--replSet rs0`, required locally to test multi-do...
MongoDB Atlas Fundamentals
Replica-set `M0/M10+` clusters, `mongodb+srv://` DNS seedlist connection strings, SCRAM auth, IP/VPC peering a...
MongoDB Compass Visual Explain & Schema Profiling
Inspecting document schema distributions, index usage hit counts, and visual Explain Plans (`Keys Examined` vs...
Introduction to Mongoose ODM vs Native MongoDB Driver
What Mongoose adds (schema enforcement, TypeScript inference, middleware hooks, population, query builders) vs...
Connecting Node.js to MongoDB Resiliently
`mongoose.connect(uri, { maxPoolSize: 20, serverSelectionTimeoutMS: 5000, socketTimeoutMS: 45000, autoIndex: !...
Mongoose Schema Definition and Strict Mode
`new Schema<IProduct>({ ... }, { strict: "throw", timestamps: true, versionKey: "__v" })` rejecting undeclared...
Models and Hydrated Documents
`model<IProduct>("Product", ProductSchema)`, model collection pluralization (`collection: "products"` explicit...
SchemaTypes and Built-In Validation
`String` (`trim`, `lowercase`, `minLength`, `maxLength`, `enum`, `match`), `Number` (`min`, `max`), `Boolean`,...
Required, Conditional and Custom Validators
Custom `validate: { validator: (v) => ..., message: ... }` functions, SKU format checks, and why uniqueness (`...
Default Values, Immutable Fields and Timestamps
Function defaults (`default: () => randomUUID()` vs static value trap!), `immutable: true` (`tenantId`, `creat...
Instance Methods, Static Methods and Query Helpers
Adding domain methods on `schema.methods` (`function` keyword — NEVER arrow `() =>` which loses `this`!), `sch...
Mongoose Middleware and Hooks Architecture
4 distinct middleware types: **Document** (`validate`, `save`, `deleteOne`), **Query** (`find`, `findOneAndUpd...
Relational Database Concepts
Relations (tables), tuples (rows), attributes (columns), domains, set-based declarative SQL vs imperative loop...
PostgreSQL Architecture (MVCC, Shared Buffers & WAL)
Client backend processes, `shared_buffers` page cache, Multi-Version Concurrency Control (**MVCC**: readers ne...
Database, Schema and Table Creation (DDL)
`CREATE SCHEMA`, `CREATE TABLE`, `GENERATED ALWAYS AS IDENTITY` (modern SQL standard over legacy `SERIAL`!), s...
PostgreSQL Data Types Selection
`BIGINT` / `UUID` (`gen_random_uuid()`), `NUMERIC(14, 2)` (exact decimal currency — NEVER `REAL`/`DOUBLE PRECI...
Primary Keys and Foreign Keys
Surrogate keys (`BIGINT` / `UUIDv7`/`v4`) vs natural keys, composite primary keys, `REFERENCES ... ON DELETE R...
Constraints (NOT NULL, UNIQUE, CHECK)
Enforcing domain invariants inside the database engine (`CHECK (qty_on_hand >= 0)`, `CHECK (reserved_qty <= qt...
INSERT, SELECT, UPDATE, DELETE and Upserts
Multi-row `INSERT ... VALUES ... RETURNING *`, atomic upsert `INSERT ... ON CONFLICT (warehouse_id, sku) DO UP...
WHERE, ORDER BY and GROUP BY
Sargable predicates (`created_at >= $1 AND created_at < $2` uses index vs `EXTRACT(YEAR FROM created_at) = 202...
Introduction to Prisma ORM Architecture
Declarative `schema.prisma` -> `prisma generate` -> 100% compile-time type-safe `PrismaClient` query builder +...
Prisma Installation and Multi-Environment Configuration
Installing `prisma` (devDependency) + `@prisma/client` (dependency), configuring `DATABASE_URL` via `.env`, an...
Prisma Schema Anatomy and Database Naming (@map & @@map)
Idiomatic camelCase TypeScript fields (`qtyOnHand`, `createdAt`) mapped cleanly onto PostgreSQL `snake_case` c...
Models, Scalar Fields, Enums and Defaults
`@id @default(uuid())` vs `@default(autoincrement())`, `@updatedAt`, native Postgres `enum` mapping, optional...
Native PostgreSQL Data Types (@db.*) and Decimal Precision
`Decimal @db.Decimal(12, 2)` (`Prisma.Decimal` exact decimal math — never JS `float`!), `@db.Timestamptz(6)`,...
Modelling Relationships in Prisma (@relation)
Relation fields vs foreign-key scalar fields, explicit `onDelete: Restrict | Cascade | SetNull`, and disambigu...
One-to-One, One-to-Many and Explicit Many-to-Many Relations
`1:1` (`@unique` FK), `1:N`, and why **Explicit Join Models** (`OrderItem` with `qty`, `unitPricePaise`, `crea...
Singleton PrismaClient Lifecycle Management
Creating ONE shared `PrismaClient` per Node process (caching on `globalThis` during `tsx watch` dev hot-reload...
Type-Safe CRUD Operations with Prisma Client
`create`, `createManyAndReturn`, `findUnique` / `findFirst`, `findMany`, `update`, `updateMany` (conditional a...
Authentication vs Authorization
`Authentication (AuthN)` = verifying identity (`"Who are you?"` -> `401 Unauthorized` when missing/invalid) vs...
User Registration and Enumeration-Safe Login
Canonicalizing email (`trim().toLowerCase()`), constant-message `"Invalid email or password"` responses, and p...
Password Hashing Fundamentals
Why fast cryptographic hashes (`SHA-256` runs billions/sec on GPUs!) are catastrophic for passwords vs slow, s...
bcrypt and Argon2id in Node.js
OWASP #1 recommended **`argon2` (`argon2id`, `memoryCost: 65536`)** vs `bcrypt` (`cost = 12`), async threadpoo...
Password Reset Workflows
Generating `32-byte` CSPRNG token (`crypto.randomBytes(32).toString("hex")`), emailing raw token in link, stor...
Email Verification Workflows
Issuing hashed verification tokens on signup, rate-limiting resend requests (`1 / 60s`), marking `emailVerifie...
JWT Fundamentals
Compact URL-safe `base64url(header).base64url(payload).base64url(signature)` tokens — **SIGNED (tamper-evident...
JWT Structure and Strict Signature Verification
Symmetric `HS256` (`>= 256-bit` high-entropy secret) vs asymmetric `RS256`/`EdDSA` (Auth Service signs with pr...
Access Tokens and Refresh Tokens Architecture
Pairing short-lived stateless `Access Token` (`10–15 min` in `Authorization: Bearer`) with long-lived revocabl...
OWASP API Security Top 10 Overview
API1 BOLA, API2 Broken Auth, API3 Broken Object Property Level Auth (Mass Assignment & Excessive Data Exposure...
Input Validation and Sanitization
Allowlist validation (strict types, lengths, regexes, enums via Zod) OVER blocklist string stripping, plus Uni...
SQL Injection Prevention
Why parameterized placeholders (`$1, $2` in `pg`, Prisma ORM methods, and `prisma.$queryRaw\`...\`` tagged tem...
NoSQL Injection Prevention
Blocking JSON operator objects (`{ "$ne": null }`, `{ "$gt": "" }`, `$where` JS execution!) via Zod `z.string(...
Cross-Site Scripting (XSS) Fundamentals for Backend Engineers
Enforcing `Content-Type: application/json; charset=utf-8` + `X-Content-Type-Options: nosniff` on APIs, escapin...
Cross-Site Request Forgery (CSRF) Defense
When CSRF applies (cookie-authenticated state-changing endpoints; NOT pure `Authorization: Bearer` header APIs...
Production CORS Configuration
Dynamic `origin(reqOrigin, cb)` checking an explicit `Set<string>` allowlist, `credentials: true`, explicit `m...
Helmet Security Headers
`Strict-Transport-Security` (`HSTS`), `X-Content-Type-Options: nosniff`, `X-Frame-Options: DENY`, `Referrer-Po...
Rate Limiting Architecture
Multi-layer rate limits: Nginx edge IP burst limit + Express Redis-backed per-user/per-IP sliding windows (`ex...
Redis Architecture and Docker Setup
Why single-threaded in-memory Redis executes `100,000+ ops/sec` at sub-millisecond latency (zero context-switc...
Redis Data Types Overview
Choosing the right native structure (`String`, `Hash`, `List`, `Set`, `Sorted Set / ZSET`, `Stream`) instead o...
Strings, Hashes, Lists and Sets
`SET key val EX 300 NX` (atomic set-if-not-exists + expiry!), `INCR`/`DECR`, `HSET`/`HMGET`, `LPUSH`/`RPOP`, a...
Sorted Sets (ZSET) for Leaderboards & Sliding Windows
`ZADD key score member`, `ZINCRBY`, `ZREVRANGE` top-K rankings in `O(log N + K)`, `ZREMRANGEBYSCORE` pruning e...
Redis Commands, Expiration, SCAN and Pipelining
`EXPIRE`/`PEXPIRE`, `TTL`/`PTTL`, cursor-based `SCAN 0 MATCH prefix:* COUNT 100`, `UNLINK` (async non-blocking...
Key Naming Conventions and Memory Modelling
Colon-delimited hierarchical keys `{service}:{version}:{entity}:{id}` (`catalog:v1:product:SKU-101` — bump `v1...
Node.js Redis Integration (ioredis & Lua Atomicity)
`new Redis(url, { maxRetriesPerRequest: 3, enableReadyCheck: true, lazyConnect: true })`, error event handling...
Caching Fundamentals (When to Cache & Hit-Ratio Math)
Effective latency `L_eff = hit_rate * L_cache + (1 - hit_rate) * L_db` (`95%` hit @ `0.5ms` + `5%` miss @ `40m...
Cache-Aside (Lazy Loading) Pattern
Read path: `1) Check Redis -> Hit? Return parsed -> 2) Miss? Query DB -> 3) Populate Redis w/ TTL -> Return` +...
Read-Through, Write-Through and Write-Behind Concepts
Comparing **Cache-Aside** (only requested items cached), **Write-Through** (write updates DB + Cache synchrono...
Advanced Validation Using Zod and Joi
`Zod` (`z.object`, `.strict()`/`.strip()`, `.refine()`, `.transform()`, `z.infer<typeof Schema>` zero-duplicat...
Request Schema Validation Middleware (params, query, body)
`z.coerce.number().int().min(1).max(100).default(20)` for query strings, `z.string().uuid()` for params, forma...
Outbound Response Validation
Running `PublicUserDtoSchema.parse(data)` before `res.json()` (or in tests/staging) as a hard data-leakage fir...
Centralized API Error Mapping (Zod, Prisma, Mongoose, Multer, JWT)
Unified error normalizer converting `ZodError` (`422`), `Prisma P2002` (`409`), `Mongoose 11000` (`409`), `Mul...
API Versioning Lifecycle & Deprecation Headers
Router-level `/api/v1` vs `/api/v2`, RFC 8594 `Sunset` & `Deprecation: true` headers, and tracking per-version...
Offset Pagination vs Opaque Cursor Pagination
Implementing tamper-checked base64url cursors `{ sortValue, id }` supporting forward (`after`) pagination with...
Synchronous vs Asynchronous Processing
Keeping user-facing HTTP critical path minimal (`validate + write order = 25ms`) while pushing non-blocking si...
Background Job Architecture
Producer (API container enqueues compact JSON `{ orderId }` — NEVER `10 MB` blobs!) -> Durable Broker -> Indep...
Job Queues and Isolated Worker Pools
Separating fast high-priority queues (`otp-emails` SLA `< 3s`) from slow bulk queues (`monthly-csv-exports`) s...
Scheduled and Recurring Jobs
Cron-driven recurring maintenance vs per-entity delayed timers (`check unpaid order #901 in 15m`)
Job Retries and Exponential Backoff
`attempts: 5`, `backoff: { type: "exponential", delay: 2000 }` (`2s -> 4s -> 8s -> 16s -> 32s`) vs failing imm...
Failed Jobs and Dead-Letter Handling (DLQ)
Routing poison-pill messages that exhaust all `attempts` into a retained Dead-Letter Queue (`DLQ`) with error...
Idempotent Job Processing
Why EVERY queue guarantees **At-Least-Once** delivery (worker crash right after sending email / charging card...
Job Queue Monitoring and Operational Health
Tracking `waiting`, `active`, `delayed`, `failed` counts, oldest-waiting job age (`queue lag`), and stalled-jo...
BullMQ Installation and Architecture
Modern TypeScript-native `bullmq` (`Redis Streams` + atomic Lua scripts replacing legacy `bull`), separate `io...
Real-Time Application Architecture
Bidirectional low-latency use cases (chat, collaborative cursors, live bidding) vs unidirectional server-push...
Short Polling, Long Polling and SSE vs WebSockets
Short Polling (high wasted overhead), HTTP Long Polling (held request), Server-Sent Events (`text/event-stream...
WebSocket Protocol (RFC 6455 Handshake & Framing)
`GET / HTTP/1.1` + `Upgrade: websocket` + `Sec-WebSocket-Key` -> `101 Switching Protocols` + `Sec-WebSocket-Ac...
Managing Stateful WebSocket Connections & Heartbeats
Detecting half-open "zombie" TCP connections (mobile tunnel drop without FIN packet!) via `pingInterval` (`25s...
Socket.IO Architecture vs Raw ws
What `Socket.IO` adds on top of WebSockets: automatic reconnection with backoff, packet buffering, acknowledgm...
Typed Server-Side Socket.IO Integration in TypeScript
Attaching `new Server<ClientToServerEvents, ServerToClientEvents, InterServerEvents, SocketData>(httpServer, {...
Connection and Disconnection Lifecycle Events
`io.on("connection", socket => ...)`, `socket.on("disconnecting")` (`socket.rooms` is STILL populated here!) v...
Software Testing Fundamentals & the Backend Testing Trophy
Static Type/Lint checks (`tsc` + `ESLint`) -> Fast Pure Unit Tests -> High-Confidence API + Real-DB Integratio...
Unit Testing Pure Domain Logic and Services
Arrange-Act-Assert (`AAA`) structure, testing pure pricing/coupon/token calculators and Services injected with...
Integration Testing Repositories and Persistence
Verifying actual Prisma/PostgreSQL and Mongoose/MongoDB queries, unique/check constraints, cascade rules, and...
HTTP API Testing Principles
Asserting HTTP status code, `Content-Type`, security/rate/location headers, response JSON schema, AND post-req...
End-to-End Backend Flow Testing
Multi-step stateful user journeys (`Register -> Capture OTP from FakeMailer -> Verify Email -> Login -> Access...
Test-Driven Development (TDD) Fundamentals
`Red` (write failing test specifying exact behavior) -> `Green` (write minimal clean code to pass) -> `Refacto...
Jest and Vitest Configuration for TypeScript + ESM
Configuring `vitest.config.ts` / `jest.config.ts` (`ts-jest` / native ESM), separating fast `test:unit` from D...
Node.js Testing Best Practices & Handle Cleanup
Closing Prisma (`$disconnect`), Mongoose (`disconnect`), and Redis (`quit`) in `afterAll`, using `--detectOpen...
Linux Server Filesystems and Production Directory Layout
Structuring `/srv/backend` or `/opt/app`, `/etc/nginx/sites-available`, `/var/log/nginx`, swap sizing, and che...
Linux Users, Groups and Least-Privilege Permissions
Creating dedicated unprivileged system user `useradd --system --create-home --shell /usr/sbin/nologin nodeapp`...
Linux Process Management and systemd Service Units
Writing `/etc/systemd/system/backend-api.service` (`Restart=on-failure`, `RestartSec=5`, `User=nodeapp`, `Envi...
Linux Networking Commands and Firewall Hardening (ufw)
`ss -tulpn`, `ip addr`, `curl -I http://127.0.0.1:3000/healthz`, `nc -zv`, and `ufw default deny incoming` all...
SSH Hardening and Secure Remote Administration
Ed25519 SSH keys, `PasswordAuthentication no`, `PermitRootLogin no`, SSH bastion/port forwarding (`ssh -L 5433...
Production Server Environment Variable Management
Storing `/etc/backend/api.env` (`chmod 0600`, `chown root:nodeapp` or `nodeapp:nodeapp`) outside the Git worki...
Server Logs, logrotate and Diagnostics
`journalctl -u backend-api --since "10 min ago"`, configuring `/etc/logrotate.d/` (`daily`, `rotate 14`, `comp...
Linux Server Tuning (File Descriptors & TCP Backlog)
Raising `ulimit -n` (`nofile = 65535`, default `1024` crashes Node with `EMFILE: too many open files` at ~900...
Containerization Concepts vs Virtual Machines
Linux kernel `namespaces` (isolated PID, net, mount, user views) + `cgroups` (CPU/RAM caps) sharing the host k...
Want Unlimited NODE Mock Exams + Weekend Live Mentorship With Working IT Pros?
Train live on weekends with active Working IT Professionals • All-Inclusive Fee: $43 USD All-Incl. (Includes 30-Day 100% Upgrade Credit)
Frequently Asked Questions — Topic-Wise Mock Tests
Are Complete Node.js Topic Mock Tests free on MockAttempt Tech Academy?
Yes! Visitors can attempt up to 2 free timed 50-MCQ Complete Node.js, Express.js & TypeScript Backend Course Mock Tests per topic daily across 170 topics with instant answers. Enrolled live-batch students (₹3,999 All-Inclusive) unlock unlimited daily attempts.
Can I also practice Spoken AI Interviews for Complete Node.js?
Yes — every Complete Node.js, Express.js & TypeScript Backend Course topic also includes up to 2 free daily Spoken MockAttempt AI Technical Interviews (https://mockattempt.com/ai-interviews/course/nodejs-express-typescript-backend-course) with 4-axis voice evaluation.