I have taken Tencent back-end development post offer, briefly talk about my interview experience and learning route

Prepare before

After finalizing the direction and goal, the system preparation is started, which is mainly divided into the following aspects to prepare.

Algorithm question

I have seen other people’s social recruits in advance, and I know that Toutiao has algorithmic questions in every technical round, and this is usually less practiced, and I have forgotten a lot of the questions I brushed in school recruits. Therefore, it took a lot of time to review the algorithm questions in the system. First, I quickly finished the offer of sword finger. This school recruit has already brushed both sides, so it will be relatively faster now. Then, let’s gnaw on LeetCode's questions. There are more LeetCode questions. It is basically impossible to complete them in just a few weeks. Therefore, I mainly brush according to the type. Brushing a few questions for each type will make it feel better. For example, the problems of the linked list give priority to recursion and double pointers, and the problems of stacks and queues give priority to the use of two stacks or queues. Tree problems are basically recursive. However, array and string questions are generally more flexible, and this kind of questions can only be used as much as possible. Usually it’s not convenient to go to work and brush the questions. The method I use is to read the questions and open the LeetCode website with my mobile phone. After reading the questions, I directly think about the solution. I probably think about how to write the code. I can just think about it. If it comes out, just look at other people's solutions, and it's quick to use this method. In this way, you may be worried about the incomplete writing of the question during the interview. In fact, don't worry too much, because during the interview, the interviewer sees that the core ideas you write are correct, and the boundary processing is right. The interview time is relatively limited.

Theoretical basis

The basic part mainly focuses on quick review, mainly language (I mainly use C++, so I review C++), operating system and network programming. There are a lot of questions about school recruiting, and fewer questions about social recruiting, but it will be more embarrassing if this one cannot be hit. I won’t talk about the language. Everyone knows what to take the exam. After all, they have been crazy about preparing for school recruitment. The operating system depends on memory management, process management, and file system. Generally, there are a lot of questions about virtual memory. Network programming includes three aspects: TCP/IP protocol, HTTP protocol, and network security. TCP/IP is mainly three-way handshake, four waved hands, and the role of TIME_WAIT. The HTTP protocol examines the return code of the HTTP protocol, HTTP methods, and so on. It is important to point out that the detailed process of HTTPS encryption must be very thorough, otherwise it is easy to have a feeling that everything seems clear, but it is a bit unclear when asked. The last is network security, the main investigation is also WEB security, including XSS, CSRF, SQL injection, etc.

Backend technology

The back-end technology here mainly refers to some basic components to be used in the work, and some common back-end architecture designs. Mainly prepared MySQL, Redis, message queue, zookeeper, distributed system architecture design and docker. MySQL mainly read "High-Performance MySQL Third Edition". It is very good about transactions, indexes, locks, binlog and redolog. It is also the favorite test in interviews. In addition to the separation of reading and writing of the database, and the division of database The table must be mastered. Redis mainly read "The Design and Implementation of Redis", and then I summarized the usage scenarios of Redis, and Redis realizes the basic Redis of distributed locks. For distributed systems, prepare CAP theory, BASE theory, current limiting, fusing, consistent *** algorithm, master-slave architecture, cluster architecture, remote multiple activities, load balancing, layered architecture, microservices, etc.

Dig into the project

I don't have experience in participating in open source projects, and the projects I do at work are very average. I don't really have much to do with the project, but I still need to dig a bit. After all, this one cannot escape. Let me talk about a few points of my thinking:
look for relatively bright spots in the project. For example, I use redis to implement a delay queue, and then I use fragmentation to solve the bottleneck of this delay queue, and accelerate the processing speed through distribution.
Find the complicated part of the project. If there is something complicated in the project you are doing, even if you did not do it, you can use it as an example, provided that you have to figure it out very clearly.
Quantitative indicators. An interface originally had performance problems. For example, you made a small optimization to optimize the TP99 time from the original 500ms to 200ms.
Empower the entire team. In the process of developing a business, there will definitely be some repetitive work or services that can be reused. You can develop a certain tool or service a certain function and promote it to the whole group, creating value for the company.
Tencent Interview
Tencent will send text messages 1 day and an hour before the interview. I went to the Tencent Binhai Building for an interview. The building is very modern, but I need to remind that Tencent's Binhai Building is divided into a South Tower and a North Tower. I went up the wrong floor when I went, and I needed to go down to the 4th floor and change to the elevator.

written examination

The characteristics of microservices , how to realize service discovery and load balancing.
C++ memory management
time_wait is generated at which end and what is the
function. How to locate the program crash How to locate the
service performance problem How to locate the
median of two sorted arrays Design an algorithm
for the square root of the number n
, The more the number of draws, the higher the probability of winning.
How MySQL analyzes the execution of a statement. What is the difference between delete from t1 limit 3 and delete from t1?

one side

