Basic professional questions for the 2023 computer security research interview (data structure, algorithm, computer language, computer network, database, operating system, mathematics)


The following major-related basic questions were prepared intermittently during the preparation for the interview in the summer of 2022, and finally went to Xiamen University. I also hope that these contents will be helpful to the students who are preparing for postgraduate studies. Less is more, fast is slow, I hope you don’t have to be too anxious, it’s faster to go slowly!

data structure

Data structures such as heaps, stacks, queues, and linked
lists Trees: red-black trees, various branches of binary trees, etc.
Figures: Euler graphs: Hamiltonian graphs
Search algorithms, hash algorithms, etc.

Q: Definition of data structure

Logical structure (collection, linear structure, tree structure, network structure), storage structure, data operation

Q: The difference between an array and a linked list

The storage space of the array is allocated on the stack, and the storage density is high. When the size of the required storage does not change much, and the size can be determined in advance, it is appropriate to use the array to store data; the storage space of the linked list is dynamically applied on the heap. When the length of the array changes greatly, and the size of the data cannot be estimated in advance, it is advisable to use a linked list for storage;
(1) The array is continuous in memory; (2) Before using the array, the length of the array must be fixed in advance, and dynamic change of the array size is not supported; (3 ) When the array elements increase, the array may exceed the boundary; (4) When the array elements decrease, it will cause memory waste; (5) When the array is added or deleted, other elements need to be moved; (1) The linked list adopts the method of dynamic memory allocation, in

memory Discontinuous (2) Support dynamic addition or deletion of elements (3) You can use malloc or new to apply for memory when needed, and use free or delete to release memory when not in use

Q: Hash table, how to deal with conflicts

It is a data structure directly accessed according to keywords and values ​​(Key-Value). That is to say, it calculates the corresponding value value through the keyword key and a mapping function Hash(key), and then maps the key-value pair to a position in the table to access records to speed up the search 1. Open address method
. Based on the duplicate address, the address is incremented, linearly detected and then hashed, twice detected and then hashed, and pseudo-randomly detected and then hashed.
2. Chain address method. Store all keywords with the same hash address obtained by a given hash function in the same linear linked list, and make the linked list ordered by keywords. The chain address method is suitable for frequent insertion and deletion.
3. Re-hashing, constructing multiple different hash functions at the same time

Q: Advantages and disadvantages of binary search tree (search is possible, but maintenance is not)

Advantages: high search efficiency, simple insertion and deletion algorithm, and similar time complexity to search Disadvantages
: Depending on the insertion order, the binary search tree may degenerate into a single branch tree in the worst case, that is, all nodes are on the same side , At this time, the time complexity of searching is O(N)

balanced binary tree : it is a strictly balanced BST (balance factor does not exceed 1). Then the search process is the same as BST, except that AVL will not have the worst-case BST (single branch tree). Therefore, the search efficiency is the best, and the worst case is on the order of O(logN); the
strict balance strategy of the binary balanced tree sacrifices the cost of establishing the search structure (insert, delete operations) in exchange for a stable O(logN) Search time complexity
Red-black tree : sorting binary tree has unbalanced problems, the left subtree may be very long but the right subtree is very short, resulting in poor query performance (logn degenerates into n), a completely balanced binary tree can guarantee the number of layers On average, the query efficiency is high, but the maintenance is very troublesome. It is very likely that the tree structure will be greatly adjusted for each insertion and deletion. The red-black tree is a binary tree between completely unbalanced and completely balanced. Through a series of rules such as each node has two colors of red and black, and the same number of black nodes will pass through the node to any leaf node, it is realized. [The maximum number of layers of the tree will only have twice the gap], which can not only improve the efficiency of insertion and deletion, but also make the tree relatively balanced so that there is a good query efficiency.

Q: Introduction to the concept and properties of red-black tree

Self-balancing binary search tree, 1. Nodes are red or black. 2. The root node is black. 3. Each leaf node is a black empty node (NIL node). 4 Both children of each red node are black. (There cannot be two consecutive red nodes on all paths from each leaf to the root) 5. All paths from any node to each leaf contain the same number of black nodes with a depth difference of one time Within, lookup time complexity O(logN)

Q: In the application of red-black tree, can red-black tree be realized?

