Cannot Use Import Statement Outside a Module: ESM vs CommonJS
Fix SyntaxError: Cannot use import statement outside a module in Node and browsers: type module, .mjs, require of ESM and __dirname in ESM.
Prepare with explained interview questions and study notes for JavaScript, TypeScript, React, Angular, Node.js, Java, Spring Boot and SQL, organized by topic and with the reasoning written in the margins. Finally, practice them like it's the real interview.
function outer() { let count = 0; return function inner() { return ++count; }; } const next = outer(); next(); // 1 next(); // 2 ← why not 1?!
Closures, hoisting, prototypes & the event loop.
Generics, narrowing, utility & mapped types.
Hooks, rendering, memoization & state.
Change detection, DI, signals & RxJS.
Semantics, the box model, layout & a11y.
Debounce, Promise.all, LRU cache… write it, run the tests.
One quiz question a day, with the reasoning behind the answer. It appears here once the page has loaded.
Fix SyntaxError: Cannot use import statement outside a module in Node and browsers: type module, .mjs, require of ESM and __dirname in ESM.
When React runs useEffect cleanup, why Strict Mode mounts twice, and how to clean up listeners, timers, sockets and fetches without leaks.
Fix Angular NG8002 Can't bind to 'ngModel' since it isn't a known property of 'input': import FormsModule, then fix formControl and inputs.
Fix TS2345 'Argument of type string is not assignable to parameter of type never' from empty arrays, function unions and exhaustive checks.
ClassNotFoundException vs NoClassDefFoundError in Java: what each error means, why classes go missing at runtime and how to fix the classpath.
Seeing the Whitelabel Error Page with status 404 in Spring Boot 3? Check the mapping, component scan, @RestController and context path.
48 must-know facts & snippets
From unknown to infer, on one page
Partial → Awaited, all of them
Rendering to Server Components, on one page
Every hook, one example each
Signals to guards, standalone-first
The 30 operators you'll actually use
Semantics to grid, cascade to stacking
Event loop to streams, checked on Node 22
OOP to virtual threads, on one page
Beans to JWT and @Transactional, one page
Joins to MVCC, every query run on Postgres 16
Dockerfile to Compose, layers to PID 1
Staging area to canary deploys, on one page
Big-O to DP, with Python templates
Rendering to caching, plus five mini-designs