In the season of gold, nine, silver and ten job-hopping

On the "Golden Nine Silver Ten", young graduates are full of hope and anxiety, looking for and competing for a job opportunity. The development students who are already on the job also want to get better treatment and a bigger platform through social recruitment or internal promotion.

However, there are a large number of interviewers, and the technical market is relatively cold. The students who are interviewed have to face the huge competition of N candidates for 1 position.

Q: Under this situation, how can we get more and better offers?

A: Short-term preparation - brushing interview questions; long-term planning - consolidating core skills.

How to brush the interview questions? Brush high-frequency questions, deep questions, and time-sensitive questions.

How to consolidate core skills? First in-depth understanding of the principle, and then systematically apply it to practice.

Several major manufacturers in the past few months have all received offers and eventually went to ByteDance. Overall feeling:

  1. Every big factory asks about the project very carefully. Although the following interviews are all summarized in one sentence, in the actual interview process, the project part accounts for a large part of the entire interview process. On the contrary, purely technical questions The proportions are relatively small.
  2. The interview questions are almost similar, relatively simple, and very common. (There is a reference analysis at the end of the article)

Meituan

Usually there are two rounds of technical interviews and one HR interview. There will be an algorithm question on the first side, and sometimes there will be three rounds of technical interviews.

one side

  • An algorithm question, about ten minutes, is required to run normally and pass the given test case.
  • What are the most challenging projects you have done recently?
  • Discuss the design of the system in detail with the project, and ask questions based on your design.
  • How do you ensure data consistency in your project?
  • When the code executes the SQL statement, the database connection has a timeout exception, but you do not know whether the SQL statement has been successfully executed in the database. How to ensure the consistency of the data in this case?
  • How is the distributed lock implemented in your system? (The answer was implemented by redis, set(key,value,nx,ex,expire))
  • What are the problems with using redis to implement distributed locks above?
  • In addition to using redis to implement distributed locks, what other usage scenarios are there in the project?
  • Data persistence mechanism of redis? How to ensure data is not lost? When the redis memory is full, what is the memory elimination strategy?
  • How does AQS implement locks? Difference from synchronize
  • Differences between MySQL storage engines? What isolation levels does the database have?
  • What is the data structure of a MySQL index? Why choose this data structure?
  • What is the difference between B+Tree and B-Tree?
  • What are the Reactor threading models? How does Netty support these three threading models?
  • How does a multiplexer work?
  • How does epoll work? The difference between epoll, poll, and select
  • How does the JVM perform garbage collection? What are the tagging algorithms? What are the garbage collection algorithms?
  • How does the CMS garbage collector work?

