On the first day when I walked into Ali, I finally knew why everyone wants to enter the big factory with a squeezed head. I hereby attach my interview book about entering Ali!

Preface

First of all, I would like to introduce myself. I graduated with a bachelor’s degree from a certain scum in Nanjing. After graduation, I have stayed in a small company to fish and wait to die. I was almost laid off during the epidemic this year. I thought about it and couldn’t just keep going. Well, I decided to resign a few months ago. After resigning, I went to several companies. I had some who were killed and I didn’t get a satisfactory offer. I spent a few months at home to study. Last month, my friend gave Ali a referral and wanted to try it. , The result is over!

java basics

  • 1. Tear code by hand. You can check the original question on Niuke Tiba: NC20 numeric string is converted into IP address
  • 2. Define Integer x=20 Integer y=200 What is the process in memory?
  • 3. The principle of volite keyword? Can it guarantee atomicity? How is the bottom layer of AtomicInteger implemented?
  • 4. Has the threadLocal keyword ever been useful? What if you just get directly without overriding the initialValue method?
  • 5. Principles and differences between hashMap and concurrentHashMap?
  • 6. Under what circumstances will a circular linked list appear in hashMap? What lock is used when writing concurrentHashMap? 7. How does the bottom layer of RenteenLock ensure thread safety?
  • 8. Can reflection get the private methods of the parent class? How to prevent reflection from destroying the singleton mode?
  • 9. Describe the JVM memory model. What is the role of each zone? The working principle of heap memory, why do we need two survival areas? Can only one work? What garbage collection algorithm does the old generation use?
  • 10. Describe the principle of multithreading. How to start a thread? What is the difference between start and run methods?
  • How to create a thread pool and what is the meaning of the parameters passed in? How does the thread pool maintain the number of core threads? How to implement a custom rejection strategy?
  • 11. Socket programming nio (I'm not familiar with this one, so I said I didn't understand it, the interviewer didn't ask it in detail)

Open source framework related

  • 1. What open source frameworks have you used? Which is the most familiar? (I talked about spring here, so the following questions are all about spring)
  • 2. Describe spring ioc and aop.
  • Which injection method do you use? What is the difference between BeanFactory and ApplicationContext? Which one is used in your project? Talk about the life cycle of spring beans.
  • What is the realization principle of AOP? Two dynamic proxy implementation principles? Why does JDK dynamic proxy implement interfaces?
  • 3. How is spring task realized?
  • 4. How do you use spring affairs? What does spring do with the @Transcational annotation? How do you know that the transaction is executed successfully?
  • Transaction isolation level? What is the default level of mysql? Transaction propagation properties? What is spring default? When do nested transaction sub-transactions commit?
  • 5. What is the relationship between spring and springMVC? Have you used JdbcTemplate?
  • 6. What is the processing flow of the entire request in springMVC? Which view is used to return json?

Network related

  • 1. What content has been added in HTTP 1.1? What are the ways to request?
  • 2. Describe the HTTP three-way handshake and four-wave handshake process? Why do I need to wave four times? Why does the TIME_WAIT state need to pass two maximum segment lifetimes to reach the close state?
  • 3. What process does the browser go through from initiating a request to receiving the response? Say as much as you know, the more detailed the better.

Nginx related

  • 1. What modules does nginx have? Which one are you more familiar with?
  • 2. How do you configure proxy_cache? Where does the cache exist? How exactly does it hit the cache?
  • There was nginx in the resume, but I didn’t answer a few questions, so the interviewer didn’t ask more, 囧~

Database related

  • 1. How is the mysql index implemented? What are the characteristics of b+ tree? Where does the real data exist?
  • 2. Under what circumstances are indexes built? Explain the leftmost matching principle?
  • Now a table has three columns abc, where a like? and b=? and c=? Can this combined index be used when querying a composite index (a, b, c)? why?
  • 3. Have you seen the explain execution plan? What are the values ​​of the type field? What do they represent?
  • 4. What sql tuning experience do you have?

Redis related

  • 1. What kind of data structure does redis have? How do you know which structure is used for a key?
  • 2. How to view all keys? How does redis switch libraries? How to clear the data?
  • 3. Describe the redis elimination strategy? If there is no data, it can be eliminated. If the elimination strategy is not configured, can the read request be executed normally?
  • 4. Is redis single-node in your project? How to synchronize if multiple nodes?
  • 5. What data is stored in redis in the project? Why use redis? What is the difference between jetty local cache?

Linux related

  • 1. How to check the threads in a process?
  • 2. How to replace a character in all files in a folder in batches? (Sed command)
  • 3. Have you ever used the jps jmap jstack jstat command? Tell us about the commonly used parameters, and say as many as you know.
  • I am here based on my own experience of using jmap jstack to locate online questions. After answering, I feel that the interviewer is quite satisfied, so practice is very important~

Scenario simulation & others

  • 1. Design a system with 10 billion pieces of data every day, which needs to be displayed and searched in real time in the background.
  • The general idea I answered at that time was nginx load balancing, message queue storage, multi-threaded reading, batch insertion, database sub-database sub-table.
  • The interviewer derives a lot of questions based on my answers. What if the message queue is full? (That is, consumption can't keep up with production) What is the impact of a failure in batch insertion? How to deal with it? How should the sub-database sub-table be divided? How to solve the problem of data migration?
  • 2. Use the code to realize the function of cat 1.log |grep a |sort |uniq -c |sort -rn.
  • 3. Tear code by hand. You can go to see the original question on Niuke’s title bar: NC127 longest common substring
  • 4. If a server suddenly becomes very slow, how to locate the problem?

The following is a collection of interview questions and materials that I have compiled:

Friends in need can scan the code below my VX: rxh8515 and send it to you for free!

image.png

The last point I want to emphasize for interviews with big factories is that the mentality is really important, and it is the key to determining your performance in the interview process. If you can’t perform normally, it is likely that you missed the offer because of a small mistake, so you must pay attention to it. stand up. Friends who need the information above will get them directly. They are waiting for you with sincerity, and I only hope to help you! Another reminder, full review is the key to eliminating your nervous state of mind, but if you review enough, you will naturally have more confidence in the interview process.

Guess you like

Origin blog.csdn.net/weixin_47082274/article/details/111478282