node Flashcards

1
Q

What are the 3 components of a full stack Web architecture?

A

presentation, logic, and data

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

What is Node.js?

A

an asynchronous event-driven JavaScript runtime for the back end

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

What can Node.js be used for?

A

to build scalable network applications

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

What is a REPL?

A

read-eval-print loop

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

When was Node.js created?

A

2009

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

What backend languages have you heard of?

A

python, php, ruby, C sharp, Java, C++

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

What is a computer process?

A
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

Why should a full stack Web developer know that computer processes exist?

A
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

What is the process object in a Node.js program?

A
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

How do you access the process object in a Node.js program?

A

process is a global object so to access it just

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

What is the data type of process.argv in Node.js?

A

always strings

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

How do you access the command line arguments in a Node.js program?

A

process.argv[2] or const [ , , …message ] = process.argv;
console.log(message.join(‘ ‘));

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

What is a JavaScript module?

A

a file that has JavaScript code in it.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
14
Q

What are the advantages of modular programming?

A

keeps the code small, succinct and easy to understand

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
15
Q

In JavaScript, how do you make a function in a module available to other modules?

A

you export it using the keyword export

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
16
Q

In JavaScript, how do you use a function from another module?

A

you import it using the keyword import

17
Q

What is the JavaScript Event Loop?

A
18
Q

What is different between “blocking” and “non-blocking” with respect to how code is executed?

A

“blocking” code is executed synchronously, while “non-blocking” code is executed asynchronously

19
Q

What is a directory?

A

a folder

20
Q

What is a relative file path?

A

a file in the same directory

21
Q

What is an absolute file path?

A

always starts with a “/”

22
Q

What module does Node.js include for manipulating the file system?

A
23
Q

What method is available in the node:fs module for reading data from a file?

A
24
Q

What method is available in the node:fs module for writing data to a file?

A

writeFile() method

25
Q

Are file operations using the fs module synchronous or asynchronous?

A

asynchronous because file operations are slow to avoid blocking the process.