Cause:

Because I am a person who likes to summarize whatever I do. So for last week to taobao interview experience, now back to the interview summary, I want to talk to all programmers.

I have been working in a foreign company for nearly five years, and my salary is fairly good. For family reasons, I resigned and returned to Hangzhou a few weeks ago. After my friends heard that I resigned and came back, many colleagues and friends who are close to me also recommended many enterprises to me. For example: Ant Financial; Pay treasure. Mushroom street; Ali cloud; Taobao; Dig money and so on ~~~~ these several companies I went to the interview, the situation is still good, basic can chat, not what accident, should be able to lead. Faced with so many big factories, so I first to sum up my experience in the interview Taobao.

After the interview

Interview at the company feel good today, the reception is a beautiful little sister, brought me to the meeting room, then to a no, I’m handsome ` ha ha ha, “narcissistic at no cost to maintain state of mind,” the interviewer came in, I see, secretly pleased, didn’t I handsome, the next opening very direct, direct, to get down to business (I usually just summarize the important stuff, I’ll go over the rest, you can imagine.)

Taobao side:

1. Briefly describe your current job description

2. Are there any projects that you are in charge of or familiar with? Please give details, including the design of technology

3. Based on the framework used in the project, I would like to introduce the specific implementation of the internal framework of the company (I mainly focus on THE CSF and AICACHE of ASIainFO).

4. How is CSF achieved?

5. CSF is the internal distributed communication framework of ASIaincia, which manages service registration and discovery through ZK. Then, if zK cluster is under too much pressure, how to dynamically expand and manage it? For example, for a company with such a system as Ali, how can it be designed for service registration and discovery to bear the load? High concurrency, that is, the host cluster does not go down, but the load is very high. How can it be extended and optimized?

6. At present, I am a service provider. After PUBLISHING the service, I register with ZK. At this time, when calling the service, the service caller will first ask ZK which providers of the service I want to call.

7. When a service is invoked, the host providing the service is suddenly unavailable, for example, due to network jitter, what is the process?

8. What is the process if the unavailable host recovers its ability to provide services in a short time?

9. Does the CSF service itself have a routing rule design? How to design the call sequence of dual-room, mutual Dr, even remote multi-room mutual Dr, switch to the same cabinet, the same room, the same city? How are CSF services prioritized? In other words, is there any grouping of services, such as A scenario where 50 percent of users use service provider A and 50 percent use service provider B based on user ID? Is there A strategy for this scenario? If so, how?

10. After service registration and discovery, it is the serialization of objects. For serialization, what are the specific serialization methods in Java? What are the pros and cons of each other? How do you serialize in CSF?

11. Since there are third-party serialization methods, there should be some obvious or fatal flaws in the serialization methods provided by Java. Can you tell me what they are?

12. If you were asked to design CSF framework and you were in charge of serialization, how would you design high availability, or choose which data should be compressed and which data should not be compressed? After compression, there will definitely be some negative effects. For example, native BMP images, I can compress into JPG images, so we know that JGP images are actually lossy compression, although the naked eye is not distinguishable, so how does this compression do? And some of them are lossless compression. Do you think protobuf is lossy or lossless? What is the serialization method between heterogeneous systems? Can Java’s native serialization mechanism be used to realize serialization transfer?

13 serialized transmission, is the underlying network transmission, that NIO package also came out for a long time, can explain what NIO is mainly to do, why to design NIO? And the main classes and interfaces in NIO? What are the functions of these classes and interfaces? Can you describe them in detail? Nio is designed to be event-driven. Which class in NIO is responsible for event-driven niO?

14. Can you tell me the difference between NIO and AIO? Have you heard about AIO? What are the main classes and interfaces of AIO? Can you explain them?

15. Are you aware of the major updates to java8, java9, and even java10? (the interviewer is more likely to ask about java9 and java10), are you aware of any significant feature updates to java8, at least at the package level? (I answered that knowing that ConcurrentHashMap put causes the same hash bucket to have more than 8 elements converts the list to a red-black tree.)

16. Can you tell me more about red black trees? Red black tree implementation? How exactly do red-black trees improve performance? How do red-black trees adjust dynamically?

17. Have you had any contact with Lamda expressions for list streaming (streaming)?

18. What do you know about Garbage First (G1)?

19. Have you read about other garbage collectors?

20. JVM application startup parameter optimization, do you understand? Have you ever operated like this in your project? For example, when you publish an application, do you try to adjust the space ratio between the young and old generations and adjust the garbage collector for performance tuning purposes by monitoring the young and old GC data anomalies?

21. Do you know anything about classloaders? When is it necessary to break the parental delegation model? What is the way of breaking it? Can you describe it? For example, you now have a Web application, and the WAR contains modules A and B. Module A depends on version 1.0 of a JAR, and module B depends on version 2.0 of a JAR. The 1.0 and 2.0 versions of the JAR are incompatible because modules A and B are in a WAR. This means that the jar 1.0 and 2.0 are all inside the application. Tomcat only loads the same jar class once when it is started. Now the situation is that either module A and module B will not work, if you are the owner of this application, what will you do? Module code itself is difficult to change, or more complex, module A can not upgrade jar package, module B can not degrade jar package.

22. Have you heard of OSJI? Do you know what osGi’s main features are? What is the approximate principle of its implementation?

23. Can you tell me which technologies or open source frameworks you have a deep understanding of?

24. Election algorithm, can you describe it in detail? How do you avoid a cycle of voting? For example, if you have three hosts 1,2,3,1 elects itself and sends an election message to 23,2 and 3 disagree, then host 2 elects itself and sends an election message to 1 and 3,1 and 3 disagree, and host 3 does the same thing, how can you avoid that? You can either vote for yourself or you can vote for others. We’re all in the same boat. What can we do?

25. Can you describe the specific implementation of paXOS algorithm? Who are the characters in this algorithm?

26. Can you describe the Raft algorithm, which characters it has and what the overall selection process is like? How exactly are they elected? For example, there are still three hosts, 1,2, and 3, which send out election messages respectively, asking to vote themselves. What if the process freezes? Paxos is handled differently than Raft, how is raft handled?

27. How does Redis solve hot issues? How is dedis cluster implemented? Can you describe it to me? Is every Redis slave full of data, and if so, is the data too redundant? If so, does the application randomly pick a Redis machine when accessing the cache? How do you make sure you don’t randomly pick the same machine? Are you familiar with the concept of Redis data slicing?

28.~~~ etc.

How much can you answer, and how much can you not answer? Is not the heart at the moment has MMP. But you don’t have to worry, I at this time I also meng, in the mind to scold niang. But the state of mind can not panic ~~~~ (in the mind thinking, steady, he did not have my handsome ~~~~ ha ha ha)

The interview summary

I do not know if you have seen the end of the discovery, a Taobao, to understand a lot of knowledge, that if Alibaba, Alipay, such as a big factory? Do you feel that you still have to learn a lot ~

After this interview, I would like to summarize the following points:

1. Basic grammar

This includes the use of static, final, transient, foreach loops, and so on. If you answer static modifiers, modifiers, I will think you qualified, if you answer static blocks, I will think you are good, if you answer static inner classes, I will think you are good, I will be very satisfied with you, because I can see that you are very keen on research technology.

2, collections,

It’s very important and it’s a must-ask. List, Map, Set, etc. ArrayList, LinkedList, Hashtable, HashMap, ConcurrentHashMap, HashSet, etc. ConcurrentHashMap is one of the most frequently asked questions in interviews, probably because it can generate so many questions. For ConcurrentHashMap, I would like to offer three answers or research directions:

(1) Lock segmentation technique of ConcurrentHashMap (2) Whether the read of ConcurrentHashMap should be locked, why (3) Is the iterator of ConcurrentHashMap strongly consistent or weakly consistent

3. Design patterns

Design patterns are still very important and useful in work. It is only necessary to focus on about ten of the 23 design patterns. Questions about design patterns in the interview mainly include three aspects:

(1) which design patterns are used in your project and how to use them (2) know the pros and cons of common design patterns and (3) can draw UML diagrams of common design patterns

4, multithreading this is also a must ask. Ask more in-depth questions such as the difference between Thread and Runnable, what happens when a Thread is started multiple times, and what states a Thread has. Of course, this is just the most basic. Unexpectedly, several interviews were almost simultaneously asked the same question in different ways, which summed up the following meaning: If Thread1, Thread2, Thread3, and Thread4 count the size of C, D, E, and F respectively, and all the threads are handed over to Thread5 for summary, how should this be implemented? Do the smart Internet have an answer to this question? Not hard, there are already classes available under java.util.Concurrent. In addition, thread pool is also a relatively common question, how many common thread pool? What are the differences and connections between these thread pools? How does thread pooling work? To be realistic, you will be given some scenarios to answer which thread pools are appropriate for this scenario. Finally, although this interview does not ask many questions, but multi-threaded synchronization, locking is also important. The difference between synchronized and ReentrantLock, the common method and static method of synchronized lock, the principle and troubleshooting method of deadlock and so on

5, IO IO is divided into File IO and Socket IO, File IO is basically not asked, ask also ask what, usually will use good, in addition to remember File IO is blocking IO. Socket IO is an important part, to understand the difference between blocking/non-blocking, synchronous/asynchronous, to understand the blocking IO, non-blocking IO, multiplexing IO, asynchronous IO these four IO models, how Socket IO and these four models associated. It was a little bit basic, but if I went deeper, I would ask about the principle of NIO, which IO model NIO belongs to, and the three components of NIO, etc. It was a bit difficult, and I also studied for a long time before I could understand NIO. NIO, by the way, is not strictly a non-blocking IO but rather a multiplexing IO, and that’s a detail to keep in mind when you’re answering an interview, saying that NIO blocks in the Selector select method will make the interviewer think better of you. If you’ve ever used Netty, you might want to ask about Netty. After all, it’s one of the best NIO frameworks out there (Mina is actually good, but not as good as Netty in general), and most Internet companies use Netty.

6, JDK source code to get a high salary, JDK source code must read. The above content may also be linked to specific scenarios, JDK source code is to see you usually love to study. JDK source code in fact, there is no good summary, purely personal, summary of the more important source code:

(1) List, Map, Set implementation class source code (2) ReentrantLock, AQS source code (3) AtomicInteger implementation principle, The CAS mechanism and AtomicInteger is how to use CAS mechanism (4) the implementation principle of the thread pool (5) Object class methods and the role of each method

Frame a platitude, something you must ask in an interview. In general, I will ask you about the framework you are using in your project, and then I will give you some scenarios to ask you how to use the framework, such as how I want to do something when Spring initializes the bean, how I want to do something when the bean is destroyed, the difference between $and # in MyBatis, etc. All these are practical. Usually accumulated well, how much learning framework use details naturally are not a problem. If you answered the above questions well, the interviewer will often ask in depth how the framework works. One of the most frequently asked questions is the implementation principle of Spring AOP. Of course, this is very easy to do in two sentences, even if you don’t have to prepare for it.

8, the database database will also be asked nine times out of ten. Some basic differences such as union and Union all, left join, several indexes and their differences are not discussed, more important is the database performance optimization, if you know nothing about database performance optimization, then have time, It is also recommended that you spend a day or two prior to the interview preparing specifically for SQL basics and SQL optimization.

However, the database is not to worry about, a company often has many departments, if you are not familiar with the database and the basic technology is very good, nine chengdu will ask you, it is estimated that you will be put into the database use is not very high requirements of the department exercise.

Data structure and algorithmic analysis Data structure and algorithmic analysis, for a programmer, is better than never and definitely comes in handy in the workplace. Array, linked list is the basis, stack and queue in-depth but also not difficult, tree is very important, more important tree AVL tree, red black tree, can not understand their specific implementation, but to know what is a binary search tree, what is a balanced tree, AVL tree and red black tree difference. ** The Java Virtual Machine should be an important part of the content, talk about the Java virtual machine is important

The Java memory model happens-before rules volatile keyword usage rules may not be useful in the interview, but it is a must on the road to success.

Java is mainly oriented towards the Web, so some questions about the Web are also required.

How to implement distributed Session? In addition to the difference and connection between Session and Cookie and the realization principle of Session, the content in Web. XML is the key, Filter, Servlet, Listener, If not how they are implemented, then at least how they are used. In addition, some details such as get/ POST differences, forward/ redirect differences, and HTTPS implementation principles may also be examined.

Finally, if you are interested and have time, I suggest you learn and study SOA and RPC, service-oriented systems, large-scale distributed architecture is a must, saving a life, cure-all, and successful every time.

About the HR Interview

If you’ve successfully crossed all the technicalities, congratulations, you’re one step closer to getting that raise, becoming the CEO, marrying a rich woman, and reaching the top of your life. But before it’s time to negotiate salary, there’s one final test: the HR interview. Basic all big companies have this round of interviews, do not look down on HR interview, many companies of HR for the interviewer have veto —- even if the interview in front of your evaluation again high. Therefore, this round of interviews must also pay attention to, the HR interview mainly asks the following points:

  1. Include reasons for leaving your previous employment in your resume
  2. Current company salary
  3. What kind of company do you expect to work for
  4. Personal direction in the future

If you want to learn the following routes, I would like to recommend an architecture learning exchange group. Exchange learning group number: 478030634 inside will share some senior architects recorded video video: Spring, MyBatis, Netty source code analysis, high concurrency, high performance, distributed, microservice architecture principle, JVM performance optimization, distributed architecture and so on these become architects necessary knowledge system. I can also get free learning resources, which I benefit a lot from now

We strongly recommend you to learn the advanced route

One, source code analysis

Distributed architecture

Third, micro services

Fourth, performance optimization

Five, Java engineering

Conclusion:

Well, my summary is here, if you also want to interview BAT, suggest you learn the basis, secretly tell you, they are very like to ask the basic knowledge of the oh…… Now think of that interviewer, really feel he did not have my handsome ~~~~ ha ha ha.

You can follow my public account: “Java rotten pigskin”, usually I will also write technical articles, such as: architecture, distributed, micro service Spring, JVM, MySQL and other knowledge points. The interview experience will also be shared. Thank you for your attention and support ~~~~

Note: everybody reprint please indicate the original source, the original connection: segmentfault.com/a/119000001…