Generally used for memory sorting, the time complexity is low, O(logn), map and set in STL use red-black trees internally, Linux process scheduling CFS
typedef int KEY_TYPE;
typedef struct _rbtree_node { unsigned char color; struct _rbtree_node *right; struct _rbtree_node *left; struct _rbtree_node *parent; KEY_TYPE key; void *value; } rbtree_node; typedef struct _rbtree { rbtree_node *root; Both left and right subtrees are empty, directly define a common leaf node, if the node is the common leaf node, then judge the current node is a leaf node } rbtree;










Q: How to find data in a certain amount of data:

ordered array . The advantage of this storage structure is that it supports random access to data, and the binary search algorithm can be used to reduce the complexity of search operations. The disadvantage is also obvious. When inserting and deleting data, in order to maintain the order of elements, a large number of operations of moving data are required.
Binary search tree . If you need a data structure that not only supports efficient binary search algorithm, but also can quickly perform insertion and deletion operations, then the first is the binary search tree. The disadvantage is that in some extreme cases, the binary search tree may become a linear linked list.
Balance a binary tree . The binary tree expressed dissatisfaction, so based on the advantages of the binary search tree, its shortcomings were improved, and the concept of balance was introduced. According to different balancing algorithms, there are AVL tree/
jump table for specific implementation . The jump table allows the sorted data to be distributed in a multi-level linked list structure. It also supports efficient search of data, and the operation of inserting and deleting data is relatively simple. The most important thing is to achieve a relatively balanced binary tree, which is several orders of magnitude lighter. The disadvantage is that there is a certain amount of data redundancy.

Q: and check set

Union search set is a tree-type data structure, which is used to deal with the merging and query problems of some disjoint sets (disjoint sets).
Find (Find): Query whether two elements are in the same set
Merge (Union): Merge two disjoint sets into one set
Path compression: Used to improve the efficiency of union search

Q: Huffman tree, prefix tree (dictionary tree)

It is a tree with the shortest weighted path, which is used to construct the binary code (Huffman code) with the highest transmission efficiency in communication and data transmission, and to construct the best judgment process with the shortest average execution time in programming; prefix matching, word
frequency Statistics (trie tree to compress the space, because the common prefix is ​​saved with one node)

Q: Representation of graphs: adjacency matrix and adjacency list

Representation of graphs: adjacency matrix and adjacency list,

Q:DFS

Every time you go along the path until you can no longer move forward, you will return to the nearest fork, and go to visit those unvisited branch vertices until you traverse the entire graph;

Q: connected components

In an undirected graph, if two vertices can reach each other (it can be reached indirectly through a path), then the two vertices are said to be connected;
if any two vertices of the graph G(V,E) are connected, it is called G is a connected graph; otherwise, G is called a disconnected graph, and the maximum connected subgraph in it is called a connected component.
Strongly Connected Component: Two vertices are said to be strongly connected if they can reach each other through a directed path. If any two vertices of a graph G(V,E) are strongly connected, the graph G is called a strongly connected graph; otherwise, the graph G is called a non-strongly connected graph, and the maximally connected subgraph in it is called a strongly connected graph portion.

Q: How to judge whether a directed graph has a cycle?

Topological sorting : In a directed graph, all nodes are sorted, requiring that no node points to the node in front of it.
First count the in-degrees of all nodes, and then separate the nodes whose in-degree is 0, and then reduce the in-degree of the node pointed to by this node by one. Keep changing operations until all nodes are separated. If there is no node with an in-degree of 0 at the end, it means that there is a cycle, and there is no topological sorting

depth-first search : DFS is performed on a graph, and the path of DFS can generate a tree; for nodes on the DFS tree, if If there is an edge pointing to the ancestor or pointing to itself, then there is a loop in the graph; the time complexity of this method is the same as that of DFS traversal, which is O ( V + E ) O ( V + E ) O ( V + E )

Q: Euler diagram

A circuit that passes through all edges in the graph exactly once and traverses all vertices is called an Euler circuit, an undirected graph with an Euler circuit is called an Euler graph; a path that passes through all edges in the graph exactly once and traverses all vertices is called an Euler path. An undirected graph with Euler paths but no Euler circuits is called a semi-Eulerian graph.
1. For an undirected graph G, G is an Eulerian graph if and only if G is connected and has no odd-degree vertices.
2. For an undirected graph G, G is a semi-Eulerian graph if and only if G is connected and there are exactly 0 or 2 odd-degree vertices in G.
3. For a directed graph G, it is an Eulerian graph if and only if all vertices of G belong to the same strongly connected component and the in-degree and out-degree of each vertex are the same.

Q: Critical path

