Three years of development, target big factory, interview with Ali, Tencent, JD, come back to share a wave of big factory experience!

Preface

Some time ago, I accompanied colleagues who worked with me to the interview. The first stop was Shenzhen, the second stop was Shanghai, and the third stop was Hangzhou. I won’t say much about the company for the interview. You know it’s a first-tier company. Actually, I really didn’t plan to write this article. The main reason is that my memory is not very good. Moreover, many people have recently asked about the latest interview questions in 2020. I really can’t answer them, and I’m afraid to avoid repeated answers. Save yourself a little effort and simply reply here. To be honest, although as an escort, I cannot go in for the interview together during the interview. After the interview, my colleague came out with his vague memory to slowly recall a few questions asked by HR at the time. The following is my collation Some interview questions, although not very complete, are almost a few questions that must be asked (the preface tells you that I will not write down the answers to the interview one by one. After all, the answers are different for different levels. It's up to everyone to understand it slowly) There is only so much I can help. The following are the interview questions.

The first stop: (Shenzhen)

  1. Multiple threads read and write at the same time. The number of reader threads is much larger than that of writer threads. How do you think the problem of concurrency should be solved? What kind of lock would you choose to add?
  2. Does JAVA's AQS know what it is?
  3. Except for the synchronized keyword, how do you ensure thread safety?
  4. When do you need to add the volatile keyword? Can it guarantee thread safety?
  5. If all the threads in the thread pool are busy and submit a new task, what will happen? After the queue is full, it is still busy. What will happen if I submit it again?
  6. How would you adjust the parameters of Tomcat itself?
  7. What is locked by the synchronized keyword? How is it represented in bytecode? What does it represent on objects in memory?
  8. Does the wait/notify/notifyAll method need to be included in the synchronized block? Why is that?
  9. How do you use ExecutorService in general? Is it one per service or one item? what is the benefit?

Second and third stop

Spring

  1. Have you ever used Spring's AOP? Is it used? How do you use it?
  2. If there are two different implementations for an interface, then how can Autowire have a specific implementation?
  3. Where is Spring's declarative transaction @Transaction annotation generally written? Will it be automatically rolled back if an exception is thrown? Is there a way to control not to trigger a rollback?
  4. If you want to execute your own logic after a certain bean is created and assembled, how can you implement it?
  5. SpringBoot is not put in the web container. Why can it run HTTP services?
  6. In SpringBoot, if you want to use custom configuration files other than application.properties, what should you do?
  7. Can RequestMapping in SpringMVC specify GET and POST methods? How to specify?
  8. If SpringMVC wants to package the output Object (such as XXResult or XXResponse) as JSON output, what should be done?
  9. How to intercept SpringMVC exceptions, and then do custom processing, such as logging or packaging into JSON
  10. 1. The difference between struts1 and struts2
  11. The difference between .struts2 and springMVC
  12. Which jar packages need to be referenced in the spring framework and the purpose of these jar packages
  13. The principle of springMVC
  14. The meaning of springMVC annotations
  15. The connection and difference between beanFactory and ApplicationContext in spring
  16. Several ways of spring injection
  17. How does spring realize things management
  18. Principles of springIOC and AOP
  19. How to use level 1 and level 2 cache in hibernate and the difference principle
  20. The way of cyclic injection in spring

MySQL

  1. If there is a lot of data inserted into MYSQL, what method would you choose?
  2. If the query is slow, what is the first way you will think of? What is the index?
  3. If a single-column index is built and two columns are found when querying, will this single-column index be used?
  4. If an index containing multiple columns is built, and only the first column is used in the query, can this index be used? How about checking three columns?
  5. Continue to the question, if there is an i + 5 <100 after the where condition, will this index be used?
  6. How to see if a certain index is used?
  7. Does like %aaa% use an index? What about like aaa%?
  8. What is the difference between drop, truncate, and delete?
  9. How do you monitor the database? How do you troubleshoot slow SQL?
  10. Does your database support emoji expressions, and if not, how to do it?
  11. What is the amount of data in a single table of your database? Does the query performance begin to drop sharply at most times?
  12. The query is dead, what command do you want to find out which query process is executing? After you find it out, will you usually do it?
  13. How is the separation of reading and writing done? How do you think middleware will operate? What does this operation have to do with transactions? 14. Have you done sub-database sub-table? What is the online migration process like? How to make sure the data is correct?
  14. MySQL common commands
  15. What are the characteristics of things in the database?
  16. The use of JDBC?
  17. The difference between InnodB and MyISAM
  18. Why does MySQL use B+ trees as indexes?

JVM

  1. What do you know or what GC strategy do you use online? What are its advantages and what scenarios are suitable for?
  2. What kind of JAVA class loaders are included? What is the sub-relationship between them? What does the parental delegation mechanism mean? what is the benefit?
  3. How to customize a class loader? Which ones have you used or in what scenarios do you need a custom class loader?
  4. What are the parameters for heap memory settings? 5. What data is stored in Perm Space? Will it cause OutOfMemory? 6. When doing gc, what is the order in which an object is moved in each Space in the memory?
  5. Have you encountered the OutOfMemory problem? How do you deal with this problem? What are the gains in the process?
  6. What changes will Perm Space have after 1.8? Is the MetaSpace size limit by default? Or what method will you use to specify the size?
  7. What is Jstack? What about Jstat? If the online program freezes periodically, you suspect it may be caused by gc. How would you troubleshoot this problem? What part of the thread do you usually look at?
  8. Have you encountered StackOverFlow exceptions? Normally you guess under what circumstances will it be triggered? How to specify the stack size of a thread? How much do you write in general?

Multithreading

1) What is a thread?

