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

  1. Have you ever used Spring AOP? What is it for? How might it be used?

  2. If an interface has two different implementations, how do you Autowire a given implementation?

  3. 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?

  4. If you want to execute your own logic after a Bean is generated and assembled, how can you implement it?

  5. Why can SpringBoot run HTTP services when it is not in a Web container?

  6. What if you want to use custom configuration files in SpringBoot instead of just application.properties?

  7. Can RequestMapping specify GET and POST methods in SpringMVC? How do you specify it?

  8. What if SpringMVC wants to wrap an output Object(such as XXResult or XXResponse) as a JSON output?

  9. How do I intercept SpringMVC exceptions and do custom processing, such as logging or wrapping them as JSON

  10. 1. Differences between Struts1 and struts2

  11. Struts2 and springMVC

  12. Which JARS need to be referenced in the Spring framework, and what they are used for

  13. The principle of for springMVC

  14. Meaning of springMVC annotations

  15. The connection and difference between Spring beanFactory and ApplicationContext

  16. Several ways of Spring injection

  17. How does Spring implement transaction management

  18. Principles of springIOC and AOP

  19. How level 1 and Level 2 caches are used in Hibernate and how they differ

  20. Spring’s method of cyclic injection

MySQL

  1. If you have a lot of data inserted into MYSQL, which method do you choose?

  2. If the query is slow, what’s the first way you think about it? What does an index do?

  3. If you create a single-column index, will the single-column index be used when 2 columns are queried?

  4. 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?

  5. Would this index be used if the WHERE condition is followed by I + 5 < 100?

  6. How do I see if I’m using an index?

  7. Like %aaa% will use index? Like aaa %?

  8. What is the difference between DROP, TRUNCate, and DELETE?

  9. How do you normally monitor the database? Slow SQL is how to check?

  10. Does your database support emoji? If not, how do you operate?

  11. What is the amount of data per table in your database? How old is the general query performance began to decline sharply?

  12. The query died. Want to find out what command is used by the executing query process? What do you do when you find out?

  13. 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?

  14. MySQL > select * from ‘MySQL’;

  15. Characteristics of things in the database?

17. JDBC use?

  1. Differences between InnodB and MyISAM

  2. Why does MySQL use B+ trees as indexes?

JVM

  1. What do you know or what GC strategy you use online? What are its advantages and what scenarios are it suitable for?

  2. How many JAVA class loaders are included? What is the father-son relationship between them? What does parental delegation mean? What are the benefits?

  3. How do I customize a class loader? What have you used or in what scenarios do you need a custom classloader?

  4. 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?

  5. Have you ever had an OutOfMemory problem? How did you deal with the problem? What are the gains from the process?

  6. 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?

  7. 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?

  8. 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

  1. What is a thread?

  2. What is the difference between threads and processes?

  3. How do you implement threads in Java?

  4. Runnable or Thread?

  5. What is the difference between the start() and run() methods in Thread?

  6. What is the difference between CyclicBarrier and CountDownLatch in Java?

  7. What is a volatile variable in Java?

  8. What is the difference between synchronous and concurrent collections in Java?

10) How to avoid deadlocks?

  1. 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?

  1. How to create Immutable objects in Java?

15) What is the double check of singleton mode?

  1. Write down 3 best practices for multithreading that you follow

17) How to avoid deadlocks?

  1. 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.