What is a closure in JavaScript and why is it useful?
A closure is a function that keeps access to the variables of the scope where it was created, even after that outer function has finished running.
Intern to senior 路 169 questions
Practise the questions developers are asked in real interviews. Every answer starts with a short version you can say out loud, then explains the detail, the code and the mistakes interviewers listen for.
Questions are tagged with every level they are commonly asked at.
Build your programming and software engineering fundamentals.
37 questions1-2 yearsPrepare for practical development and technical interviews.
91 questions2-5 yearsMaster architecture, performance, APIs, databases and advanced engineering concepts.
104 questions5+ yearsPrepare for system design, architecture and senior engineering interviews.
78 questionsEach role page mixes the technologies and topics that job usually covers.
HTML, CSS, JavaScript, TypeScript, React, browser performance and testing.
93 questionsNode.js, Java, C#, Python, SQL, APIs, authentication, caching and security.
131 questionsFrontend and backend together: React, Node.js, databases, APIs and deployment.
158 questionsLanguage fundamentals, data structures, coding problems, system design and behavioral.
112 questionsGit, Docker, CI/CD, scaling, load balancing and infrastructure basics.
45 questionsTest strategy, automation, end-to-end tools, flaky tests and CI.
43 questionsReact concepts used in React Native, TypeScript, state and performance.
59 questionsSQL, Python, query optimization, transactions and data modelling.
64 questionsPython fundamentals, performance, concurrency and engineering practices.
49 questionsA closure is a function that keeps access to the variables of the scope where it was created, even after that outer function has finished running.
The event loop is the mechanism that lets single-threaded JavaScript handle asynchronous work: it runs the call stack to empty, then runs all queued microtasks (promises), then takes the next task (timers, events) from the queue.
useEffect runs a function after the component renders; the dependency array tells React when to re-run it: with no array it runs after every render, with an empty array only after the first, and with values only when those values change.
Node.js is a JavaScript runtime built on Chrome's V8 engine that runs your JavaScript on a single main thread and uses non-blocking I/O, so one thread can handle many concurrent connections.
INNER JOIN returns only rows that have a match in both tables, while LEFT JOIN returns every row from the left table and fills the right table's columns with NULL when there is no match.
An index is a separate sorted data structure (usually a B-tree) that lets the database find rows without scanning the whole table, at the cost of extra storage and slower writes.
Generate a short unique code for each long URL (for example by base62-encoding a unique ID), store the mapping in a key-value or relational database, serve redirects through a cache because reads far outnumber writes, and record analytics asynchronously.
Both integrate changes from one branch into another: merge keeps both histories and joins them with a merge commit, while rebase rewrites your commits so they appear on top of the target branch, giving a linear history.
Walk through the array once while storing each number鈥檚 index in a hash map; for every number, check whether target minus that number is already in the map. This runs in O(n) time and O(n) space.
Give a 60-90 second summary in three parts: what you do now, one or two achievements that show your strengths, and why this role is the logical next step.
Download every question and answer as a free PDF. Each technology, role and level page has its own PDF too.