In May, my friends shared with me the experience of interviewing Bytedance and Tencent, so I took time to organize it into a blog post to share with you.

1. Bytedance

There are three technical interviews, followed by the HR interview, and the interview format is video. The time is controlled in 1 hour.

1.1 Side 1:

The first part mainly investigates the foundation. Firstly, I introduce myself and the project briefly, and then I begin to investigate the foundation.

1.1.1 BASIC knowledge of TCP

  1. Question 1: please describe in detail the three-way handshake and four-way wave

    Be familiar with the mechanics of the three-way handshake and four-way wave, and draw a state diagram.

  2. Question 2: What is the purpose of the TIME_WAIT state in the four waves?

    This question is to draw four wave states, will be extended to ask you. There may be questions about why four waves are four, not two. It is best to master all the relevant issues.

  3. Question 3. What mechanism does TCP use to ensure reliability?

    Answer from four aspects: ACK confirmation mechanism, timeout retransmission, sliding window and flow control. If you go further, you need to talk about the flow control mechanism in detail.

1.1.2 Basic knowledge of the language

Bytedance’s technology stack is Go and Python, which will ask about the foundation of related languages.

  1. Question 1: Describe the difference between threads, processes, and coroutines? Describes the definitions and differences between threads, processes, and coroutines, as well as their use in the Python language.

  2. Question 2: What is the difference between coroutines in GO and those in Python? Mainly explain the GMP mechanism in Go.

1.1.3 Network programming related basics

  1. Question 1: What are network IO models?

    Five network I/O models, blocking, non-blocking, I/O multiplexing, signal-driven IO, and asynchronous I/O. From data to I/O devices to kernel-mode, kernel-mode to process-user mode describe the five differences respectively.

  2. Question 2: What is the difference between SELECT /poll/epoll in I/O multiplexing?

    The epoll mechanism and how epoll solves the three disadvantages of SELECT. We’ll also talk about the difference between horizontal and edge triggers in epoll.

1.1.4 HTTP basics

  1. Question 1: What happens when a client accesses a URL to a server?

    From the layer 7 network model, the whole process of HTTP->TCP->IP-> link explains the process of packet generation and transmission

  2. Question 2: Describe the difference between HTTPS and HTTP

    From the port difference, as well as HTTPS is based on SSL and encryption and other aspects of the explanation

  3. Problem 3: Format of HTTP request and response packets

    Be clear about the components of the request message and response message, and write specific cases.

  4. Q4: What are the HTTP status codes?

    Give examples of common codes from 2xx,3xx,4xx and 5XX. The interviewer will ask the difference between 301 and 302, and which scenarios are 500/503/504.

1.1.5 Cache and database basics

  1. Question 1: Describe what data structures Redis has.

    Based the data structure of five kinds of String/List/Hash/Set/Zset, also a senior HyperLogLog/BitMap data structure/BloomFilter/GeoHash. The interviewer also asked the principle of BloomFilter and Zset implementation principle, mainly explained skip lists.

  2. Problem 2: MySQL scenario

    The interviewer presents scenarios that require you to write query SQL, examine federated statements, how to page, and optimize complex statements.

1.1.6 Bare Write Algorithm

  1. A non-recursive sequential traversal of a tree.

1.2. The second surface

1.2.1 Project Experience

The second part is related to personal project experience. The interviewer will ask you to introduce the recent project in detail first. During the introduction of the project, the interviewer will interrupt you to extend the difficulty and structure of the project and ask for better solutions.

Before project experience wrote a distributed in the project, the interviewer emphatically discusses the implementation of the project plan, lead to the question of distributed transactions and the consistency of distributed, at the same time will require additional conditions on the basis of the current project, ask you to provide solutions, this part is difficult, requires an understanding the depth of the project very well, Make sure you know the project very well before the interview, and if it’s a multi-team project, it’s best to know the features that others have written.

Also asked some API business architecture issues, load balancing, CDN, DNS and other issues. HTTP: 1.0/1.1/2.0 HTTP: 1.0/2.0 HTTP: 1.0/2.0 In detail, the difference between 1.0 and 1.1 is the connection model (short connection, long connection, pipelining), the difference between 1.1 and 2.0 is I/O multiplexing single long connection, server push, binary frame splitting, header compression, etc.

1.2.2 Bare Write Algorithm

  1. Back row matrix traversal

1.3. The third side:

1.3.1 Project experience