AOE net, edges represent active nets. In the AOE network, there is only one vertex with an in-degree of 0, called the source point, and only one vertex with an out-degree of 0, called the sink point. Among all the paths from the source point to the sink point, the path with the largest path length is called the critical path, and the activities on the critical path are called critical activities. The shortest time to complete the entire project is the length of the critical path. If the key activities cannot be completed on time, the completion time of the entire project will be extended. As long as the critical path is found, the shortest completion time can be obtained.

algorithm

Commonly used algorithms: Calculation methods that will not exceed the complexity of
dynamic programming algorithms Specific sorting algorithms, data structure algorithms such as minimum spanning tree, shortest path, etc., deep search and wide search, pattern matching, etc. Website brush questions


Q; Basic programming algorithm questions, tell about your favorite algorithm? Are you familiar with the algorithm? Application Scenario, Improvement Direction

Q: Dynamic programming and divide and conquer algorithm?

1. The dynamic programming algorithm is similar to the divide-and-conquer algorithm. Its basic idea is to decompose the problem to be solved into several sub-problems, first solve the sub-problems, and then obtain the solution of the original problem from the solutions of these sub-problems.
2. Unlike the divide and conquer method, it is suitable for problems solved by dynamic programming, and the sub-problems obtained through decomposition are often not independent of each other. (That is, the solution of the next sub-stage is based on the solution of the previous sub-stage, and the further solution is carried out)
3. The dynamic programming can be gradually advanced by filling in the form to obtain the optimal solution.

Q: Algorithm definition

Algorithm is the method and steps to solve the problem, the standard for measuring the algorithm, finiteness, correctness, feasibility, zero or more inputs and one or more
outputs; time complexity: the approximate number of times the program will be executed, and Non-execution time (time is related to the machine); space complexity: the maximum memory space occupied by the program during execution; correctness, readability, robustness, high efficiency and low storage

Q: The time complexity of each sorting algorithm; quick sort and hash sort, the specific algorithm process and steps, and the characteristics of the algorithm

Q: Dijkstra algorithm and Floyd algorithm

1. The single-source shortest path problem of a weighted graph is a greedy algorithm, but the Dijkstra algorithm is more suitable for finding the shortest distance and path between two given points in the graph, and the calculation of the distance between each pair of vertices is relatively large; 2

. The Floyd algorithm is a classic dynamic programming algorithm. 1) Set the shortest path from vertex vi to vertex vk as Lik, the shortest path from vertex vk to vj as Lkj, and the path from vertex vi to vj as Lij, then vi to vj The shortest path is: min((Lik+Lkj),Lij), and the value of vk is all vertices in the graph, then the shortest path from vi to vj can be obtained 2) As for the shortest path
Lik from vi to vk or from vk to vj The shortest path Lkj is obtained in the same way
Time complexity: O(n²), the time complexity of Floyd's algorithm is O(n^3)
Space complexity: O ( n ), O ( n 2 )

Q: Minimum spanning tree, prim and kusral

Prim: The time complexity is O(n²). First, we determine a node, and then start from this node, and use the greedy algorithm to find the edge with the smallest weight. Gradually expand the number of included vertices until all the vertices of the connected graph are covered.

Kusral, the time complexity is O(eloge) (e is the number of edges in the network), so it is suitable for finding the minimum spanning tree of the network with sparse edges, and the initial state of the minimum spanning tree is only n vertices and no edges. Connected graph T = (V, {}), and each vertex in the overview graph forms a connected component by itself. Select the edge with the smallest cost in E. If the vertices attached to this edge are on different connected components in T, add this edge to T; otherwise, discard this edge and choose the next edge with the lowest cost. And so on, until all vertices in T form a connected component

Q: In-order traversal of a binary tree, and recursion is allowed;

