The latest first-line big companies (Ali, Baidu, JD, etc.) technical interview difficulties sort out, after reading the long snacks!

table of Contents

  • Java basics
  • Spring
  • MySQL
  • JVM
  • Linux commands
  • Linux common problems
  • Redis
  • Experience sharing
  • Welfare egg

Java

  1. Multiple threads read and write at the same time, and the number of reader threads is far greater 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 does?
  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 happens when 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 is the performance 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 generally use ExecutorService? Is one for each service or one for each project? what is the benefit?

Spring

  1. Have you ever used Spring's AOP? What is it for? How do you use it?
  2. If there are two different implementations for an interface, then how to autowire 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 generated and assembled, how can you implement it?
  5. Why can SpringBoot run HTTP service without putting it in the web container?
  6. In SpringBoot, if you want to use a custom configuration file instead of just 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

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 does the index do?
  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 when querying, 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. Will like %aaa% use an index? 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, if not, how to operate?
  11. What is the amount of data in a single table of your database? At what age does the query performance begin to drop sharply?
  12. The query is dead, what command do you want to use to find out the query process? What do you usually do after finding it out?
  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 the sub-database sub-table? What is the online migration process like? How to make sure the data is correct?

JVM

  1. What do you know or what GC strategy do you use online? What advantages does it have and what scenarios it is suitable for?
  2. How many types of JAVA class loaders are included? What is the father-son 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?
  7. Have you encountered an OutOfMemory problem? How did you deal with this problem? What are the gains in the process?
  8. What changes will Perm Space have after 1.8? Is the MetaSpace size infinite by default? Or will you specify the size in any way?
  9. What does Jstack do? 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 log do you generally look at?
  10. Have you encountered StackOverFlow exceptions? Under what circumstances do you guess it will be triggered? How to specify the stack size of a thread? How much do you usually write?

Linux commands

  1. The log is very large and I just want to see the last 100 lines. How do I get it? If I want to keep watching the log's continuous output, what command should I use?
  2. What should I do if I want to see if there is a certain keyword in real time while outputting the log?
  3. What should I do if grep ignores case? What about regular expressions?
  4. What key is the next line in vim? What about the next 30 lines? What is the line that jumps to the end of the file? What is the jump back? What is the backward search?
  5. If you have a text file, use spaces as the column separator. If you want to count the number of occurrences of each word in the third column, what should I do?
  6. What should I do if I sort the number of occurrences above? I want to sort it in the order of the number itself instead of the order of the string?
  7. What is the separator for Linux environment variables? What command is used to set environment variables?
  8. What command is used to set a limit for a certain file right, such as setting it to 644? What does this 6 mean?
  9. What if you want to see the resource occupancy of a certain process under Linux? What does system load probably mean? What is the average load of your online system? If a 4-core machine, how much load do you think is normal? What happens when I click 1 in the top command?
  10. In the top command, sometimes the CPU usage of all the processes add up to more than 100%. Why?
  11. What other commands are available to check system performance or find problems? Which parameter do you generally look at?
  12. Want to see which network connections are opened by a certain process? Which connection status do you care more about?

Linux common problems

  1. Have you ever optimized the parameters of the Linux system, and what have you probably optimized?
  2. What can be used for a backlog in the system parameters?
  3. Check the network connection and find a lot of TIME_WAIT. What could be the reason? What impact will it have on your application? What way would you choose to reduce these TIME_WAIT
  4. Could you please introduce the TCP three-way handshake process? If there is a network program, you use a third-party library to send data, and you suspect that the data sent by the library is faulty, how do you verify it? How do you generally analyze the files exported by tcpdump?
  5. What is KeepAlive for? What are the benefits of this?

Redis

Development
  1. Can you tell me about cache penetration? How do you think this problem should be solved
  2. How did you trigger the cache update? (For example, set the timeout period (passive mode), such as active update when updating)? If it is a passive way, how to control multiple entries to trigger a cache update at the same time?
  3. What do you use Redis for? Why not use other KV storage such as Memcached, Cassandra, etc.?
  4. What Redis client do you use? The reasons for the high performance of Redis can probably be said?
  5. Which Redis data structures are you familiar with? What does zset do? What is the difference between set and set?
  6. Redis hash, what is the name of the specific command for storage and acquisition?
  7. The difference between LPOP and BLPOP?
  8. What are some Redis commands that contain the SCAN keyword? Is the amount of data returned by SCAN fixed?
  9. Has Lua in Redis been used? What can it be used for? Why can it be used like this?
  10. What is Redis's pipeline used for?

Experience sharing

If your skills are solid and there is no problem, the next interview will also determine whether you can be recognized and get the offer. List the following points of experience and prepare the answers in advance before the interview.

  1. It is best to prepare 1-2 questions to deal with questions like "Do you have anything to ask?"
  2. Don’t complain about your current and previous employers.
  3. Keep the timing and rhythm of the conversation going smoothly, but don't talk too much about one problem, and introduce one problem to the next.
  4. During the interview process, the interviewer’s questions may be more detailed and sharp. That is a normal part, so don’t be nervous.
  5. If you encounter a problem that you don’t know much about, it’s best not to say ambiguous answers.
  6. It is best to maintain a high degree of willingness in the communication process.

Reader benefits, complete interview questions [with answers] Java core notes, Java architecture interview topic integration thousand
ways (pdf document) I also compiled a set of Java back-end advanced notes documents and learning materials for free to share with everyone!
Because of space problems, I will not show all out, need just click here, right, right, right here, reply signal: CS can receive a free! ! !

JVM related

Multi-threaded concurrency related

Spring related

Microservice related

Database related

Because of space problems, I will not show all out, need just click here, right, right, right here, reply signal: CS can receive a free! ! !

More notes to share

Guess you like

Origin blog.csdn.net/weixin_50520844/article/details/108664920