common Iv questions Flashcards

1
Q

what is node js

A

an open source server side runtime environment

built on Chrome’s V8 engine

provides a event-driven, non-blocking IO and cross platoform run time environment

can build highly scalable server-side applicaitions using javascript

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

**what problem does node.js solve?

A

allows you develop backend with Javascrit
provides event driven programming and unblocking IO solution that ensure your app can scale

the multi threads way of solving IO issue/ network requests cost too much.

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

what is event-driven programming?

A

when event get fired, callbacks will be executed

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

what is node.js process model?

A

Node js runs a single proess.

the application code runs in single thread (compare with multi-threads, it costs less)

the thread is responsible for event loops, IO operations will delegated to other threads, and node.js provides async programming pattern, so one single threads can handle many user requests(thus hightly scalable).

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

key features of node.js

A

asynchronous and event driven: all APIs of Node.js are asynchrinous.

it will execute in the background and continue processing other requests

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

(**)what is Symbol data type? using code to ilustrate

A

introduced in ES6.

const name = Symbol()
const person = {
[name]: ‘Rika’
}

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

(**) what is Buffer data type in node.js? use code to illustrate

A

let b = new Buffer(10000)
let str = “————”

b.write(str);
console.log(str.length) // maybe 10
console.log(b.length) // 10000

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

core modules in node js

A

assert
console
crypto
http
url
querystring
path
fs
util

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

what is assert module

A

provides a set of assertion functions useful for testing

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

what is the console module

A

provides a simple debugging console

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

(**)what is crypto module

A

provides cryptographic functionality

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

what is the http module

A

used for creating web servers

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

(**)what is the url module

A

URL resolution and parsing

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