The third part also examines project experience, but focuses on system design. You will be asked to describe the current scheme and its shortcomings by drawing a paragraph from previous project experience (definitely different from the second part). Warm tips, make sure the project experience on the resume is very familiar, will take out a period of work experience of the project.

So be careful in your answer. It is best to assume additional conditions for the current project before the interview and propose 2-3 alternative plans.

Modularization requirements will require the current system to do microservice architecture, how to split services, what are the rules of splitting, review the knowledge related to microservice architecture, service governance (traffic limiting, degradation, circuit breaker).

For example: The previous project involved the design of the heat pool in the social scene. It was required to explain the existing scheme and shortcomings, and then give the optimization scheme. It would also expand the current magnitude by many times and require a new scheme. We talked about fan relationships, push and pull, the difference between read diffusion and write diffusion, and how the two are combined.

1.3.2 Bare Write Algorithm

  1. The most recent common ancestor of multiple nodes in a binary tree

1.4. Summarize

After the three technical aspects, we have HR, which I won’t go into. The overall interview experience of Bytedance, the interviewer is very professional and familiar with the basic knowledge, be sure to prepare before the interview. LeetCode questions should also be brushed. The handwriting algorithm does not leave much time, 3-10 minutes, if 3 minutes have not written, you are required to tell the solution idea.

Remember before the interview must brush questions and preparation, the resume is not familiar with the project do not write up, write up the project prepared 2-3 technical solutions.

2. Tencent

There are many interview procedures in Tencent, including written test, there are 8 rounds, 6 rounds of technology +1 round of HR+1 round of written test

2.1 the first side

The first is a telephone interview, which focuses on the project and asks basic questions. Time: 30 minutes.

  1. With previous experience in microservices, the interviewer asked detailed questions about the architecture of microservices, the implementation of the framework, service governance, distributed consistency and so on.
  2. Elasticsearch (ELK) is one of the most important components of Elasticsearch (ELK).
  3. Can messages in Kafka be consumed by multiple consumers? ; As well as the election mechanism and HW mechanism.
  4. Open problem, talk about a previous problem and how to solve it. This describes running problems during production and troubleshooting problems.
  5. Database and Redis related issues, databases examine the principles of indexing and the differences between several transactions. Redis asks data structure, how to implement delay queue, distributed lock principle.

2.2 The second written test

Site interview, investigate the specific position of the technical stack language basic knowledge, the topic is not difficult, requires a solid foundation and breadth.

2.3 The third and fourth sides

The third and fourth part is the interview of the team leader and the director to discuss the problem solving ideas and projects. The characteristics of the second part are to ask relevant questions based on the project experience. The breadth of requirements, especially the breadth of the framework, will expand the current magnitude of the project dozens of times, redesign the framework, and involve some pressure interviews. I feel that if I am not nervous and familiar with the project, IT is not a problem.

There will be many open questions, including the ideas of solving problems encountered in daily life, cooperation between colleagues and so on.

The knowledge points asked include load balancing algorithm, how ngniX does flow limiting, the difference between four-tier LVS and seven-tier NgniX, and the design ideas of micro-service architecture. Interview time is 20-30 minutes.

2.4 The fifth and sixth technical committee interviews

The fifth and sixth part is the interview committee, technical interview, very difficult. Examine system design and architectural design. A deep understanding of knowledge is required

  1. Mainly system design, asked how to design the seckill system, divided into access layer, interface layer, message queue layer, logical layer four aspects explained, access layer can do service governance related things, interface layer to do snap switch, blacklist and whitelist, random reject processing, logical layer specific snap logic realization. It involves redis distributed lock and the consistency between DB and REDis.

  2. The second kill system also extends several kinds of distributed transaction implementation, such as two-stage, three-stage, compensation type (TCC), message queue implementation based on reliable message service. The realization and difference of these types are discussed emphatically, and it is required to draw the architecture diagram of message queue based on reliable message service to realize distributed transaction, and how upstream and downstream services ensure message reliability and consistency.

  3. Investigate microservices architecture, the principles of service separation, RPC framework principles, raft election principles for consistency protocol of Configuration Management (ETCD).

  4. Investigate service governance, service traffic limiting algorithm, service degradation and recovery indicators, and service circuit breaker.

  5. Open questions, the most impressive problems encountered, and how to solve them.

2.5 summarize

Tencent has few algorithm questions, mainly to investigate the breadth and depth of knowledge, if there is no practice, by endorsement is difficult to muddle through. The understanding of architecture requires more depth, focusing on the investigation of principles.

For more related articles and discussions, please pay attention to the public account: “Tiancheng Technology Talk”