[School Recruitment] A must-see for LinuxC/C++ background development (for you who enter BATJ)

White prostitution is not good, or else like it first!

I introduce myself

I, Xiaoshuo, participated in many security-related companies (Shenfu, NSFOCUS, etc.) during the autumn recruitment period. I also participated in interviews with Internet companies such as JD.com, Xiaomi and Didi. I also interviewed several research institutes and a bank. Summarize the relevant situation of the next autumn recruitment.

2. Interview situation

Insert picture description here

This is a high-frequency question for Linux background development interviews that I have compiled (except for the language part, the other parts should not be much different), and provide books or video resources of related knowledge. Those who need these video materials can join the group: 832218493 for free!

Three related knowledge points summary

1. The
principle of c/c++ related c++ virtual functions. How does
smart pointer
c language realize c++ objects and private members.
C++ polymorphism realizes
the difference between new and malloc and the underlying realization principle
. How to expand the vector in STL?
The initialization process of virtual function pointer
c++11 Atomic variables introduces
what are the features of C++11,
how to understand overloading and rewriting,
how to understand
the difference between the static keyword vector and list in
C++,
the underlying implementation of memory allocation map and set in C++,
the initialization of class static variables
Can the destructor be a virtual function? Why is the difference between
deep copy and shallow copy
pointer constant and constant pointer

C language grammar recommended books: "c expert programming" "c and pointer"

Recommended books for c++ language: "c++ primer" "effect c++"

The underlying principle of c++ language stl: "STL source code analysis"
Insert picture description here

2 Computer network

Introduce
the composition of proactor and reactor reactor
TIME_WAIT harms
TIME_WAIT duration, why?
Why is IP fragmented? In the
project, it is said that the thread pool is used, how big is it, and why is it used?
The difference between select and epoll When
select returns 0, what are the
readable conditions of epoll
When does TCP wave four times?
How to set up non-blocking
What is zero copy?
The difference between tcp and udp and application scenarios
How to design a reliable udp
sticky package and how to solve it.
Talk about the
difference between congestion control and flow control. http and https. Do
you understand the principle of man-in-the-middle hijacking of
http protocol format, several methods, and what
chunk of function ? Introduce
what contentlength looks like when there is a chunk.
At which stage is the half connection? The
detailed process of the three-way handshake and four-way handshake. The more detailed the better the
libevent structure.
The reliability of the internal implementation of tcp is reflected in the ET and LT modes in the
ARP protocol workflow
epoll
Introduce
the difference between the sliding window, the pointer and the reference,
at which stage of the three-way handshake , the difference between
the receiving buffer and sending buffer of Udp and tcp
The difference between long http connection and short connection
udp packet length
What process will a URL access go through
? Will the data packets be processed out of order?
The seq is 1000, 1000 pieces of data are sent, what is the next seq?
If syn is lost, how many retransmissions

Recommended books on tcp/ip: "tcp/Detailed Explanation: 1"

Insert picture description here

3 Data structure related

How hash handles conflicts
Binary search and its variants
The difference between arrays and linked lists
What are the redis data structures used, and what about jumping tables?
What are the advantages of red-black trees over balanced binary
trees. Binary trees, b+ trees, hash, and binary search trees.
Talk about the characteristics
of red-black trees. The time complexity of various trees and sorts.
Database indexes, transactions, and transaction levels
do not consider transaction isolation What will happen?
Transaction isolation level
Index type
AC automata time complexity

Data structure book "Dahua Data Structure"

4 Database related

How to improve query speed?
Is it fast after adding an index? The difference between the
underlying structure of database index
mysql and memcache is the difference between
the
MySQL B+Tree index and Hash index of the three common mysql storage engines ?
The obvious difference between a B+ tree index and a hash index is: the difference between a
non-relational database and a relational database, what are the advantages?
mysql common query optimization scheme

Recommended mysql books: "mysql must know and know", "high performance Mysql"

5 Operating System

The difference between process and thread The difference between
multi-process and multi-thread, the difference between
volatile and atomic variables in application scenarios
proc file system The difference between
spin lock and ordinary lock
Virtual memory
The memory distribution of the process
Why stack memory is automatically allocated and released by the system
How the daemon process is created
Inter-process communication methods and their differences, application scenarios
Deadlock conditions and releases
Process scheduling methods
Understanding of compilation and connection
Principles of shared memory implementation
What is a zombie process and how to deal with the use of
spin locks in single CPU and multiple CPUs.
User mode and Kernel mode

