How to pass the ele. me Node.js interview
ElemeFE is an ElemeFE server programmer with 2 to 3 years of experience. The position is not full stack. If you are interested in this position or learning more advanced content in Node.js, find out more about ElemeFE. Welcome to see.
It is important to note that this article is not intended for those who have no basic knowledge of JavaScript/Node.js and have some working experience. The focus of this tutorial is more precisely what node.js programmers need to know about server basics.
If you don’t know much about ElemeFe ([email protected]), don’t submit your resume (save time on both sides). If you know much about ElemeFe or just look at the outline, you are welcome to submit your resume to ElemeFe ([email protected]).
takeaway
Although the goal is to pass the interview, this tutorial is not simply to list all the interview questions, but to list and discuss the points that you need to make sure you understand during the interview.
This article divides some common problems into categories, with each category identifying some coverage points and listing several common problems that are usually understood or faced with 2-3 years of work experience. If you are interested in a particular type of question, or would like to know the answers to the listed questions, you can read more about it in the section below.
On the whole, the outline is not very comprehensive, the coverage of details is not high, many discussions just point to the end, I hope you to think with questions.
Js Basic questions
Unlike the front-end Js, the back-end is facing the server and is more memory oriented.
[Basic]
Type judgment[Basic]
scope[Basic]
reference[Basic]
Memory release[Basic]
ES6 new features
Q&A
- What type is reference-passing and what type is value-passing in JS? How do I pass variables of value type by reference? [more]
- In js, 0.1 + 0.2 === 0.3 is true? How do I determine if the sum of two floating point digits equals the third digit when I don’t know the number of floating point digits?
- Can an Array intermediate element defined by const be modified? If so, what is the meaning of the const modifier object? [more]
- When is memory freed for variables of different types and environments in JavaScript? [more]
To read more
The module
[Basic]
Module mechanism[Basic]
Hot update[Basic]
context[Basic]
Package management
Q&A
- A. js and B. js files require each other in an infinite loop? Can both parties derive variables? How do you design to avoid this problem? [more]
- If a.js requires B. js, define global variables in B
t = 111
Can you print it directly in A?[more] - How do I hot update a JS/JSON file without restarting the Node process? Is there something wrong with the question itself? [more]
To read more
Event/asynchrony
[Basic]
Promise[Doc]
The Events of the day[Doc]
Timers[Point]
Blocking/asynchronous[Point]
Parallel/concurrent
Q&A
- What is the difference between the second argument to.then and.catch in a Promise? [more]
- Is Emit from Eventemitter synchronous or asynchronous? [more]
- How do I determine whether an interface is asynchronous? Is it asynchronous whenever there is a callback function? [more]
- What is the difference between nextTick, setTimeout and setImmediate? [more]
- How to implement a sleep function? [more]
- How to implement an asynchronous Reduce? (Note: not synchronize reduce after asynchrony.) [more]
To read more
process
[Doc]
The Process of the Process[Doc]
Child Processes[Doc]
Cluster (Cluster)[Basic]
Interprocess communication[Basic]
daemon
Q&A
- What is the current working directory of the process? What does it do? [more]
- What is the difference between child_process.fork and POSIX fork? [more]
- Does the death of a parent or child affect each other? What is the orphan process? [more]
- How does a cluster ensure load balancing? [more]
- What is a daemon? How do you implement daemons? [more]
To read more
IO
[Doc]
Buffer[Doc]
String Decoder[Doc]
The Stream (flow)[Doc]
Console[Doc]
File System[Doc]
Readline[Doc]
REPL
Q&A
- What data are buffers used to process? Can its length change dynamically? [more]
- What are the highWaterMark and Drain events for Stream? What is the relationship between the two? [more]
- What is the purpose of Stream pipe? Is data passed by reference or copy during PIPE? [more]
- What is a file descriptor? What is the input/output/error stream? [more]
- Is console.log synchronous or asynchronous? How to implement a console.log? [more]
- How to obtain user input synchronously? [more]
- How is Readline implemented? [More]
To read more
Network
[Doc]
Net (Network)[Doc]
UDP/Datagram[Doc]
HTTP[Doc]
DNS (Domain name Server)[Doc]
ZLIB (compression)[Point]
RPC
Q&A
- What’s the difference between a cookie and a session? How does the server clear cookies? [more]
- What is the difference between POST and PUT in HTTP? [more]
- What is a cross-domain request? How are cross-domains allowed? [more]
- The difference between TCP/UDP? TCP sticky packet is how to return a responsibility, how to handle? UDP sticky packet? [more]
TIME_WAIT
What’s going on? surfeitTIME_WAIT
What could be the cause?[more]- What error is ECONNRESET? How do I duplicate this error?
- What does socket hang up mean? Under what circumstances might it occur? [more]
- What is the hosts file? What is DNS local resolution?
- Name some ways to improve the speed of Internet transmission.
To read more
OS
[Doc]
TTY[Doc]
OS (Operating system)[Doc]
Path[Doc]
Command line arguments[Basic]
load[Point]
CheckList
Q&A
- What is a TTY? How do I know if I am in a TTY environment? [more]
- What are the differences between newline characters (EOL) on different operating systems? [more]
- What is the concept of server load? How do I view the load? [more]
- What is ulimit used for? [more]
To read more
Error handling/debugging
[Doc]
Errors ()[Doc]
Domain (Domain)[Doc]
Debugger[Doc]
C/C + + plugin[Doc]
V8[Point]
Memory snapshot[Point]
CPU profiling
Q&A
- How to handle unexpected errors? Try /catch, domains or something else? [more]
- What is the
uncaughtException
Event? When is this event generally used?[more] - What is the principle of domain? Why deprecate domain? [more]
- What is defensive programming? Let it crash!
- Why pass error in cb’s first argument? Why is the cb first argument not error, such as http.createserver?
- Why are some exceptions not located to code calls based on error messages? How to locate an exception exactly? [more]
- What are the common causes of memory leaks? How to analyze and locate memory leaks? [more]
To read more
test
[Basic]
The test method[Basic]
Unit testing[Basic]
Integration testing[Basic]
The benchmark[Basic]
Pressure test[Doc]
It’s an Assert.
Q&A
- Why write tests? Will writing tests slow down development? [more]
- What is a unit of a unit test? What is coverage? [more]
- How does testing ensure that there are no endless loops in business logic? [more]
- What is a mock? When do you mock? [more]
To read more
util
[Doc]
URL[Doc]
Query Strings[Doc]
Utilities[Basic]
Regular expression
Q&A
- How does HTTP pass let arr = [1,2,3,4] to the server via GET (URL)? [more]
- Implementation of util.inherits in Node.js? [more]
- How to recursively get all file names in a folder? [more]
To read more
storage
[Point]
Mysql[Point]
Mongodb[Point]
Replication[Point]
Data consistency[Point]
The cache
Q&A
- What is the difference between backup database and M/S, M/M, etc.? [more]
- What’s the use of an index? What’s the general principle? What should I pay attention to when designing indexes? [more]
- Monogdb connection problems (timeout/disconnect, etc.) what are the possible causes? [more]
- When is data dirty? How to avoid it? [more]
- The difference between Redis and memcached? [more]
To read more
security
[Doc]
Crypto[Doc]
TLS/SSL[Doc]
HTTPS[Point]
XSS[Point]
CSRF[Point]
Man-in-the-middle attack[Point]
/ no (Sql injection
Q&A
- How does encryption protect user passwords? [more]
- What is the difference between TLS and SSL? [more]
- Can HTTPS be hijacked? [more]
- What is an XSS attack? What’s the harm? [more]
- Does filtering Html tags prevent XSS? Please list the circumstances in which you could not? [more]
- What is CSRF? How to prevent? [more]
- How do I avoid man-in-the-middle attacks? [more]
To read more
The last
At present, REPO is in the construction site. If any problem is found, please point it out in Issues. If you have good questions/knowledge points/corrections, you are also welcome to ask PR.
In addition, the Js foundation is a relatively large topic, in this tutorial will not be very detailed in-depth discussion, more is to list some important or more relevant with the server, so if you take “JavaScript authority guide” to the tutorial PR may not be adopted. The focus of this tutorial is more precisely what node.js programmers need to know about server basics.