当前位置:网站首页>[interview experience package] summary of experience of being hanged during interview (I)

[interview experience package] summary of experience of being hanged during interview (I)

2022-06-23 23:59:00 A tasteful programmer

       Server maximum ports :65535

       The difference between arrays and linked lists
1、 A linked list is a linked storage structure , Arrays are sequential storage structures
2、 Linked list connects elements with elements through pointers , An array stores all elements in order
3、 The insertion and deletion of linked list elements are relatively simple , No need to move elements , And it is easy to expand the length , But querying elements is difficult , Arrays are faster to query , But deleting and adding will be troublesome .

Array and ArrayList The essential difference The reason is that the former is type safe , The latter is type unsafe .
ArrayList To be compatible with all types of objects , Used Object Array , When using elements, there will be boxing and unpacking operations , Reduced the performance of the program .
ArrayList The capacity will be expanded dynamically , The capacity is the original 2 times .
ArrayList Only after the element is added can the corresponding element be accessed through subscript .
When the array is created, the data type has been determined , And its length is fixed , You can only change the value and access of each element through subscript .

arraylist and linkedlist The difference between
1、 The data structure is different
ArrayList yes Array( The dynamic array ) Data structure of ,LinkedList yes Link( Linked list ) Data structure of .
2、 Different efficiency
When random access List (get and set operation ) when ,ArrayList Than LinkedList More efficient , because LinkedList It's linear data storage , So you need to move the pointer from front to back to find . When adding and deleting data (add and remove operation ) when ,LinkedList Than ArrayList More efficient , because ArrayList It's an array , So when adding or deleting operations are performed , It will affect the subscript index of all data after the operation point , Need to move data .
3、 Free line is different
ArrayList Less freedom , Because it needs to manually set a fixed size of capacity , But it is more convenient to use , Just create , Then add data , Use by calling subscript ; and LinkedList More freedom , Can dynamically change with the amount of data , But it's not easy to use .
4、 The main control costs are different
ArrayList The main control overhead is that List Make room for the list ; and LinkList The main control cost is to store node information and node pointer information .