Use the stack to realize;
void INOrderTraverse(BiTNode *T){ if(T){ INOrderTraverse(T->lchild); // traverse the left child displayElem(T); // call the function method of operating node data INOrderTraverse(T- >rchild); // Traverse the right child } // If the node is empty, return to the previous layer return; }







Q: How to improve the speed of radix sorting?

It can be seen from the complexity of radix sorting that a large parameter that affects the complexity is the choice of radix. When many people use radix sorting, the default radix is ​​10, but this will significantly increase the constant of algorithm complexity. Therefore, when the length of the array is large, choosing a larger radix may lead to better performance. We change the base of the algorithm to 1000

Q: The connection and difference between divide and conquer thought and dynamic programming thought

Q: The connection and difference between NP problem and dynamic programming

Q: How to delete continuous data in the array? delete string i to j

Computer Languages

C++: object-oriented, inheritance, encapsulation, polymorphism, virtual function, pure virtual function
C language: pointer, internal storage, implementation mechanism, etc.
Python language
Java language

Q: How are pointers implemented at the bottom?

Q: What programming languages ​​are you familiar with?

Q: The difference between python and C++ on the bottom layer

Q: The difference between java and python, how to understand object-oriented, what is the interface

Java is a statically typed language, and Python is a dynamically typed language. Python variables are dynamic, while java variables are static and need to be declared in advance; Python has many programs that use the process-oriented design
method. is added later, and java is to realize c++ without pointers, and mainly adopts the object-oriented design method, and many concepts are oop concepts. Process-oriented, relatively simple and intuitive, object-oriented, relatively abstract and elegant, but easy to over-abstract;
Python's library is powerful, regardless of GPU operation, neural network, intelligent algorithm, data analysis, image processing, scientific computing, all kinds of libraries can Java does not have as many open source libraries as Python. Many libraries are used internally by commercial companies, or they are released as a jar package, and the original code cannot be seen;
Java is biased towards commercial development, while Python is suitable for data analysis;

It is a kind of programming thought, transitioned from process-oriented, process-oriented way of thinking, it pays more attention to each step and sequence of this matter, it is more direct and efficient, you can start programming directly if you need to do what you need to do; object-oriented way of thinking, It pays more attention to who are the participants, what objects are in the requirements, and what each of these objects needs to do. Breaking it down into modules and objects makes it easier to maintain and expand.
Put the data and the operation method on the data together as an interdependent whole-object. Abstract the commonality of similar objects to form a class. Most of the data in the class can only be processed in the methods of this class. A class has a relationship with the outside world through a simple external interface, and objects communicate with each other through messages. The program flow is determined by the user in use. Simply put, everything is an object.
Encapsulation, inheritance, polymorphism;

Q: JAVA object-oriented programming has three major features: encapsulation, inheritance, polymorphism

Encapsulation : The core idea is to "hide details" and "data security", privatize the member variables and methods of objects that do not need to be accessed by the outside world, and only provide public methods that meet the developer's wishes to access these data and logic, ensuring data security Security and program stability. All content is not visible to the outside world.
Inheritance : Subclasses can inherit the properties and methods of the parent class and extend them. Inherit other functions and continue to develop.
Polymorphism : Objects of the same type can exhibit different behavioral characteristics when executing the same method. Polymorphism can be realized through inherited upper and lower transformations, interface callbacks, and method rewriting and overloading. Method overloading itself is a manifestation of polymorphism.

Q: The difference between pointers and references

Pointer : It is a variable that saves the memory address of another variable. The pointer accesses the value pointed to by the saved memory address through *;
Reference : It is an alias of another variable. Once initialized, it cannot be changed. A reference can be considered as a function with automatic indirection A permanent constant pointer, which is equivalent to the automatic indirection value obtained by the compiler, that is: the compiler helps to add *; the internal implementation of the reference is a pointer.

1. The pointer can be defined first, then initialized, and can be assigned repeatedly. The reference must be initialized when it is defined. Once it is initialized, it cannot be changed. It is similar to the definition
of
const.
4. The pointer can be multi-level, and the reference can only be one level;
5. The pointer needs (*) to refer to the value, and the reference can directly take the value.
6. Pointers support arithmetic operations, while references cannot.

Q: What is the difference between recursion and reference?

Recursion : It refers to a method in which a program calls itself directly or indirectly. It can simplify a complex and huge problem, and solve big problems by focusing on solving small problems that it differentiates.
A reference is not a new definition of a variable, but an alias for an existing variable. The compiler will not open up memory space for the reference variable, and it shares the same memory space with the referenced variable.

Q: When to use the destructor?

A constructor (method) is the first method that is automatically called by an object after the object is created. It exists in every declared class and is a special member method. The role is to perform some initialization tasks. Php uses __construct() to declare the constructor, and only one can be declared.

The destructor (method) is just the opposite of the construction method, and is the last method automatically called by the object before the object is destroyed. It is a newly added content in PHP5. It is used to perform some specific operations before destroying an object, such as closing files and releasing memory.
When we declare some pointer variables in a class, we usually do it in the destructor Release the space, because the system will not release the space pointed to by the pointer variable, we need to delete it ourselves, and generally this delete is placed in the destructor.

Q: static static variable usage?

It is hoped that the value of the local variable in the function will not disappear after the function call ends, but retain the original value, that is, the storage unit occupied by it will not be released, and when the function is called next time, the variable will retain the value at the end of the last function call. At this time, the local variable should be designated as a static local variable (static local variable).

Static local variables allocate memory locations within the static memory area. It will not be released during the entire running of the program; (2) Assigning the initial value to the static local variable is performed at compile time, that is, only assigning the initial value once; (3) If the initial value is not assigned when the local variable is defined, the For static local variables, the initial value 0 (for numeric variables) or null character (for character variables) is automatically assigned at compile time; (4) Although static local variables still exist after the function call ends, other functions cannot reference its.

Q: Does Java have pointers?

Without the definition of pointers, all object variables are pointers, and there are no non-pointer object variables, even if you want to use pointers. This is the generalization and strengthening of pointers.
It is no longer called a pointer, but an object variable. This is the conceptual dilution and weakening. There is no addition and subtraction of pointers, and no operators such as *, ->, etc. This is a simplification of pointers.

Q: Java's GC principle?

GC means garbage collection. Memory handling is a place where programmers are prone to problems. The GC function provided by Java can automatically monitor whether the object exceeds the scope to achieve the purpose of automatically reclaiming memory. There is a huge performance difference between CPU and memory and IO.

Q: What is the difference between C++ and java?

Java is more reliable than C++, the syntax is more concise, and it is completely object-oriented. Java is more portable when running on the JVM. Java does not need to allocate and recycle memory, and it is done automatically; there is no concept of pointers but directly uses arrays ; Use interface instead of multiple inheritance of C++;

Q: Can references pass parameters?

When passing a value of reference type to a parameter, the address of this value in memory is copied to a local variable, so changes in this local variable will be reflected outside the function.
It is equivalent to a pointer, and when the reference type is passed, it is equivalent to the transfer of the pointer.

Q: The malloc function of C language? C language return returns multiple values?

Applying for a memory block in the stack returns void* which requires forced type conversion and uses free to release;

using global variables, from the definition of variables to the end of the program;
array address method, the return value element is defined as an array, and used The address of the array is used as a formal parameter;
the structure address method, the structure pointer is passed to the formal parameter structure pointer;

Q: The reason for the stack overflow

The function call is too deep, such as recursion; the space is not released after dynamic application;

Q: What is the process of program compilation and execution?

compile, assemble, link, load

Q: What would you do with 5,000 lines of code?

computer network

Computer network: seven-layer model, various communication protocols, transmission process of each layer, etc.

Q: Is the layered idea of ​​the computer network and the OSI seven-layer model also a divide-and-conquer idea?

Layering is mainly carried out by division of labor, so that the functions can be divided into blocks, but each small part of divide and conquer has no connection, and in the seven-layer model, the services of each layer are based on the next layer

Q: Each layer and the protocol of each layer

The transport layer mainly provides general data transmission services for the process, including reliable and unreliable transmission, error control, flow control, multiplexing and demultiplexing, etc.; the network layer mainly provides
data transmission services for the host, including routing selection, error control, and flow control , congestion control, etc.; the data link layer is mainly to provide data transmission services for hosts on the same link, including framing, error control, flow control, access control, etc.; the physical layer is mainly how to
transmit data bit streams on the transmission medium, It does not refer to specific transmission media, that is, to shield the differences between transmission media and communication means as much as possible.

Q: What is the difference between circuit switching, packet switching and packet switching?

Q: Computer network: three-way handshake

In order to prevent the invalid connection request segment from being transmitted to the server suddenly, an error is generated. Expired connection request segment: the first connection request segment sent by the client is not lost, but stays in a network node for a long time, so that it is delayed until a certain time after the connection is released. server. It turns out that this is a segment that has already expired. However, after receiving the invalid connection request segment, the server mistook it as a new connection request sent by the client again. Then a confirmation message segment is sent to the client, agreeing to establish a connection. Assuming that the "three-way handshake" is not used, as long as the server sends a confirmation, a new connection is established. Since the client has not issued a request to establish a connection, it will ignore the server's confirmation and will not send data to the server. But the server thinks that the new transport connection has been established, and has been waiting for the client to send data. In this way, many resources of the server are wasted. The "three-way handshake" method can prevent the above phenomenon from happening.

Q: Ji Wang's four waves

Because when the server receives the request to disconnect from the client, there may still be some data that has not been sent. At this time, it will reply ACK first, indicating that it has received the request to disconnect. Wait until the data is sent before sending FIN to disconnect the data transmission from the server to the client.

Q: What is the meaning of the client TIME_WAIT status?

When waving for the fourth time, the ACK sent by the client to the server may be lost, and the TIME_WAIT state is used to resend the ACK message that may be lost. If the Server does not receive the ACK, it will resend the FIN. If the Client receives the FIN within 2*MSL, it will resend the ACK and wait for 2MSL again to prevent the Server from continuously resending the FIN without receiving the ACK.
MSL (Maximum Segment Lifetime), refers to the maximum survival time of a segment in the network, 2MSL is the maximum time required for a send and a reply. If the Client does not receive the FIN again until 2MSL, then the Client infers that the ACK has been successfully received, and ends the TCP connection.

Q: What is flow control? Purpose of flow control?

If the sender sends data too fast for the receiver to receive it, packets will be lost. In order to avoid packet loss, control the sending speed of the sender so that the receiver can receive it in time, which is flow control. The fundamental purpose of flow control is to prevent packet loss, which is an aspect of TCP reliability.

Q: How to achieve flow control?

The main way is that the ACK returned by the receiver will contain the size of its own receiving window, and use the size to control the data transmission of the sender.

Q: Deadlock caused by flow control? How to avoid the occurrence of deadlock?

When the sender receives a response with a window of 0, the sender stops sending and waits for the next response from the receiver. But if the response whose window is not 0 is lost during the transmission process, the sender has been waiting, and the receiver thinks that the sender has received the response and is waiting to receive new data, so that the two parties wait for each other, resulting in a deadlock.

To avoid deadlocks caused by flow control, TCP uses a persistent timer. This timer is started each time the sender receives a zero-window reply. When the time is up, it will actively send a message to ask the receiver for the window size. If the receiver still returns a zero window, reset the timer and continue to wait; if the window is not 0, it means that the response message is lost, at this time reset the sending window and start sending, thus avoiding the generation of deadlock

Q: Briefly describe congestion control and window

① Slow start algorithm ② Congestion avoidance algorithm ③ Fast retransmission algorithm ④ Fast recovery algorithm
Fast retransmission means retransmitting immediately after receiving three consecutive confirmations, so that there will be no timeout, and the sender will not mistakenly believe that there is a network error congestion. (Slow start threshold)
We mentioned earlier that the sending window swnd and the receiving window rwnd are approximately equal, so since the concept of the congestion window is introduced, the value of the sending window at this time is swnd = min (cwnd, rwnd), That is, the minimum value of the congestion window and the receive window.
The rules for changing the congestion window cwnd:
as long as there is no congestion in the network, cwnd will increase;
but if there is congestion in the network, cwnd will decrease;

Q: The difference between congestion control and flow control

Congestion control: Congestion control acts on the network. It prevents too much data from being injected into the network and avoids excessive network load. Commonly used methods are: (1) Slow start, congestion avoidance (2) Fast reload Pass, recover quickly.
Flow control: Flow control acts on the receiver. It controls the sending speed of the sender so that the receiver can receive it in time to prevent packet loss.

Q: Why do I need an IP address when I have a MAC address?

Since there are various networks all over the world, they use different hardware addresses. If these heterogeneous networks can communicate with each other, it is necessary to perform very complex hardware address translation work, so it is almost impossible for users or user hosts to complete this work. But the unified IP address solves this complicated problem. The hosts connected to the Internet only need to have a unified IP address, and the communication between them is as simple and convenient as connecting to the same network (virtual interconnection network or IP network for short), because the complicated process of calling ARP is performed by the computer. The software does it automatically, and the calling process is invisible to the user.

Q: The core idea in computer network

1. Distributed thinking - packet switching
2. Layered thinking: The advantage of layering is to reduce coupling. The upper layer does not care about the implementation of the bottom layer, but only cares about the service (interface) provided by the bottom layer; in this way, the
communication between layers can be standardized. Normalization implies layer-to-layer independence. , can be developed independently, this design brings great flexibility and scalability, such as TCP/UDP/DCCP/STCP at the transport layer, IPv4/IPv6 at the network layer, Ethernet, VLAN, WIFI at the data link layer, Wireless 3G, 4G, 5G protocols, etc.; layered mode has a recursive feature, which allows arbitrary encapsulation and re-encapsulation in a logical sense, such as overlay network, VPN, various tunnels, etc., which greatly enhances network scalability; 3. Fair
thinking – Transmission control: TCP's congestion control makes the network more fair and stable, improves the system's fault tolerance rate, and allows the system to continue to operate normally;

Q: What is the difference between http and https?

1. HTTP is a clear text transmission, and HTTPS is a secure SSL encrypted transmission protocol.
2. Use 80 for the HTTP port and 443 for the HTTPS port.
3. The HTTP connection is stateless, and the HTTPS protocol is constructed by the SSL+HTTP protocol.
(Stateless means that the sending, transmission and reception of data packets are independent of each other)

Q: The association and difference between the flow control of the data link layer and the transport layer?

1. The flow control of the data link layer is point-to-point, while the flow control of the transport layer is end-to-end.
2. The method of data link layer flow control is that the receiver will not reply to the confirmation frame if it cannot accept it. The flow control method of the transport layer is that the receiver tells the sender through the sliding window.

Q: How to ensure the security of data link layer and network layer?

Q; Can the data of the data link layer be directly forwarded to the subnet?

Q: NAT? ARQ protocol? ICMP protocol?

Q: Synchronous transmission and asynchronous transmission?

Q: What is the difference between TCP and UDP?

operating system

Operating system: job scheduling, process scheduling, memory management, etc.

Q: Process and thread, similarities and differences between thread and process

A process is the basic unit of operating system resource allocation, and a thread is the basic unit of processor task scheduling and execution (it can also be understood as an execution flow in a process); a thread is a part of a process; threads of the same process share the address of the

process Space and resources, and the address space and resources between processes are independent of each other; after a process crashes, it will not affect other processes in protected mode, but if a thread crashes, the entire process will die. So multiprocessing is more robust than multithreading.

Q: What does the OS implement?

It is the first layer of software on computer hardware, the first expansion of the hardware system, the manager of computer system resources (files, devices, processors, memory), and the interface between users and computers (command interface, GUI graphical user Interface), with concurrency (parallel, multi-CPU), shared, virtual, asynchronous (due to limited resources, the execution of the process is not consistent to the end, but advances at an unpredictable second-rate speed);

Q: Interrupt related?

The interrupt makes the CPU change from the kernel state to the user state, regaining the control of the CPU by the operating system
Whether the interrupt is related to the instruction being executed, internal interrupt, external interrupt (clock interrupt, I\O device interrupt)
each time an instruction is executed, check whether it is executed by External interrupt; interrupt type -> interrupt vector table;
the application can request the service of the operating system kernel through system calls, and various shared resources in the system are under the unified control of the operating system kernel, so all operations related to shared resources ( Such as storage allocation, I/O operations, file management, etc.), must make service requests to the operating system kernel through system calls;

Q: How does a mutex solve the resource problem of the critical section?

When multiple concurrent processes need to access the resources in the critical section, only one process can access the critical section, and other processes cannot access it. Other processes need to wait until the access of the process entering the critical section ends before they are eligible to access the critical section. This is mutual exclusion;

Q: Producer consumer model

Q: Scheduling algorithm

Other specialized courses (database, software engineering, principles of computer composition, cryptography)

Database: relational database models, views, etc.
Software engineering: software development models

Q: Measuring the performance indicators of the computer

The overall performance of the CPU, storage capacity, data input/output capabilities (i.e. I/O throughput), response time and power consumption, etc.

Q: view

A virtual table derived from one or more tables whose contents are defined by a query. It has the structure of an ordinary table, but does not implement data storage. View modification: single-table view is generally used for query and modification, and will change the data of the basic table. Multi-table view is generally used for query and will not change the data of the basic table.

Q: The view of the database, the physical and logical structure of the database

Q: What is the basic principle of SQL injection?

Q: How to realize the atomic operation of database transaction? memory leak?

Q: Software development model

The software life cycle is divided into 6 stages, namely requirement analysis, planning, design, coding, testing, operation and maintenance.
1. Waterfall Model: Each stage is executed only once, so it is a linear sequential software development model.
2. Spiral model: It is one of the representatives of the incremental development model.
3. Iterative model: The iterative model is like a small waterfall project. Each iteration produces a releasable product that is a subset of the final product.
4. Incremental models: use a linear sequence that staggers over time.
5. Agile model: The agile model is a lightweight, efficient, low-risk development method that emphasizes teamwork and communication. It is suitable for small and medium-sized development teams with vague or changeable customer needs.

Q: Why do software testing, what is the goal?

Software testing is to find errors and defects in software products, and then software developers repair errors and defects, improve the quality of software, and finally submit a software product that meets user needs.

Q: Cryptography

AES, DES
hash function SHA256, SHA3, SM3: Hash (hash, hash) function, which converts an input of any length into a fixed-length output through a hash algorithm, and the output is the hash value. Simply put, it is a function that compresses a message of any length into a message digest of a certain length, which is also called an information fingerprint.

Q: The characteristics of the hash function:

Compression: the input is of any length, and the output is a fixed length; > Efficiency: fast calculation;
one-way: it is not feasible to calculate the input from the hash value;
anti-collision:
weak collision: given x1, find x2≠ x such that H(x1)
= H(X2);
strong collision: find a pair of x1 and xz such that H(1) = H(x;
sensitivity: a one-bit change in the plaintext has a significant effect on the hash value of
the digital signature: It is a digital string generated by the signer using its private key and message that others cannot forge. The validity of this digital string can be verified by using the signer's public key and message. Elliptic Curve Digital Signature Algorithm (ECDSA) SM2 uses
elliptic The simulation of digital signature algorithm (DSA) by Curve Cryptography (ECC)
.Blockchain is a secure shared decentralized data ledger.Blockchain technology supports a specific set of participants to share data.It can collect and share Multiple sources of transactional data can subdivide data into shared blocks linked together by unique identifiers in the form of hashes, and ensure data integrity through a single source of information, eliminate data duplication, and improve data security.Related technologies: Hash function (SHA-256), digital signature algorithm (ECDSA), etc.

Q:RSA encryption algorithm

Its public and private keys are functions of a pair of large prime numbers (100 to 200 decimal digits or larger). The difficulty of recovering plaintext from a public key and ciphertext is equivalent to decomposing the product of two large prime numbers (this is a recognized mathematical problem)
asymmetric encryption algorithm, the forward solution of the one-way function is simple, the reverse solution is complex, and the information The recipient generates a public key and a private key, publishes the public key, the sender calculates the original text and the recipient's public key to obtain the ciphertext, and the recipient decrypts the ciphertext and the private key

math

Q: What is a binary relationship?

The binary relationship mainly describes the relationship between elements of two sets or the relationship between elements within a set; given two sets A and B, R is any subset of the Cartesian product A × B, Then R is called a binary relation from A to B.

Q: What is the Fourier transform?

The purpose of Fourier transform is to transform the signal in the time domain (that is, the time domain) into the signal in the frequency domain (that is, the frequency domain). As the domain is different, the angle of understanding of the same thing will also change. , so some places that are difficult to deal with in the time domain can be handled relatively simply in the frequency domain.

Fourier transform believes that a periodic function (signal) contains multiple frequency components, and any function (signal) f(t) can be synthesized by adding multiple periodic functions (basis functions). From a physical point of view, the Fourier transform is based on a set of special functions (trigonometric functions) as the orthogonal base, and the original function is linearly transformed. The physical meaning is the projection of the original function on each set of base functions.

Q: Maximum likelihood estimation? Positive definite matrix?

It is a parameter estimation method, which estimates the parameters of the model through the given data, and uses the known sample results (statistical probability) to deduce the parameter values ​​​​that are most likely to lead to such results

insert image description here
Q: Ordinary differential equation solution?

Q: People related to calculus?

Q: What is the difference between supremum and infimum?

Q: Proof of equivalence relationship?

Q: Definition of proposition? Are exclamatory sentences propositions?

Q: Naive Bayes principle

Q: Taylor formula, Taylor series, Taylor expansion?

Q: What is the difference and connection between quadratic integral and double integral?

Q: Sequence limit?

Q: Can it be guided?

Q: What is the difference and connection of differential mean value theorem?

Q: Directional derivative?

Q: Gradient?

Q: L'Hopital's rule?

Q: What are the properties of integrable functions?

Q: What is the mean value theorem of integrals?

Q: What are the conditions for the existence of an inverse function?

Q: Consistent and continuous?

Q: What are the necessary and sufficient conditions for an n-order matrix to be diagonalizable? 2. What is the nature of mathematical expectation?

Q: Conditional probability, total probability formula, Bayesian formula, conditional probability of probability theory, give an example of application?

Q: Derivation of high numbers, partial derivative

Guess you like

Origin blog.csdn.net/Magnolia_He/article/details/127697469