Complat software training 101
  • Introduction
  • Day 1
  • Day 2
  • TODO
  • Linear regression
  • Tmux
  • quick link
  • CLI more - 1
  • Vim more - 1
  • MQ
  • iv - 1
  • iv - 2
  • iv - 3
  • clear Arch
  • lv - array
  • INTERVIEW - JS
  • RDKit - read/write
  • RDKit - process
  • RDKit - transform
  • RDKit - rxn
  • SYSTEM DESIGN - Question
  • SYSTEM DESIGN - EX1
  • SYSTEM DESIGN - EX2
  • SYSTEM DESIGN - EX3
  • SYSTEM DESIGN - EX99
Powered by GitBook
On this page
  • 1. Difference Java app using Apache server vs JS app using NodeJS server?
  • 2. Performance of handling the incoming request?
  • 3. ReactJS
  • 4. Redux
  • 5. ReactJS compile all of JS into one BIG file.
  • 6. why Elasticsearch
  • 7. scale a NodeJS server?

Was this helpful?

iv - 2

1. Difference Java app using Apache server vs JS app using NodeJS server?

NodeJS

  1. V8-based runtime environment -> non-blocking I/O

  2. single-threaded runtime / single call stack

JAVA

  1. multi-threaded, blocking I/O

2. Performance of handling the incoming request?

  • I/O bound (ex: file processing) (NodeJS faster than JAVA)

  • CPU bound (ex: complicated algorithm, compression) (NodeJS slower than JAVA)

IO bound = it would go faster if the I/O subsystem was faster.

CPU bound = it would go faster if the CPU were faster.

3. ReactJS

JQuery -> DOM mixed with data, and it is difficult to manage for larger projects.

ReactJS

  1. lifecycle, do something in some specific stages.

  2. re-render changing parts by computation, without full DOM re-rendered.

4. Redux

  1. FLUX ([a]separate DOM from data, [b]a global data without passing into layers of props)

  2. Predictable

    2.1. action is pure object -> make recording and time traveling possible

    2.2. reducer is pure function -> with no side effect

    2.3. single store is read-only. Update it only by firing an action.

  3. checks whether the state has been changed by doing shallow comparison.

state = reducer(action, state)

5. ReactJS compile all of JS into one BIG file.

Webpack provides many kinds of feature for code splitting, and lazy loading feature.

Server-Side-Rendering

6. why Elasticsearch

Full-Text searching function provided by SQL-Server is inadequate.

Elasticsearch ships with a wide range of built-in analyzers.

7. scale a NodeJS server?

  1. Run a NodeJS process on every CPU core and load balance all requests among them through NodeJS's cluster mode.

  2. Load-Balancing HTTP Server is another solution.

  3. micro-service

Previousiv - 1Nextiv - 3

Last updated 5 years ago

Was this helpful?