html The default request method is get
post and get Differences in methods
1.get The request is usually to get data ( In fact, you can also submit , But it's common to get data );
post The request is usually to submit data .
2.get Because the parameters will be placed in url in , So privacy , Poor safety , The requested data length is limited ,
Different browsers and servers are different , The general limit is 2~8K Between , More commonly 1k within ;
post The request has no length limit , The requested data is placed in body in ;
3.get Requests to refresh the server or back out have no effect ,post The data request will be resubmitted when requesting fallback .
4.get Requests can be cached ,post Request will not be cached .
5.get The request will be saved in the browser history ,post Can't .get Requests can be bookmarked , Because the parameter is url in , but post You can't . Its parameters are not in url in .
6.get Request can only proceed url code (appliacation-x-www-form-urlencoded),post Request support for multiple (multipart/form-data etc. ).
In depth understanding of
1…GET and POST All are http Request mode , The bottom is TCP/IP agreement ; Usually GET Produce a TCP Data packets ;POST Produce two TCP Data packets ( but firefox Is to send a packet ),
2. about GET Method request , The browser will http header and data Send along , Server response 200
( Return the data ) It means success ;
And for POST, Browser sends first header, Server response 100, The browser will continue to send data, clothing
Server response 200 ( Return the data ).

       rewrite (Override) And overloading (Overload) A simple understanding of
What the interviewer said was :override What does annotation mean ?
I : rewrite
interviewer :” His approximate notes and differences ?“
I'm confused here , I don't know what he wants to ask , Later, I thought about rewriting and overloading . If you can really answer the question directly , But put it in spring I was really confused to pick out the knowledge points under this framework , It's so hateful. Later, I found that the question was so simple that I didn't answer it . The interviewer is a little good , If I ask directly, maybe I can answer .

Override( rewrite ): It happened in Java In succession to , When the subclass needs to use the same method name as the parent class , But there are different ways to implement the process , Will use rewriting . Note that the parameter list of the overridden method must be exactly the same as that of the overridden method of the parent class , But the return value type can be a derived class of the return value type of the overridden method of the parent class or the same class .

Overload( heavy load ): Overloading occurs in the same class , Overloading is used when the same method name is required in the same class but the implementation process is different . Overloads have the same method name but different parameter lists , Overload can be realized . Common, such as overloading of class construction methods .
1, Purpose
overload To increase the readability of the program ( Different approaches , But do the same thing ). override A specific implementation for providing methods that its superclass already provides .
2, Range
overload Execute within the same class scope . override Occurs in two classes with inheritance ( Inherit ) The relationship between .
3, Parameters
overload Parameters must be different . override Parameters must be the same .
4, polymorphism
overload Static polymorphism , The called function is selected at compile time . override Is runtime polymorphic .
5, Return type
overload Can be the same or different . But you have to change the parameters . override Must be the same or covariant .

mysql Index problem
General index
This is the most basic index , It has no restrictions .
unique index
It's similar to the previous normal index , The difference is that : The value of the index column must be unique , But you can have an empty value . If it's a composite index , The combination of column values must be unique .

Automatic operation and maintenance tools and automatic testing tools Most people here should not , I can't answer either , Because the interview requirements didn't say , Otherwise, it is absolutely necessary to understand .
It's a requirement , I'm ready nodejs part , Mainly because there are few interview questions , I didn't ask , It may be that I have said everything I know , Take warning , Autistic .
 Insert picture description here
Second kill part ( For my project ) It mainly talks about the optimization of the front and back ends , Paste after finishing the specific items
Refer to this :https://blog.csdn.net/weixin_35681869/article/details/107587749
Then I asked a question about partial application , It's how to put excel The data in the table is classified into web On the page , And can't repeat . Allow me to think about , Put the source code here at that time .

       Because the front performance is not outstanding , But I still passed , Then two sides .
The new interviewer prefers hardware , Come up and ask the principle of computer network and operating system , In fact, I can't say enough about these two courses , The score estimation is a good addition to the experimental report .
computer network
Computer network architecture
 Insert picture description here
Also ask about the role of each layer , Originally, I reluctantly answered the question , There's no way .
Five layer agreement
1. application layer
The task of application layer is to complete specific network application through the interaction between application processes . The application layer protocol defines the rules of communication and interaction between application processes .
Different network applications need different protocols , Such as the application of the world wide web HTTP agreement , Email enabled SMTP agreement , Supporting file transfer FTP Agreements, etc
2. Transport layer
The task of the transport layer is to provide common data transmission services for the communication between processes in two hosts . The application process uses this service to transport the application layer message .
So called universal , Refers to applications that are not specific to a particular network . But multiple applications can use the same transport layer service .
The transport layer mainly uses the following two protocols :
Transmission control protocol TCP ( Provides connection-oriented , Reliable data transfer service , The unit of data transmission is message segment )
User datagram protocol UDP( Provide connectionless , Do your best to deliver , The unit of data transmission is the user datagram )
3. The network layer
The network layer provides communication services for different hosts on the packet switching network . The network layer transmits the packet segments or user datagrams generated by the transport layer to package component groups and packets .
4. Data link layer
Data transmission between two hosts , It's always on the data link one by one , This requires the use of specialized link-layer protocols . Transmitting frames on a link between two adjacent nodes , Each frame contains the data and the necessary control information ( Such as synchronous information , Address information , Error control, etc ) Three basic questions : Package into frames , Transparent transmission , Error detection
5. The physical layer
The unit of data transmitted on the physical layer is bit .
Why is there TCP/IP agreement
All over the world , All kinds of computers run different operating systems to serve you , The way these computers express the same information is very different . It's like God in the Bible messed up the accents of people everywhere , So that they can't cooperate . Computer users realize that , Computers are only for individual combat and will not play a very important role . Only by combining them , Computer will play its greatest potential . So people try their best to connect computers with wires .

But simply connecting is not enough , It's like two people with different languages meet each other , Completely unable to exchange information . So they need to define something in common to communicate ,TCP/IP It is for this reason that .TCP/IP It's not an agreement , It's an umbrella term for a family of agreements . It includes IP agreement ,IMCP agreement ,TCP agreement , And what we are more familiar with http、ftp、pop3 Protocol, etc . Computers have these , It's like learning a foreign language , You can communicate freely with other computer terminals .

TCP/IP Model

application layer :
Provide users with a common set of applications , Like email 、 File transfer access 、 Remote login, etc . Remote login TELNET Use TELNET The protocol provides interfaces registered on other hosts of the network .TELNET The session provides a character based virtual terminal . File transfer access FTP Use FTP Protocol to provide file copying function between machines in the network .

Transport layer :
Provides communication between applications . Its functions include : One 、 Format the flow of information ; Two 、 Provide reliable transmission . To achieve the latter , The transport layer protocol states that the receiver must send back the acknowledgement , And if the packet is lost , Must resend .

The network layer :
Responsible for communication between adjacent computers . Its functions include three aspects .
One 、 Process packet send request from transport layer , Upon receipt of the request , Load groups into IP The datagram , Fill the header , Choose the way to the hostel , Then send the datagram to the appropriate network interface .
Two 、 Process input datagram : First check its legitimacy , And then we'll find the path – If the datagram has arrived at the hostel , Remove the header , Give the rest to the appropriate transport protocol ; If the datagram has not reached Xinsu , Then forward the datagram .
3、 ... and 、 Processing path 、 Flow control 、 Congestion and so on .
Network interface layer :
This is a TCP/IP The lowest level of software , Responsible for receiving IP The datagram is sent over the Internet , Or receive physical frames from the network , Draw out IP The datagram , hand IP layer .

Process and thread problems
There are differences between threads and processes :
1、 The definitions are different , A process is a program in execution , Each task in a process is a thread .
2、 A thread can only belong to one process , But a process can contain multiple threads .
3、 Thread has no address space , It is included in the address space of the process .
4、 The overhead or cost of a thread is less than that of a process .

Whether a process crash will affect other processes
A process crash does not affect other processes , A thread crash can cause the entire process to crash .

This piece is not ready to answer
Next is a data structure , It's not sequencing , Not find , yes ip Address classification . The source code will be completed later .

原网站

版权声明
本文为[A tasteful programmer]所创,转载请带上原文链接,感谢
https://yzsam.com/2022/174/202206232123339353.html