What is a namespace in Python?
A namespace is a mapping from names to objects, and scope decides which namespace Python checks first.
- Local, enclosing, global, builtins
- LEGB lookup rule
- Avoid name collisions
Quick recall
A namespace is a mapping from names to objects, and scope decides which namespace Python checks first.
List comprehensions build lists concisely from an iterable, often replacing small loops plus append calls.
Monkey patching replaces attributes at runtime, often for tests or temporary overrides.
`==` compares values, while `is` compares object identity.
Frontend and Node.js code often call APIs using `fetch` today, but interviews still expect you to know HTTP basics and sometimes older XHR patterns.
JavaScript operators cover math, comparisons, boolean logic, fallback values, safe property access, and concise branching.
Modern async JavaScript is built on promises and `async`/`await`, but you still need to understand callbacks and promise coordination helpers.
Browsers offer several storage mechanisms with different persistence, size, and request-behavior trade-offs.
JavaScript classes provide cleaner syntax over prototype-based behavior, including constructors, instance methods, inheritance, and static members.
A closure happens when an inner function keeps access to variables from its lexical outer scope even after the outer function returns.
JavaScript has keyed and set-like collections beyond plain objects and arrays, including weak collections for object-keyed references.
JavaScript interviews often use comparison questions to test whether you understand trade-offs, not just syntax.