Operating system recommended books: "In-depth understanding of operating systems", "Linux kernel design and implementation"
Insert picture description here

6 Linux basic knowledge and application programming (required in the background!)

How to view the files opened by the process.
Introduce the nm and ldd commands,
shell commands to check memory, port, io access, read and write speeds.
Awk grep specific application
Hard link and soft link, directory can use hard link
Common command netstat iptable tcpdump top
makefile introduction Next (introduced by cmake)
gdb view all in the stack traverse
gdb view shared_ptr points to the content
how gdb debug multi-process multi-threaded
g++ and gcc compiled what is the difference between
how to debug
what is in the core file,
how to read the gdb debug core file What happens to a 10G file, cat a 10g file

Recommended books on Linux basic commands: "Linux should learn this way"

Linux application programming recommended books "Back-end development application and practice" "Linux multi-threaded server programming"

Supplementary information: detailed explanation of gdb manual and makefile

7 Large number problems

There are 20 billion qq, but there are actually only 2.5 billion users. Find the duplicate qq.
How large is the memory usage of 2.5 billion qq?
1 to 1 million? Find out all the prime numbers (computationally intensive tasks). How to deal with
1 with single thread and multi-thread The file writing program of G is sent from machine A to machine B. How to send it?
100G text, 80k or 80 characters per line, suggest using multiple machines, multiple processes, and multiple threads to find the most repeated lines. A machine has 8G of memory. How much is each machine divided into? Can you read 100G text? Find the
three ordered sequences of the top ten texts with repetition rate , and find the common part. For the first time, I said to use a hash table. He said that the sequence is too large and the space complexity should be low. I said binary search. He asked The search order and time complexity of the three sequences. (The time complexity is
NlogN logN) 100WURL, how to store
10 servers, 100w users, how to load balance, how to
find the smallest 100 of 10,000 data when a server is down ? time complexity?
Scenario question: The QQ server will save the QQ number of the logged-in user. As long as there is a login, there will be a record in the file. Now we need to count which QQ numbers have logged in, how to do it? (First talked about the use of small files for divide and conquer, he said in addition to this, I said bit array, he asked how much memory is needed?) The
usual routines for large numbers are hash, divide and conquer, bloom, bitmap, or if recommended The above data structure related information. Of course, if you can understand the following such as hdfs file system, mapreduce, spark/flink streaming computing is best.

8 Hand tearing algorithm (recursive non-recursive)

To determine whether the linked list has a ring or not, to
implement a singleton mode,
to determine the number of words in a string, the
square extraction algorithm, the
frog jumps the stairs, the
common sorting (quick sorting and merging to write spit),
reverse the linked list
two linked lists, find common nodes to
find no duplicates in the string The longest substring of
LRU
handwritten code to find the depth of the tree.
Handwritten producer consumer.
Programming to achieve string class.
Two arrays A, B, A and some B, ask for BA;
input a string, output its full array
statistics How many nodes of the binary tree are
implemented by memcpy? The
algorithm learning book recommends "Sword Finger Offer", and it is recommended three times.

Leetcode is divided into columns to practice several questions, not many, but essence.

9 For project related

Introduce a comparative project that you did, how many people did it, and what role do you play
? Where are the technical points of the
project and where are the shortcomings of
the project What
did you learn in the project Let you optimize a point in the project, how to do it, and
what architecture to
measure the system performance What should I do if I hang up?
It’s best if you have done a project yourself. Even if you don’t need to figure out its architecture, why do you do this, what are the advantages, and what optimization solutions?

10 Scene questions

For a scenario, design a regular crawling of URLs, such as crawling Sina n times an hour, and then some blogs may crawl once a week.
For a scenario, design a server to implement crawler URL de-duplication, how to make multiple servers specify the number of times for a URL crawler A
lot of small files, design a server to realize how to store files
Design two places to efficiently transfer files

11 Architecture/distributed/middleware related

Common load balancing strategies
Consistency hash principle
Data consistency issues in cache disaster recovery
Do you understand cap theory?
Introduce the basic concepts of high availability, high performance, and scalability. .
Understand microservices? docker? k8s? To
what extent has Nginx learned, nginx configuration update implementation, event model

Recommended books: "redis design and implementation", "learning architecture from zero", "docker entry to practice", "large-scale website technical architecture-core principles and case analysis"

12 Conclusion The
above are related questions that are frequently encountered in technical interviews during the Mid-Autumn Festival. More large companies have been in the official account, and I hope to help everyone.
Insert picture description here

Guess you like

Origin blog.csdn.net/lingshengxueyuan/article/details/112676740