Which skill trees need to be lit for C/C++ background development|| (Goose Factory as an example)

Foreword
First, general companies are divided into front-end and back-end. The front-end deals with users and is responsible for presenting data to users with good visual effects. The broad front-end includes client (Android, IOS), Web front-end, applets, etc.

The corresponding back-end is responsible for business logic processing, such as order placement, payment, etc., focusing on the processing of business processes.

Back-end generally means the same thing as back-end, while server development is a bit more general, including not only back-end development, but also basic development that supports the entire back-end application, such as search engines, microservices, RPC frameworks, KV, storage, MQ, etc. .

The back-end/back-end focuses on business processing and is biased towards application-level development. Server development not only includes application-level development, but also includes the entire development of related components that support back-end business.

So what does Linux C/C++ server/backend development refer to? It is actually based on C++ programming on Linux.

But compared to the Java department, it emphasizes Linux system programming and network programming capabilities, and some also involve the development of server-side underlying protocols and network frameworks.

Traditional Java and Go background development tends to be web development, that is, receiving front-end requests, calling each other through microservices, completing business logic processing, and then returning to the front-end.

In fact, the C++ backend development on Tencent’s side is similar. It has a very mature C++-based microservice system. Most development only needs to focus on business logic, but it still requires Linux system programming, network programming, etc. ability.

What are the background developments examined?

What technical level can Tencent T9 (formerly T3.1) offer?

Generally speaking, the direction of Linux C/C++ background development involves the following basic knowledge:

C/C++ language features and implementation principles
Computer network
network programming and Linux system programming
Operating system principles
Some Linux kernel principles, such as memory management, file system, virtual memory, etc.
Linux common commands use
Algorithms and data structures
Database use and principles
Common NoSQL components, Such as Redis, Memcached
version control Git
optional extra points:

Distributed related, such as consistency protocols such as Raft algorithm, distributed storage
, etc. Virtualization and cloud computing-related
system design capabilities such as docker, k8s , such as short-chain services, comment services, feed streaming systems, red envelope grab, seckill, etc.Insert picture description here

Frequently encountered interviews to investigate knowledge points:

c/c++ related

  • C++ virtual function principle
  • Smart pointer
  • How to implement c++ objects and private members in c language
  • C++ polymorphism implementation
  • The difference between new and malloc and the underlying implementation principle
  • How to expand the vector in STL
  • The initialization process of virtual function pointer
  • Introduction to C++11 Atomic Variables
  • What are the features of c++11, say used
  • How to understand overloading and rewriting
  • How to understand the static keyword in C++
  • The difference between vector and list
  • C++ memory allocation
  • The underlying implementation of map and set
  • Initialization of class static variables
  • Can the destructor be a virtual function? why
  • Deep copy and shallow copy
  • Pointer constant, the difference between 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"

computer network

  • Introduce proactor and reactor
  • The composition of reactor
  • TIME_WAIT harm
  • TIME_WAIT duration, why?
  • Why IP fragmentation
  • The project said that the thread pool is used, how big is it, and why is it used?
  • The difference between select and epoll
  • Select what situation returns 0
  • What are the readable conditions of epoll
  • When does TCP need to 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
  • How to solve sticky bag
  • Talk about congestion control and flow control
  • The difference between http and https
  • Do you understand the principle of middleman hijacking
  • http protocol format, several methods, what are the functions
  • Chunk understanding? introduce
  • What does contentlength look like when there are chunks
  • At what stage is the semi-connection
  • The detailed process of three-way handshake and four-way handshake, the more detailed the better
  • libevent structure, internal implementation
  • Where is the reliability of tcp
  • ARP protocol workflow
  • ET and LT modes in epoll
  • Introducing the sliding window
  • The difference between pointer and reference
  • Which stage of the three-way handshake does Accept occur
  • The difference between Udp receiving buffer and sending buffer and tcp
  • The difference between http long connection and short connection
  • udp packet length
  • What process will a URL visit go through
  • Will the data packets be processed out of order?
  • The seq is 1000, 1000 data is sent, what is the next seq?
  • If syn is lost, how many retransmissions

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

Familiar with using wireshark packet capture tool, to deepen the impression, you can use a library of python, scapy/dpkt.

Data structure related

  • How hash handles conflicts
  • Binary search and its variants
  • The difference between array and linked list
  • Which redis data structure has been used, understand the jump table?
  • What are the advantages of red-black trees over balanced binary trees
  • The difference between binary tree, b+ tree, hash, binary search tree
  • Talk about the characteristics of red-black trees
  • Various trees, sorting time complexity
  • Database index, transaction, transaction level
  • Do not consider what will happen to the isolation of the transaction
  • Transaction isolation level
  • Type of index
  • AC automata time complexity

Data structure book "Dahua Data Structure"

Database related

  • How to improve query speed?
  • Is it fast after adding an index?
  • Database index underlying structure
  • The difference between mysql and memcache
  • mysql common three storage engines
  • The difference between MySQL B+Tree index and Hash index?
  • The obvious area of ​​B+ tree index and hash index
  • What are the differences between non-relational databases and relational databases, and what are the advantages?
  • mysql common query optimization scheme
  • Recommended mysql books: "mysql must know and know", "high performance Mysql"

