Global Execution Context/GEC, Functional Execution Context/FEC, Eval Execution Context
Global Execution Context/GEC
Functional Execution Context/FEC
Eval Execution Context
If you write a script that declares a variable and a function, where does each piece of code execute and what execution context is created?
What execution context is created when you call eval inside a function, and how does it affect variable scope?
When you add a <script> tag to an HTML page, which execution context does that code run in?
We have a bug where a variable defined in an ES module is undefined when accessed from another module. How could the different execution contexts be causing this issue?
During a refactor you moved some code from the global scope into a function and a variable suddenly became undefined. Explain how the scope chain and execution context changed.
You notice that using eval inside a callback is causing a slowdown. Explain the execution context created by eval and why it might be problematic.
Our SPA loads third‑party scripts that use eval and also uses ES modules. How would you order the loading and manage execution contexts to avoid leaking variables and ensure the correct this binding?
Design a module loader that isolates each module's execution context while still allowing shared utilities. What trade‑offs do you consider between using the global context versus module contexts?
When profiling a large application you see many execution contexts being created during navigation. How would you reduce the overhead and what impact does the type of context have on memory usage?
We are migrating a legacy codebase that heavily relies on the global execution context to an ES‑module architecture. What strategy would you propose to transition safely, handling differences in execution context, scope, and this binding across multiple teams?
In a micro‑frontend architecture each team ships a bundle that may run in its own execution context. How would you define conventions or tooling to manage context isolation and avoid conflicts at the organization level?