2) What is the difference between thread and process?

3) How to implement threads in Java?

4) Use Runnable or Thread?

6) What is the difference between the start() and run() methods in the Thread class?

7) What is the difference between CyclicBarrier and CountDownLatch in Java?

8) What is a volatile variable in Java?

9) What is the difference between synchronous collection and concurrent collection in Java?

10) How to avoid deadlock?

11) What is the difference between livelock and deadlock in Java?

12) What is the difference between synchronized and ReentrantLock in Java?

13) What is the concurrency of ConcurrentHashMap in Java?

14) How to create Immutable objects in Java?

15) What is the double check lock in singleton mode?

16) Write 3 best practices for multithreading that you follow

17) How to avoid deadlock?

  1. Common thread pool modes and usage scenarios of different thread pools

Netty

1. What is the difference between BIO, NIO and AIO?

2. What is the composition of NIO?

3. What are the characteristics of Netty?

4. Netty's threading model?

5. The reasons and solutions for TCP sticking/unpacking?

6. What kind of serialization protocols do you know?

7. How to choose serialization protocol?

8. What is Netty's zero copy implementation?

9. What are the high performance of Netty?

10. NIOEventLoopGroup source code?

Redis

1. The difference between Redis and Memorycache?

2. Five data structures of Redis?

3. Progressive rehash process?

4. Rehash source code?

5. Persistence mechanism 6. Reaof source code?

7. Affairs and events

8. Master-slave replication

9. Startup process

10. Cluster

11. Redis's 6 data elimination strategies

12. Concurrent competition in redis?

Hadoop

1. What are the characteristics of HDFS?

2. How does the client read and write data from HDFS?

3. What is the file directory structure of HDFS?

4. What is the memory structure of NameNode?

5. Restart optimization of NameNode?

6. How to use Git?

7. Use of Maven

Answers to some high-paying interview questions

Tencent Java senior post has 180 real interview questions, and it’s no problem to get 45 Koffer for the interview!

 

Tencent Java senior post has 180 real interview questions, and it’s no problem to get 45 Koffer for the interview!

Well, the interview questions here are almost finished. If you have understood all the above interview questions and can answer them all, then I can tell you here, you are good, I will take it. If the above questions are not correct, and you still can’t answer them, then you can follow in my footsteps to receive the answers I have compiled. I will introduce the major systems I have summarized. There are also corresponding learning materials for Java engineering, High performance and distributed, high performance, explain the profound things in a simple way. Explanation of knowledge points such as performance tuning, Spring, MyBatis, Netty source code analysis

After forwarding + commenting, follow me and add assistant VX: MXW5308 to receive it for free

The following are the major system diagrams I summarized:

One, source code analysis

Fighting on the front line, rushing to the big factory, the interview summary after three years of Java programmer interview

 

Two, distributed architecture

Fighting on the front line, rushing to the big factory, the interview summary after three years of Java programmer interview

 

Three, microservices

Fighting on the front line, rushing to the big factory, the interview summary after three years of Java programmer interview

 

Fourth, performance optimization

Fighting on the front line, rushing to the big factory, the interview summary after three years of Java programmer interview

 

Five, Java engineering

Fighting on the front line, rushing to the big factory, the interview summary after three years of Java programmer interview

 

Corresponding architecture video (partial)

Fighting on the front line, rushing to the big factory, the interview summary after three years of Java programmer interview

 

Fighting on the front line, rushing to the big factory, the interview summary after three years of Java programmer interview

 

to sum up:

The above is what I want to say. I hope that the above content can help Java programmers who are in silent hardships, encounter bottle problems and don’t know what to do. There is only so much I can help you. The interview questions have been summarized. That's it, there is only so much I can help. I hope that everything goes well in future work and interviews.

After forwarding + commenting, follow me and add assistant VX: MXW5308 to receive it for free

Guess you like

Origin blog.csdn.net/weixin_45132238/article/details/109334454