NetEase One Side Internship (2.24)

Netease side (2pm on February 24, 2021)

Experience

The difficulty of the interview is not bad, most of the questions asked are more basic, not so many eight-legged essays, focusing on practical applications, and more to discuss your solutions and problems you will encounter for some specific scenarios.

The interviewer was very good, and the whole process was patient and listened to me and analyzed it with me. It was a very rewarding interview experience.

What I remember is written below

Interview duration: 52 minutes

Interview method: video

Interview Department: Netease News

  1. Self introduction

    I am XXX, a student from Double Non-XXXX University who knows nothing...

  2. Project, about half an hour, the following questions are also some of the questions asked during the project

  3. In a peak period after the project went online, a large number of users accessing the system at the same time caused high concurrency problems. How do you prevent and deal with it?

    The question was a little sudden... I didn't prepare much

    Gateway layer: traffic limit, set the maximum number of requests accepted by the system, and all the rest will be returned

    Middle layer: Use Redis as a cache according to specific business needs, and eat some of the requests

    Persistence layer: database MySQL master-slave replication, read-write separation, load balancing, database sub-table, etc.

  4. In the process of doing the project, did you encounter any database problems? How to solve it? Can you talk about the process of troubleshooting bugs?

    em...too much talk...I honestly answered a small question that I remembered when I was writing the project, but I checked the bug for a long time. The last problem found is that the storage size of a field in the database is set to be small.

  5. Why use Redis in your project? In which business scenarios did you use it?

    Redis is an open source high-performance key-value (key/value) distributed memory database developed in C language. It is a NoSQL database that runs on memory and supports persistence. Can be used as database, cache, message middleware, etc.

    As a memory database, Redis has excellent performance, the data is in memory, and the read and write speed is very fast. It supports concurrent 10W QPS; supports rich data structure types; thread safety, single process and single thread, adopts IO multiplexing mechanism; supports data Persistence, you can save the data in the memory to the disk and load it when you restart; master-slave replication, sentinel, high availability; can be used as a message middleware, supporting publish and subscribe message systems

  6. In actual projects, what problems will be encountered when using Redis as a cache?

    Cache and database data consistency issues: In a distributed environment, data consistency issues between caches and databases are prone to occur.

    If the project business requires strong data consistency, then don't use caching. Only appropriate strategies can be adopted to reduce the probability of data inconsistency between the cache and the database, and strong consistency cannot be guaranteed. Appropriate strategies include cache update strategy, update the cache in time after updating the database, and increase the retry mechanism when the cache fails

  7. Talk about the data types supported by Redis

    String, hash, list, set, ordered set

    You can briefly introduce and talk about common specific application scenarios

  8. I threw a scene question, it seems to be about the leaderboard, the specific question is a bit forgotten

    I'm talking about using the type of ordered set zset. Then added the characteristics and data structure of zset. Then he asked for the specific implementation order... I said I forgot

  9. Algorithmic questions, not difficult, thinking in seconds, the realization process is a little interlude

    Too nervous, my brain watts.

    C++ has written a lot of algorithms, and I made a mistake in the Java string interception method. It took five minutes to remember hhh

  10. (Because the string String I did not answer smoothly, so I continue to ask) Do you know StringBuffer and StringBuilder? Tell me about the difference between them

    • variable

      The final keyword is used in the String class to modify the character array to save the string, so the String object is immutable. Both StringBuilder and StringBuffer inherit the AbstractStringBuilder class. Looking at the source code, you can see that the bottom layer is also implemented using a character array, but it is not decorated with the final keyword, so both of them are variable.

    • Thread safe

      Objects in String are immutable, that is, they can be understood as constants: thread-safe

      StringBuffer adds a synchronization lock to the method or adds a synchronization lock to the calling method, so it is thread-safe; and StringBuiler does not add a synchronization lock to the method, so the thread is not safe

    • performance

      Every time you change the String type, you need to generate a new String object, and then point the pointer to the new String object. StringBuffer operates on the object itself every time, instead of generating new objects and changing object references. Under the same circumstances, using StringBuilder is better than StringBuffer performance

    to sum up:

    1. Operate a small amount of data: String
    2. Operate large amounts of data in a single-threaded string buffer: StringBuilder
    3. Operate large amounts of data under multi-threaded operation string buffer: StringBuffer

    I asked some questions about Spring, SpringMVC, SpringBoot, and I forgot the details, but the answers were not very good, so I didn’t ask much.

  11. Let’s talk about Java collections. Do you know HashMap? Talk about its principle

  12. Expansion mechanism?

  13. Is it thread-safe in a high-concurrency environment? What's the problem if the thread is not safe?

  14. How to ensure HashMap thread safety?

  15. Can you talk about what is thread safety and what is thread insecurity? (No answer)

When multiple threads access an object, if there is no need for additional synchronization control or other coordination operations, the behavior of calling this object can get the correct result, we say that the object is thread-safe

  1. How should the database be designed?

    The embarrassing operation...

  2. MySQL index? Index failure?

Rhetorical question:

  1. Do you think I have something to pay attention to or better suggestions?

  2. When will there be interview results?

    Follow-up operations, keep the phone open these days, wait for HR call notification

Feel

In general, most of the time is spent talking about the project, it is necessary to fully prepare the project. Surprisingly, I didn’t ask about JVM/GC, computing network (just haven’t looked at it), multi-threading and I only asked about the basics...the project involved in the question involves more technology and foundation, maybe I’m too good at it, hahaha

This is the first interview in preparation for so long. No matter what, stay optimistic, keep moving forward, come on and get an offer as soon as possible! ! !

Guess you like

Origin blog.csdn.net/weixin_44723496/article/details/114051149