operating system

  • The difference between process and thread
  • The difference between multi-process and multi-thread, application scenarios
  • The difference between volatile and atomic variables
  • proc file system
  • The difference between spin lock and ordinary lock
  • Virtual Memory
  • Process memory distribution
  • Why stack memory is automatically allocated and released by the system
  • How to create a daemon
  • Communication methods and differences between processes, application scenarios
  • Deadlock conditions and release
  • Process scheduling method
  • Understanding of compiling and linking
  • Shared memory implementation principle
  • What is a zombie process and how to deal with it
  • The use of spin lock in single cpu and multiple cpu
  • User mode and kernel mode

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

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

  • How to view the files opened by the process
  • Introduce nm and ldd commands
  • Shell command to check memory, port, io access, read and write rate
  • Specific application of awk grep
  • Hard link and soft link, can the directory use hard link
  • Common commands netstat iptable tcpdump top
  • Under makefile introduction (under cmake introduction)
  • gdb view all traversals in the stack
  • gdb view the content pointed to by shared_ptr
  • How to debug multi-process and multi-thread in gdb
  • What is the difference between g++ and gcc compiled
  • How to debug deadlock
  • What is in the core file, gdb debugs the core file
  • How to read a 10G file, and what happens when a 10G file is cated

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

Large number problem

  • There are 20 billion qq, but there are actually only 2.5 billion users, and a duplicate qq is found
  • How much memory does 2.5 billion qq take up
  • 1 to 1 million, calculate and find all prime numbers (computational intensive tasks), how to deal with single thread and multi-thread
  • 1 G file writing program, sent from A machine to B machine, 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 top ten texts with repetition rate
  • Three ordered sequences to 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 order of the three sequences and time complexity. (The time complexity is N*logN
    *logN)
  • 100WURL, how to store
  • 10 servers, 100w users, how to load balance, how to do if a server is down
  • Find the smallest 100 of 10,000 data? 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 small file for divide and conquer. He said that besides this, I said bit array, he asked how much memory is needed?)

The usual routines for large numbers problems are hash, divide and conquer, bloom, bitmap, if recommended, or the data structure related information above. Of course, if you can understand the following such as hdfs file system, mapreduce, spark/flink streaming computing is best.

Hand tear algorithm (recursive non-recursive)

  • Whether the linked list has a ring or not
  • Implement a singleton pattern
  • Determine the number of words for a string
  • Square root algorithm
  • Frog jumping
  • Commonly used sorting (quick sorting and merging should be written)
  • Reverse linked list
  • Two linked lists, looking for common nodes
  • Find the longest substring that does not repeat in a string
  • LRU
  • Handwriting the code to find the depth of the tree
  • Handwritten producer consumer
  • Programming the string class
  • Two arrays A, B, and A have some B, ask for BA;
  • Input a string, output its full arrangement
  • Count the number of nodes in a complete binary tree
  • memcpy implementation

Algorithm learning books recommend "Sword Finger Offer", it is recommended three times.

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

For project related

  • Introduce a comparative project you did, how many people did it, and what role do you play
  • Where is the technical point of the project
  • Where is the project?

What
did you learn in the project? Let you optimize a point in the project, how to do it, and
what structure of the project. Have you
measured the performance of the system?
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?

Scene question

  • 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 the server to implement the URL deduplication of the crawler. How to make multiple servers crawl a URL for a specified number of times
  • A lot of small files, design a server to realize how to store
  • Design two places to transfer documents efficiently

this part

Architecture/distributed/middleware related

  • Common load balancing strategies
  • Consistent hash principle
  • Data consistency issues in cache disaster recovery
  • 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"

doubt

There is also a doubt that many students who choose C++ direction have, I also want to explain here:

C++ has many language features and is difficult to learn. Many of them are only used by low-level development. C++ is a pit. Should I switch to Java or Go?

Of course not. It is true that there are more Go and Java departments in business departments such as Toutiao, Meituan, and Ali. First of all, it is the same point of view. School enrollment is a blank paper for companies. The interviewer examines your foundation. Knowledge and intelligence determine whether there is potential for cultivation, and language is really not important.

Then you might say that there are often problems related to language such as ConcurrentHashMap, virtual table, and virtual function implementation mechanism in various aspects.

In my opinion, the interview asks in-depth about some language implementation details. In fact, it is not a test of your language, but to see if you have the consciousness of actively delving into it, whether it is only at the application level, and also uses language to examine some data structures, Basic knowledge of operating systems.

So, I think you can study C/C++, Java, or Go in depth. The key is to find the right learning route and keep on learning. Don’t stop every day whether I am learning Java or C++. To solve the problem.

And there are many Java who need to switch to C++ when entering Tencent, and C++ needs to switch to Java when entering Alibaba and Meituan. This is not a problem.

What are the current application scenarios of C++?

In a word, applications that require high performance or execution efficiency, such as game engines, infra, recommendation engines, storage, etc., of course can also be used to write business (yes, goose factory), and there are also C++ client developments. , Mainly MFC, QT, etc.

To be honest, game engines, infra, etc. have relatively high thresholds, and the number of recruitments is also limited. It is difficult for ordinary people to enter, and most of the Internet companies' business departments currently use languages ​​such as Java and Go.

Therefore, the demand for C++ is much less than that of Java and Go, but at the same time learning C++ is not as much as Java, so relatively speaking, the competition is not that big, and C++ is good at learning. You can also go to Ali, A company with a Java technology stack like Meituan, big companies basically do not restrict language.

Tencent T9 level corresponding technical capabilities :
Insert picture description here
C/C++Linux server development/back-end architect
Linux, C/C++ technical exchange group: [960994558] I have compiled some books, interview questions, and interesting projects that I think are better Share with popular technology teaching video materials (including C/C++, Linux, Nginx, ZeroMQ, MySQL, Redis, fastdfs, MongoDB, ZK, streaming media, CDN, P2P, K8S, Docker, TCP/IP, coroutine, DPDK Wait...), you can add it yourself if you need it! ~

Guess you like

Origin blog.csdn.net/weixin_52622200/article/details/112986137