Last week, I accompanied my former colleagues (George, Xiao Yuan and Pengfei (the interviewer)) to interview. The first stop was Shenzhen, the second stop was Shanghai and the third stop was Hangzhou. I will not say what company I am interviewing for here, you know it is a first-line company. In fact, I really did not plan to write this article, mainly because my memory is not very good, moreover, recently many people asked about the latest interview questions in 2018, I really can not answer, and afraid to avoid repeating the answer, to save myself some energy, simply reply here.
To tell the truth, although as a person, accompanied by the interview I am can not be together in the interview, peng fly out after the interview is with his vague memories, to slowly recalls HR to ask a few questions, the following are some of my interview questions, though not very complete, but also will ask a few questions about (preface to tell everybody, The answer of the interview I will not write out one by one, after all, the grade is different, the answer when answering is also different, this all depends on everybody slowly understand) I can help only so much. Here are the interview questions.
First stop :(shenzhen)
1. Multiple threads are reading and writing at the same time, and the number of reading threads is much larger than that of writing threads. How do you think to solve the concurrency problem? What kind of lock would you choose?
2. Do you understand the AQS of JAVA and what it does?
3. Besides synchronized, what do you do to ensure thread safety?
4. When should volatile be used? Is it thread-safe?
5. What happens if all threads in the thread pool are busy and submit a new task? What happens when the queue is full and still busy?
6. How do you normally adjust the parameters of Tomcat?
7. What does synchronized lock? How is it represented in bytecode? What is represented on the stored object?
8. Do wait/notify/notifyAll methods need to be included in a synchronized block? Why is that?
How do you usually use the ExecutorService? One per service or one per project? What are the benefits?
Second, third stop
Spring
-
Have you ever used Spring AOP? What is it for? How might it be used?
-
If an interface has two different implementations, how do you Autowire a given implementation?
-
Where do Spring’s declarative Transaction @Transaction annotations go? Does it roll back automatically if an exception is thrown? Is there a way to control not to trigger a rollback?
-
If you want to execute your own logic after a Bean is generated and assembled, how can you implement it?
-
Why can SpringBoot run HTTP services when it is not in a Web container?
-
What if you want to use custom configuration files in SpringBoot instead of just application.properties?
-
Can RequestMapping specify GET and POST methods in SpringMVC? How do you specify it?
-
What if SpringMVC wants to wrap an output Object(such as XXResult or XXResponse) as a JSON output?
-
How do I intercept SpringMVC exceptions and do custom processing, such as logging or wrapping them as JSON
-
1. Differences between Struts1 and struts2
-
Struts2 and springMVC
-
Which JARS need to be referenced in the Spring framework, and what they are used for
-
The principle of for springMVC
-
Meaning of springMVC annotations
-
The connection and difference between Spring beanFactory and ApplicationContext
-
Several ways of Spring injection
-
How does Spring implement transaction management
-
Principles of springIOC and AOP
-
How level 1 and Level 2 caches are used in Hibernate and how they differ
-
Spring’s method of cyclic injection
MySQL
-
If you have a lot of data inserted into MYSQL, which method do you choose?
-
If the query is slow, what’s the first way you think about it? What does an index do?
-
If you create a single-column index, will the single-column index be used when 2 columns are queried?
-
If you create an index that contains multiple columns and use only the first column in the query, can you use this index? What about three columns?
-
Would this index be used if the WHERE condition is followed by I + 5 < 100?
-
How do I see if I’m using an index?
-
Like %aaa% will use index? Like aaa %?
-
What is the difference between DROP, TRUNCate, and DELETE?
-
How do you normally monitor the database? Slow SQL is how to check?
-
Does your database support emoji? If not, how do you operate?
-
What is the amount of data per table in your database? How old is the general query performance began to decline sharply?
-
The query died. Want to find out what command is used by the executing query process? What do you do when you find out?
-
How does read/write separation work? What do you think the middleware will do? What does this have to do with the transaction? 14. Have you done the database and table? What is the migration process like online? How do you know if the data is correct?
-
MySQL > select * from ‘MySQL’;
-
Characteristics of things in the database?
17. JDBC use?
-
Differences between InnodB and MyISAM
-
Why does MySQL use B+ trees as indexes?
JVM
-
What do you know or what GC strategy you use online? What are its advantages and what scenarios are it suitable for?
-
How many JAVA class loaders are included? What is the father-son relationship between them? What does parental delegation mean? What are the benefits?
-
How do I customize a class loader? What have you used or in what scenarios do you need a custom classloader?
-
What are the parameters for heap memory Settings? 5. What data is stored in Perm Space? Does it cause OutOfMemory? 6. In gc, what is the order in which objects are moved in memory Spaces?
-
Have you ever had an OutOfMemory problem? How did you deal with the problem? What are the gains from the process?
-
What changes have been made to Perm Space since 1.8? Is MetaSpace size unlimited by default? Or are you going to specify the size in some way?
-
What does Jstack do? Jstat? If an online application periodically freezes and you suspect gc is the cause, how do you troubleshoot this problem? What part of a thread log do you usually look at?
-
Have you encountered StackOverFlow exceptions? Under what circumstances would you guess to be touched? How do I specify the stack size of a thread? How much do you usually write?
multithreading
-
What is a thread?
-
What is the difference between threads and processes?
-
How do you implement threads in Java?
-
Runnable or Thread?
-
What is the difference between the start() and run() methods in Thread?
-
What is the difference between CyclicBarrier and CountDownLatch in Java?
-
What is a volatile variable in Java?
-
What is the difference between synchronous and concurrent collections in Java?
10) How to avoid deadlocks?
- What is the difference between live locks and deadlocks in Java?
12) What is the difference between Synchronized and ReentrantLock in Java?
What is the concurrency of ConcurrentHashMap in Java?
- How to create Immutable objects in Java?
15) What is the double check of singleton mode?
- Write down 3 best practices for multithreading that you follow
17) How to avoid deadlocks?
- Common thread pool patterns and usage scenarios for different thread pools
Netty
1. What are the differences between BIO, NIO and AIO?
2. What is NIO made of?
3.Net TY features?
4.Net TY thread model?
5. Cause and solution of TCP packet sticking/unpacking?
6. What serialization protocols do you know?
7. How to select a serialization protocol?
8.Net TY zero copy implementation?
What are the high performance of 9.Net TY?
10. NIOEventLoopGroup source?
Redis
1. The difference between Redis and Memorycache?
2. The five data structures of Redis?
3. Progressive Rehash process?
4. Rehash source?
5. Persistence mechanism
6. Reaof source?
7. Transactions and events
8. Master/slave replication
9. Start the process
10. The cluster
11.Redis’ six data elimination strategies
12. Redis concurrency competition problem?
Hadoop
1.HDFS features?
2. How does the client read and write data from the HDFS?
3.HDFS file directory structure?
4.NameNode memory structure?
5.NameNode restart optimization?
6. Use Git?
7. The use of Maven
Well, the examination questions here have almost finished, if the above interview questions you have all understood, all can answer out, so I can tell you here, you cow approve, I am satisfied.
If the above questions will not, also can not answer, then you can follow my footsteps, I will introduce several major systems I summed up, if you want to learn these contents, I can recommend you to learn the exchange group: 744642380 you want to learn can add group, but remember to note good information oh. (Remember: Add group: 7446423804 please note good information)
Here are the major system diagrams I have summarized:
One, source code analysis
Distributed architecture
Third, micro services
Fourth, performance optimization
Five, Java engineering
Conclusion:
The content of the above is what I want to say to write, hope the above can help to is silent and hardships, the content of the encounter bottle disease and Java programmers don’t know what to do, what can I do for you only so much, finished the interview questions have been summarized, I can do to help, also only so much, I hope you in later work and the interview, everything goes well.
Source: author: George AI links: https://www.jianshu.com/p/1fd6a3d4b739 Jane books copyright owned by the author. Commercial reprint please contact the author for authorization, non-commercial reprint please indicate the source.