two sides

  • Most challenging project you've done recently?
  • Double write consistency problem with redis and MySQL? How do you do it? Why did you do this? What are the problems with other approaches?
  • The realization principle of distributed lock
  • What isolation levels does the database have? What problems do these isolation levels solve?
  • How does MySQL solve the non-repeatable read problem?
  • The realization principle of MVCC
  • Is there a phantom read under the repeatable read isolation level of MySQL? Why?
  • Is the database index created as many as possible? Why? How many are usually created?
  • In a table, three fields a, b and c are indexed respectively. Now there is an SQL statement: select field1,field2 … from t where a = xx and b=xx and c=xx. Will this SQL statement use index? If so, which index will be used? (Answer: Only one of the indexes will be used, it may be a, it may be b, it may be c, and which index to use is related to the data in the table)
  • Why not use a,b,c three indexes at the same time? What is a return form?
  • Difference between clustered index and non-clustered index
  • How do I know which indexes are used by an SQL statement? (Answer: Use explain to view)
  • What are the columns of the explain result? What does each mean?
  • How to view slow SQL?
  • When executing multiple SQL statements in a Spring transaction, does it correspond to multiple database connections or one database connection? (Answer: One connection, multiple transactions cannot be guaranteed)
  • Since it is a connection, how does Spring ensure that the current thread obtains the same connection when executing multiple SQLs before and after? (Answer: I didn't expect ThreadLocal at the time. The interviewer guided me, how would it be implemented if it were you. Later, I replied that there is a map, the key is the current thread, and the value is the database connection. In the end, I had an idea and thought of ThreadLocal)
  • How does ThreadLocal work?
  • What problems should I pay attention to when using ThreadLocal? (actually asking about ThreadLocal memory leaks)
  • The principle of Redis master-slave replication
  • Which ones have MQ used? How to choose a model?
  • What RPC framework are you using? Why choose it?
  • Online service traffic has skyrocketed, how to operate, and tell me the detailed process? Adding a new service node may also cause the machine to be blown up before the service is up. What should I do at this time?
  • A scenario question: There are now 10 million businesses, and we know their geographic locations. When we enter the homepage of the APP, how to load nearby businesses?
  • career planning? Why did you choose to jump ship before the end of the year?

byte

Three rounds of technical interviews and one HR interview, each round of technical interviews will have at least one algorithm question.

one side

  • an algorithm problem
  • Talking about the project, how is your ad retrieval engine designed? Why don't you use a search component like ElasticSearch for your ad retrieval?
  • What are locks in Java? Difference from Lock
  • The underlying implementation principle of synchronized?
  • How does AQS work?
  • The role and implementation principle of volatile?
  • JVM's garbage collection algorithm
  • What are GC Roots?
  • Briefly describe the difference between the new generation and the old generation?
  • class loading process? What is the parental delegation mechanism?
  • How does the thread pool work? When the thread pool is full, what will happen when the task is submitted again?
  • How does redis implement distributed locks? What's wrong with distributed locks in redis? Are you familiar with lua scripting?
  • What is the expiration policy for keys in redis?
  • Persistence mechanism of redis? What is the difference between AOF and RDB?
  • What is cache breakdown, cache penetration, and cache avalanche? How to deal with it?
  • How is the MySQL database index implemented?
  • What is a return form? What is a federated index? What is the leftmost prefix matching principle?
  • How does MySQL ensure high availability? Master-slave replication principle?
  • Use of the Explain keyword.
  • The implementation principle of RocketMQ.
  • The selection of the registration center?
  • How does Zookeeper work as a registry?
  • How does Zookeeper implement distributed locks?

two sides

  • an algorithm problem
  • Talk about project experience in detail
  • How to solve redis cache and database data consistency?
  • In a distributed system, how to solve distributed transactions? (Answer: RocketMQ transaction messages)
  • How does RocketMQ transaction message work? How to ensure data consistency through RocketMQ in your project
  • Why does MySQL use B+ tree for indexing, and what are its advantages and disadvantages compared to B tree?
  • What is a covering index?
  • Isolation level of transactions in MySQL?
  • SQL optimization experience?
  • The mechanism of redis persistence? How to ensure data is not lost?
  • Redis memory elimination strategy? Key expiration policy?
  • How does RocketMQ ensure reliable data transmission (no data loss)?
  • There are a lot of messages accumulated in RocketMQ, what should I do?
  • Netty's threading model? Under the master-slave multithreading model, how are threads divided?
  • What is the implementation principle of thread pool? How to set the parameters of the thread pool?
  • For CPU-intensive systems, why is the number of threads set to the number of CPU cores + 1? Why +1?
  • For an IO-intensive system, why is the number of threads 2 times the number of CPU cores? Why 2x instead of 3x, 4x, etc.?
  • RPC framework selection?
  • How does Motan achieve load balancing?
  • The next work plan? Why?

Three sides

  • an algorithm problem
  • Do you understand this data structure? How to tell if there is a cycle in a graph?
  • How can I find all the environments in the graph?
  • What is the difference between Http and Https?
  • TCP three-way handshake and four waves?
  • How does TCP guarantee reliable transmission?
  • What is the difference between BIO, NIO, and AIO?
  • What do you know about encryption algorithms? What is symmetric encryption? What is asymmetric encryption?
  • How to ensure the security of the interface? What encryption strategy should be used?
  • Talk about hash consensus algorithm?
  • The data structure and principle of MySQL index?
  • MySQL tuning experience
  • Technology selection for microservices? Why choose Motan?
  • Principle of RPC call

Tencent

Usually there are three rounds of technical interviews, one HR interview, and one algorithm question in the first round of interviews. Sometimes it may be four rounds of technical interviews.

one side

On the one hand, it is mainly to ask Java basics, regular questions, and see the answers for comparison.

  • Is pass-by-value or pass-by-reference used in Java?
  • How are the parameters passed when the method is called?
  • What are the data areas in the JVM?
  • What are the List collections? Differences and usage scenarios between ArrayList and LinkedList? Why?
  • How does HashMap work? Difference between 1.7 and 1.8?
  • Hash algorithm in HashMap? What are the benefits of such a hash algorithm (both high and low 16 bits are involved in the operation)? How to address?
  • What are the problems with using HashMap? (What is the difference between 1.7 and 1.8) How to solve it?
  • What are thread-safe Maps in Java?
  • How does ConcurrentHashMap work? Difference between 1.7 and 1.8?
  • How does ConcurrentHashMap count the number of elements? What will be the problem?
  • What is the JMM memory model?
  • The realization principle of synchronized
  • How does the thread pool work? What are the parameters and what do they mean?
  • Garbage collection algorithm.
  • Fundamentals of reflection in Java? How is reflection used in actual projects?
  • Which design patterns are familiar with? Where is it actually used in the project?
  • an algorithm problem

two sides

We mainly talk about projects, and technical problems are brought out when we talk about projects.

  • Most fulfilling project you've done recently? What problems have you encountered with this project?
  • How to ensure data consistency in your distributed system? (Answer: The transaction messages of RocketMQ are used to ensure final consistency, and most of the time later, I will talk about the implementation principle of RocketMQ)
  • When the client requests, how does the backend prevent repeated requests and ensure idempotency?
  • How to implement distributed lock?
  • What is the problem with redis implementing distributed locks?
  • redis distributed lock with lua script?
  • Redission understand? Tell me how it works?
  • Why use RocketMQ in your project? For MQ, how did you choose the model?
  • How does RocketMQ work? How are messages stored?
  • MQ lost messages appear online? Where might the problem be? How to ensure that MQ messages are not lost?
  • How to ensure the high availability of RocketMQ?
  • How does RocketMQ's transaction message work?
  • How to ensure the order of messages?
  • How to ensure that messages are not repeatedly consumed?
  • Your project involves transfer-related business, so how to ensure the accuracy and security of funds?
  • Design a reconciliation system for your project.
  • How to ensure strong consistency in distributed systems?

Three sides

It is almost the same as the second side, most of the time we talk about the project, the questions are similar, and the repeated interview questions will not be repeated.

  • Talk about project experience
  • What problems have you encountered while using redis? How to solve the hot key problem?
  • What kind of schema do your redis use? What is the difference between cluster mode and sentinel mode? How do cluster mode and sentinel mode ensure high availability of redis cluster? Failover process for redis cluster?
  • The principle of raft protocol?
  • JVM tuning experience?
  • What is a three-color marker?
  • Double-write consistency between database and cache?
  • How to design sub-libraries and sub-tables in combination with projects
  • MySQL master-slave replication principle?
  • How does ConcurrentHashMap work?
  • How is the Node node in CucurrentHashMap designed? Why use final and volatile to modify the properties of Node nodes? what's the effect?
  • What are your plans for your personal career?

four sides

  • Project experience
  • How is an object stored in the JVM?
  • The class loading process, and the process of method execution?
  • JVM's garbage collection mechanism? Why distinguish between the new generation and the old generation?
  • There is a problem with the online GC, how to troubleshoot?
  • What are the usage scenarios of Spring's AOP? What are the benefits of the AOP mechanism?
  • Distributed transaction problem, CAP theory? 2PC, XA, TCC, MQ and other principles
  • Similar to Taobao, how do you think they achieve strong data consistency?
  • How does the redis cluster achieve capacity expansion?
  • The process of rehash of redis?
  • What are Netty's threading models?
  • What are the loaves and half packets of TCP? How does Netty solve it?
  • The principle of epoll?
  • TCP's three-way handshake and four-way wave? Why 3 and 4?
  • How is your ad search engine designed? How much traffic is there currently? If it supports a larger amount of advertising
  • Why did you leave your last company?

Ali

Three rounds of technical interviews, one HR interview, the first round is usually a phone interview, the second round is a video, and there may be an algorithm question.

one side

On the one hand, it is basically the basic problem of Java, which is relatively simple.

  • How does Java determine whether an object can be recycled? What are the garbage collection algorithms?
  • What is the memory model?
  • What is thread safety?
  • What are locks in Java? What is the difference between synchronize and Lock?
  • The underlying implementation principle of synchronize
  • The layout of objects in memory?
  • How does the volatile keyword work?
  • What is atomicity, visibility, order? What is the happen-before principle? Explain the semantics of final?
  • What is CAS? What's wrong with CAS?
  • The realization principle of Lock series locks?
  • What is an atomic class? How does atomic class work?
  • What are the types of references to objects in Java?
  • How does ThreadLocal work? What's the problem? How to avoid it?
  • How does HashMap work? Difference between 1.7 and 1.8?
  • What are the thread-safe Maps? The implementation principle of ConcurrentHashMap? Difference between 1.7 and 1.8?
  • How does ConcurrentHashMap count size?
  • Why is MySQL's index B+Tree instead of data structures such as arrays and Hash? Why not B-Tree?
  • What data types does Redis have? What should I do if there is a lot of data in the List?
  • Persistence mechanism of Redis? Advantages and disadvantages of AOF and RDB?
  • The online service interface is very slow? How to troubleshoot?

Two and three sides

The second and third sides were on the same day. I can't remember exactly. It's probably these questions that the interviewer prefers to ask.

  • an algorithm problem.
  • Talk about project experience, very detailed.
  • What are the garbage marking algorithms and garbage collection algorithms?
  • What is a three-color marker? What are Safe Points and Safe Areas?
  • Briefly describe the principle of the G1 garbage collector?
  • Why is the G1 garbage collector not used in your project?
  • When will Minor GC be triggered? When does the Old GC start? What is Full GC?
  • When does the object enter the old age? What is dynamic age determination?
  • How big is the QPS of your online service? What is the machine configuration? How are the parameters of the JVM set? Frequency of GC? Why do you want to configure it this way?
  • Suppose the traffic of the online service is 10,000 times the current traffic? What will happen to the system? How to optimize?
  • How to ensure the high availability of Redis? How many machines are there online? How was it deployed?
  • How does Redis implement distributed locks? What's the problem?
  • How to implement distributed locks with Zookeeper? What's the problem?
  • What is the problem with hot keys in Redis? How to find hot keys? How to solve the problem of hot keys?
  • What is your experience in optimizing SQL? Index design guidelines?
  • How to view the slow query log of SQL? What should I do if the online service has a slow query?
  • What should I do if there is a deadlock in the online database?
  • How does MySQL's InnoDB solve the non-repeatable read problem and phantom read problem under the repeatable read isolation level? What is a snapshot read? What is the current reading?
  • What locks are there in MySQL? What is a gap lock?
  • What logs are in MySQL?
  • What are the characteristics of the database? How does MySQL ensure that data is not lost after the machine is down and restarted?
  • What does binlog do? What's wrong with formatting it as statement? How do you configure it online?
  • How to ensure the high availability of MySQL? The principle of master-slave replication?
  • Now in the online environment, it is found that the total nodes of MySQL lag behind the master nodes by a large margin. What could be the reason? How to deal with it?
  • Selection of message queues? How does RocketMQ work?
  • How to ensure that messages are not lost? How to ensure that messages are not repeatedly consumed?
  • There is a large backlog of messages on the online MQ, what should I do?
  • Let you design an MQ, how would you design it?
  • What is mmap?
  • Have you used netty? Why is netty a high performance networking framework?
  • How does the zero-copy mechanism work?
  • How is the Zookeeper cluster deployed? How does Zookeeper implement elections? What is the ZAB protocol?
  • How does Zookeeper ensure sequential consistency of data?
  • What is the usage scenario of Zookeeper? How to support a large number of read requests?
  • How do you choose the type of registry for your microservices? The difference between Zookeeper and Eureka as a registry? What are their bottlenecks?
  • How to design a registry that can support a cluster of hundreds of thousands of machines?
  • How to design a spike system? On the day of Double Eleven, enter www.taobao.com from the browser to load the page, and tell me its complete process.

Analysis by reference

The answers to all of the above questions have corresponding parsing document references, and there are also some similar articles summarizing interview questions on the Internet, but the editor’s one is definitely one of the best, leaving you the time to go online to find them one by one! Each knowledge point has a left navigation bookmark page, which is very convenient to read. Due to the large amount of content, here are some screenshots. Readers who need it, see the end of the article

Java Basics

Java Collections Framework

jvm

Multithreading

network

Algorithms and Data Structures

Spring

Netty

Microservices/Distributed

message queue

Distributed ID, others (gateway, current limiting...)

MySQL

Redis

Experience summary

**These are some knowledge points I have learned and summarized in my work and interviews.** These are some typical questions that are often asked in interviews. If you don't usually pay attention to summarizing, then when you are asked in the interview, you may be confused. **Even if you know how this question is going, but you don't usually summarize carefully,** you may also Logical confusion occurs and jobs are missed.

Some knowledge points will be forgotten if they are not used often, but they will still be asked in interviews. I am also deeply affected by this, so I decided to sort out these encountered problems, share them, and help more people. Let’s work together progress. ** The so-called "review the old and learn the new", when you have nothing to do, look at this knowledge more, and maybe there will be new gains.

おすすめ

転載: blog.csdn.net/shy111111111/article/details/127322743