Ask the project
Jumping steps
Odd-numbered elements in the array.
A building has n floors. I don’t know which floor the egg will be broken. Use the least number of times to find the floor that happens to be broken.
What is the difference between dynamic planning and greedy
redis data structure?
How does the underlying implementation of redis achieve high availability
? What are the load balancing algorithms?
How does the service discovery work? How is the
fuse implemented? How does the
id generator implement? How to achieve global increment?
The difference between coroutines and threads ? Which forums and researches are used for
inter-process communication methods
? Which algorithm is the
paxos algorithm? I don’t know this algorithm. Then I talked about how the raft algorithm
gdb switches threads.
How to judge whether a graph has a loop.
Introduce the cache.
Check the CPU commands and disk IO commands.

Two sides

Draw the system architecture of the project.
How to optimize if the number of users increases?
How to implement the load balancing weighted polling algorithm?
Knapsack problem.
Bayesian principle of probability.
Word segmentation algorithm.
Continuous integer summation (leetcode question 829) requires time complexity less than O( N)

HR face

1. Asked about other job opportunities besides Tencent? What are they
2. Tencent, XXX company, XXX company, what is your priority and why?
3. What was the previous salary? What is your salary expectation?
4. What are your hobbies?
5. Do you understand the job requirements?
6. Any questions?

The last algorithm question on the second side of Tencent can only come up with O(N) complexity, and the interviewer must be less than O(N), and it cannot be answered. This question is the difficulty of the leetcode hard level, so there is no brush. Later, I discussed with the interviewer what I am good at, such as coroutine and TCP, because I also like to study these things on GitHub. I personally learn more about
coroutine
TCP
here (/狗头)

Technical knowledge learning route

[Article benefits] I recommend my own linuxC/C++ language exchange group: 832218493! Organized some learning books and video materials that I think are better to share in it, and you can add them if you need them! ~
Insert picture description here
Insert picture description here

1. Data structure and algorithm, design mode, project management

Sorting (11 sorts) and KMP
red-black tree proof
B-tree and B+ tree
Hash and Bloom filter
Responsibility chain mode
Filter mode
Publish subscription mode
Factory mode
Makefile/cmake/configure
git /svn and continuous integration
Linux system runtime commands

Two, code implementation, program analysis


The principle and realization of network io and select/poll/epoll reactor. The realization of
http/https web server. The realization of
websocket protocol and server realization. The realization of
server concurrent millions (c10K, c1000k, C10M)
redis/memcached/Nginx network component
Posix API and network protocol Stack
UDP reliable protocol QUIC/KCP

Three, pool structure, high-performance components, open source components

Thread pool (handwritten)
memory pool ringbuffer
asynchronous request pool performance optimization, asynchronous mysql asynchronous dns asynchronous redis
mysql connection pool
redis connection pool
atomic operation CAS
message queue and lock-free queue
timer scheme red-black tree time wheel minimum heap
lock implementation principle Mutual exclusion lock, spin lock, optimistic lock, pessimistic lock, distributed lock
Server connection keepalived
try/catch implementation
Libevent/libev framework
Asynchronous log program log4cpp
application layer protocol protobuf/thrift
openssl encryption
json and xml parser
character encoding unicode/gbk/utf-

Fourth, the implementation of the coroutine framework, user mode protocol stack NtyTCP (tcp/ip)

The principle and engineering case of the
coroutine The implementation of the scheduler of the coroutine The realization of the
sliding window congestion control to start the
tcp timer The realization
of the source code of epoll

Five, Skynet, ZeroMQ, DPDK

Skynet high-performance gateway
actor realization and cluster/load balancing
skynet network and hot update data sharing
ZeroMQ Router-Dealter mode
Source code analysis: message model and engineering case
Source code analysis: network mechanism
dpdk PCI principle and testpmd/l3fwd/
skeletion kni data flow
dpdk realization
Realization of dns dpdk high-performance gateway
, acceleration of paravirtualized virtio/vhost

六、 MySQL、Redis、Nginx、mongodb、dfs

SQL statement index stored procedure trigger
2. Database connection pool and sql analysis and analysis
Storage engine principle MyISAM and Innodb transaction isolation
Implement a storage engine MySQL source code
MySQL cluster and distributed high availability and high concurrency
Redis related commands and persistent
Redis connection pool and Asynchronous operation
Source code analysis: storage principle and data model
Source code analysis: master-slave atomic model
redis cluster solution
Nginx uses conf to configure
nginx module to develop filter module
Nginx module to develop handler module
Source code analysis: Nginx Http state machine
source code analysis: inter-process communication and Slab sharing mechanism
Mongo interface programming and MongoDB commands use
MongoDB cluster solution
ceph
fastdfs

Seven, Linux kernel process management, memory management, file system

Process management and scheduling
Lock and inter-process communication
system call How to implement a syscall
physical memory partner algorithm by yourself
2. Process virtual memory mm_struct
page recovery and page swap
Virtual file system
Ext2/3/4 file system
No persistent storage

8. Performance analysis

Tool wrk/ webbench/ loadbalance/valgrind
Google gTest/Memtrack
flame map/heat map

Nine, distributed architecture

Tencent's Tars
virtualized docker
distributed registry etcd
P2P network penetrates the decentralized network, accumulates every day, and finally achieved
Insert picture description here
something! ! !

Guess you like

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