Level 0 exam — harder

Exam — fresh questions

0.1 · Recall

1. What is Node.js?

Node = server-side JS and tooling, via the V8 engine plus system access.
0.1 · Application

2. Salim runs: console.log("Start") ; setTimeout(() => console.log("Response"), 100) ; console.log("End"). What order?

The program does not wait: End arrives before the callback response.
0.1 · Application

3. Salim must pick a tech for an API that waits a lot on a database. Why does Node fit?

Non-blocking + event loop: ideal for I/O with lots of waiting.
0.1 · Arbitration

4. Salim is offered massive 100% compute video encoding on the single Node thread. What verdict?

Node excels at I/O; heavy computation hogs the thread and blocks everything.
0.2 · Recall

5. Which Node version should you pick to learn and ship?

Current LTS = stability, npm compatibility and long support.
0.2 · Application

6. Salim just installed Node in Algiers. What action checks everything is in place?

Two numbers displayed + a running script = Node in the PATH.
0.2 · Application

7. Two of Salim's projects require two different Node versions. What does he need?

nvm installs several versions side by side; the installer alone handles only one.
0.2 · Arbitration

8. A colleague wants to learn on an unstable Current and avoid the terminal. What to decide?

LTS for stability, unavoidable terminal softened by VS Code.
0.3 · Recall

9. REPL or .js file: what is each for?

REPL = ephemeral draft; node app.js = saved and versionable work.
0.3 · Application

10. Salim runs node app.js Salim with the template (prenom = argv[2] || "Salim"). What does the first line display?

The Salim argument is read from process.argv and inserted into the message.
0.3 · Application

11. In his script, Salim types window.document. What happens under Node?

No page in Node: use process, __dirname and system access.
0.3 · Arbitration

12. Salim wrote 200 unsaved lines in the REPL and wants to keep going like this. What verdict?

Beyond two lines, the file is required; the REPL stays the draft.
What's next?
Back to the guideGuide contents