preface
At the end of the year, most people (programmers) are preparing for next year’s golden three silver four, but there are some people, at the end of the year, but also sprint, today share is such a friend’s interview experience
Xiao Liu, who has been developing for three years, started outsourcing work in a big factory. Later, with his big factory background, he moved to a fairly good company with a good salary. But for him, he was still a little reluctant and wanted to enter a big factory. After all, being a big company means better pay, better connections and an enviable working environment and benefits package. And most importantly, growth!
Near the end of the year, he went again, this time to Baidu, Tencent and Ali, although finally failed, but failure is the mother of success, failure is to let a person grow up quickly
Here are some of the interview questions he was asked
Baidu (Round 3 technical Aspects) :
1. The underlying implementation of Synchrnoized and ReentrantLock and the underlying principle of reentrant
Monitorenter monitorexit AQS. Reentrant principles: Entry Count, state
2. Four lock states and upgrade process
3. Similarities and differences between CMS and G1
4. When does G1 trigger Full GC
5. Besides CAS, atomic classes, SYN, Lock, what other thread-safe ways are there
final
6. Similarities and differences between HashMap and Hashtable
7. Maps that allow null keys do you know which ones
HashMap, LinkedHashMap, WeakHashMap
8. Where is the null key placed in the HashMap
Position 0 of the underlying array
9. Why is hashtable doubled +1
The initial size of the hashtable
10. Insertion time complexity of red-black trees
11. Ways to resolve hash conflicts
12. I have 1 TERabyte of data and only 1 GIGAByte of memory. How can I sort them
External sort (multiple merge)
13. Why does Tomcat override the classloader
14. TCP handshake waving process and state conversion
Mysql isolation level
16. Difference between B tree and B+ tree
17. Which design patterns do you know and how are they reflected in the JDK source code
18.Java runtime data area
19. Name a familiar garbage collection algorithm
20. What are throughput and response time first recyclers
The parallel scavenge and CMS
21. The whole process of class loading
22. Thread pool 7 parameters
23. How to solve the ABA problem of CAS
AtomicStampedReference, or an AtomicMarkableReference with a Boolean version stamp
24.Java memory model
JMM shared memory model with eight atomic operation instructions
25. What are bounded and unbounded blocking queues
26. Cookie and Session
27. Talking about reflection, does reflection affect performance
28. Let’s talk about AQS
29. Why do you say that the underlying AQS is CAS+ Volatile
State is volatile, and there are ways to setState in addition to setState and compareAndSetState
30. What are the main methods of AQS implemented by the synchronization component in the JUC package
tryAcquire, tryRelease, tryAcquireShared, tryReleaseShared, isHeldExclusively
Coding: Leetcode + offer
Tencent (round 4 technical aspects) :
What is your understanding of the JVM?
2. What is the difference between Treemap and HashMap?
3. Five states of multithreading?
MySQL > alter table select * from primary key;
5. Talk about projects you’ve been working on
6. How to implement session sharing? How do you do that with Redis?
7. Concept and solution of cache breakdown?
8. Talk about microservices and how they are managed
What is the difference between NIO and IO? What classes are commonly used?
Java synchronization lock CountDownLaunch and Cylicbarrior are used in what scenarios?
Which JVM memory structures are shared and which are thread private? What are the stacks in the Java virtual machine?
12, How to implement a thread pool?
13. Under what circumstances does Java class loading trigger?
Handwritten code: Quicksort, simple profit pattern, draw a UML class diagram for factory pattern and decorator pattern
15. Implementation principle of AOP
How to optimize slow query?
17, What are Java locks? What is the difference between reentrant and non-reentrant locks?
The difference between Lock and Synchronized? Are they all reentrant locks? Which is more efficient?
19, The general implementation of handwritten SpringMVC DispatcherServlet?
20, talk about the usual project concurrent experience
21. Redis data structure? Thread model? Redis data elimination mechanism?
Read the source code of Redis?
MySQL transaction implementation principle
Q the implementation of the underlying principle?
Database transaction ACID, transaction operation, how to lock? Distributed system locks?
26. When does an avalanche happen? How to solve it?
27. Introduce some concurrent projects
High technical content of the project, from the architecture design to deployment asked again
29. Design ideas of high concurrency architecture
Ali (round 3 technical side)
- Give a brief introduction of yourself, passing through the project without asking for too many details
- Let’s talk about the difference between overloading and overwriting
- Let’s talk about eight data types
- Do you know the INTEGER buffering mechanism? Say it
- Database transaction isolation level
- How does MyBatis prevent SQL injection?
- What is the main class of a Java program? What is the difference between the main class of an application and a applet?
- What are the differences between a Java application and a small program?
- What is the difference between String StringBuffer and StringBuilder? Why is String immutable?
- Talk about the difference between an interface and an abstract class
- Introduce the project
- What is Spring?
- Explain IoC in Spring
- How many ways can Spring be configured? To be specific
- Explain the life cycle of Spring beans
- Talk about the flow of Spring MVC
- What data elimination strategies does Redis have?
- Why does Redis need to put all data in memory?
- What scenarios are suitable for Redis?
- MyBatis paging
- Algorithms used in the project (sorting search), design patterns
- Difference between InnoDB and MyISam
- If you were to implement AN MQ, how would messages not be lost?
- Present the project (including details) and ask questions about details
- What experience do you have in database optimization?
- The entire flow from an HTTP request to a response
- Ask how to intercept HTTP requests after they are sent, how to configure interception, specific how to intercept (only know tomcat interception, in web.xml configuration, feel is asking tomcat bottom layer)
- What are the common indexes?
- How does an index work in a MySQL database?
- Explain the replication principle and process of MySQL
- Describe your understanding of the Dubbo framework
- Memory model and partition, need to be detailed to what is in each partition?
- How many partitions are there in the JVM memory, and what does each partition do?
- Such as and determine whether an object is alive?
- What are the methods of garbage collection in Java?
- Talk about the Java class loading process
- What is a class loader, and what are class loaders?
Although he has been making progress, there is still a big gap to enter Dachang. At least, it is impossible to enter Dachang by the end of the year. Soon after, he contacted me and said that he entered netease.
Let’s take a look at netease’s interview questions.
Netease: 3 rounds of technical side +HR side
Java basis:
- What is the process of defining Integer x=20 Integer y=200 in memory?
- What is the difference between HashMap and concurrentHashMap?
- When does a HashMap have a circular list?
- What lock does concurrentHashMap use when writing?
- What is the underlying safety of RenteenLock?
- Describe the JVM memory model and describe the role of each partition.
- How heap memory works
- Describe how multithreading works
- The difference between start and run
- The thread pool
- Volite keyword principle, AtomicInteger underlying implementation
- ThreadLocal keyword
Open source frameworks:
- Which open source frameworks have you worked with? Tell me the ones you are most familiar with.
- Describe spring’s IOC and AOP.
- Common injection methods
- The life cycle of Spring beans
- Implementation principle of AOP
- The implementation principle of Spring Task
- The Spring transaction
- Relationship between Spring and Spring MVC
- How does SpringMVC process the entire request?
Database:
- Mysql index implementation
- B + tree
- Select * from (a,b,c); select * from (a,b,c); and b=? and c=? Can you use this composite index? Why is that?
- Say SQL tuning experience
Redis:
- Redis data structure
- Redis elimination strategy
- Redis single-node and multi-node
- Redis data storage
Network:
- What was added to HTTP 1.1? What kinds of requests are there?
- Describe the HTTP three-way handshake and four-way wave? Why do you need four waves?
- Why does the TIME_WAIT state need to pass two maximum packet segments before it reaches the close state?
- What process does the browser go through between making a request and receiving a response?
Nginx:
- Nginx module, which you are most familiar with
- How do you configure proxy_cache? Where does the cache exist? How exactly does it hit the cache?
Linux:
- How do I view threads in a process?
- How to batch replace a character in all files in a folder? (sed command)
- Have you used the JPS, jmap, jstack, jstat command?
conclusion
But the process of learning is the process of strengthening yourself. When you are strong enough, does it matter whether it is sooner or later?
The development of the Internet is very fast, in order not to be eliminated, only to continue to learn, many people say that development is actually CRUD, but think like this, where does the progress come from? Why get a high salary?
A lot of truth, most people understand, just don’t think about it