From traditional companies to Byte, Meituan, JD.com, to the acquisition of Huawei's Offer, programmers' counterattack road.

Preface

In June, Shuiyou told me that I wanted to quit, and staying in a traditional company was not the way to go. At that time, I prepared for two months and finally got an offer from Huawei. Let’s experience the interview experience of the big guys together!

background

211 books, 985 masters, have been in traditional enterprises since graduation. From the end of June, I started to bite the bullet and read the questions, and then from the end of August, I started to prepare for autumn recruitment. I have received a few offers so far, and I am ready to sign Huawei .

 

Jingdong

JD.com was the first company to interview. Although it has passed, JD.com has become a sea, and it is estimated that it will not be able to get it.

One side (telephone interview 40min)

  1. Ask what the undergraduate does and whether you have taken computer-related courses

  2. How does Spring recognize the http request to find the corresponding controller

  3. Will the object move in the heap memory

  4. Can Integer be used == to judge equality (-128 to 127 have cache)

  5. Why rewrite equals to rewrite hashcode (answer because there are some scenarios where hashcode is used, such as set, which will first judge whether the hashcode is the same, and then judge by equals)

  6. Common garbage collection algorithms of JVM and what are their disadvantages

  7. New an object object, and then assign it to a static variable, and then ask what the process is in the JVM memory (the answer will put the created instance object in the heap memory area, and then assign the memory address of the object to the symbol reference , Let this symbol reference point to the corresponding heap memory area)

  8. Will the heap memory address of this object change (yes, because garbage collection will transfer the object, such as copying and marking)

  9. Enter the URL into the browser, how does the whole process look like

    • How does Spring handle HTTP requests

      After the DispatcherServlet receives the HTTP request, it will find the appropriate controller Controller to process the request. It obtains the URI by parsing the URL of the HTTP request, and then obtains the Handler corresponding to the request from the Handler Mapping according to the URI. And the handler interceptor HandlerInterceptor, and finally returned in the form of HandlerExecutionChain.

      The DispatcherServlet selects the appropriate adapter HandlerAdapter according to the obtained Handler. If the adapter HandlerAdapter is successfully obtained, its interceptor method preHandler() will be executed first before calling the Handler.

      The preHandler() method extracts the data in the HTTP request and fills it into the input parameters of the handler, and then starts to call the related methods of the handler (ie, the controller).

      After the Controller finishes executing, it returns a model and view name object ModelAndView to the front dispatcher DispatcherServlet.

      The pre-dispatcher DispatchServlet selects a suitable view resolver ViewResolver according to the model and view name object ModelAndView, provided that the view resolver must have been registered in the Spring IOC container.

      The view resolver ViewResolver will obtain a specific view View according to the view name specified in ModelAndView.

      The pre-dispatcher DispatchServlet fills the model data into the view, and then returns the rendering result to the client.

  10. What is the format of the HTTP message (request line, request header, blank line, request body)

  11. Where does the cookie exist in http

  12. The difference between cookie and session

  13. The index type in mysql and the leftmost principle of joint index

  14. Have you ever understood the covering index (don’t understand)

    If an index contains (or covers) the values ​​of all fields that need to be queried, it is called a'covering index'. That is, only the index is scanned without returning to the table. The advantages of only scanning the index without returning to the table: 1. Index entries are usually much smaller than the size of the data row, only need to read the index, mysql will greatly reduce the amount of data access. 2. Because the index is stored in the order of column values, the IO-intensive range search will be much less than the IO for randomly reading each row of data from the disk. 3. Some storage engines, such as myisam, only cache indexes in memory, and the data depends on the operating system to cache. Therefore, to access the data, a system call is required. 4. Innodb's clustered index. Covering indexes are particularly useful for innodb tables. (Innodb's secondary index saves the primary key value of the row in the leaf node, so if the secondary primary key can cover the query, you can avoid the secondary query of the primary key index)

    The covering index must store the value of the index column, while the hash index, spatial index and full-text index do not store the value of the index column, so mysql can only use the B-tree index as a covering index.

  15. How the transaction is realized.

  16. Does MVCC know?

  17. Transaction isolation level, what problems can be solved respectively

  18. Talk about thread safety issues

  19. The difference between sychronized and Lock

  20. Synchronized methods and underlying principles

    The synchronization method is implicit. A synchronization party*** stores the ACC_SYNCHRONIZED identifier in the method_info structure in the runtime constant pool. When a thread accesses a method, it will check whether there is an ACC_SYNCHRONIZED flag. If it exists, first obtain the corresponding monitor lock, and then execute the method. When the method execution ends (regardless of whether it is a normal return or an exception), the corresponding monitor lock will be released. If other threads also want to access this method at this time, they will be blocked because they cannot get the monitor lock. When an exception is thrown in a synchronous method and there is no capture in the method, the acquired monitor lock will be released first when throwing out

  21. The realization method of lock and the underlying principle (CAS volatile then AQS, then exclusive lock and shared lock)

  22. Thread pool parameters

  23. Scenario question, the number of core threads is 6, the maximum number of threads is 10, the queue is unbounded, and then talk about the process. (Because of the unbounded queue, the number of threads in the thread pool will not exceed 6, and the tasks in the waiting queue can only be executed after the threads have processed the tasks. Speaking of the saturation strategy from the beginning)

  24. Do you understand the parental delegation model (Barabara)

  25. How to destroy (implement the classloader by yourself, then rewrite the classload method, then pull into Tomcat, and then ask Tomcat why it does this, I really want to slap myself, so many words)

  26. Rather, ask which department the interviewer is in and what they do.

  27. Is there an offer? (No)

35min on both sides

  1. Self introduction
  2. Project introduction, architecture
  3. Thread pool, is it useful for multiple threads? How are threads synchronized?
  4. How to create an index in mysql
  5. Whether the application is deployed on a single machine or on multiple machines
  6. Redis deployment mode (master-slave and sentinel)
  7. What is the current research topic
  8. Deep learning model, what is CRNN CTPN, the whole framework
  9. Have you been in contact with Distributed?
  10. Rhetorical question

Phone assault surface 30min

    1. Ask the project

    2. Ask java basics

    3. Ask redis

    4.sql delete duplicate data, keep one

delete from table where sex = (select sex from table group by sex having count(*)> 1) This is to delete all

Delete from table where id not in (select min(id) as id from table group by sex)

    5. The principle of hashmap

    6. The nature of thread safety, how to ensure thread safety

    7. When did you learn java

    8. Rhetorical question

HR face 

  1. Self introduction
  2. Ask to learn, how to do when encountering unknown fields, how to learn
  3. Is there any object
  4. What offer and how to choose
  5. career planning
  6. Rhetorical question

 


byte

One side (70min)

  1. Self introduction
  2. The difference between select and epoll, horizontal trigger and vertical trigger
  3. Where does the so file exist in memory
  4. Page replacement algorithm
  5. Virtual memory, why is virtual memory much larger than physical memory
  6. The memory structure of the process
  7. The difference between CPU overclocking and hyperthreading, what are the advantages of overclocking, hyperthreading (don’t know)
  8. How to avoid syn-flood in TCP
  9. Negotiated compression in HTTP
  10. How does websocket shake hands
  11. The difference between == and equals
  12. The difference between hashmap and hashtable, the difference between abstract classes and interfaces
  13. What are the common HASH algorithms? Have you learned about consistent hashing, why there are virtual nodes, and the application scenarios of consistent hashing (distributed cache)
  14. The method to solve the hash collision, is there any other than the open address method and the zipper method?
  15. Garbage collection, collection algorithm, choose a collector to introduce
  16. What are the common sorts, the process of merge sort and heap sort
  17. What is Kafka used for, how to ensure the high availability of the system, how to ensure that messages will not be lost
  18. linux delete blank line command
  19. How to check the number of CPU cores in linux, lscpu cat /proc/cpuinfo top
  20. Redis common data structure
  21. sentinel mode of redis
  22. Redis expired data is deleted, what should I do if the memory is full, which strategy is the default (noeviction, report an error when it is full, prohibit data elimination)
  23. Congestion control in computer networks
  24. Algorithm problem, the sum of the numbers from the root node to the leaf nodes.
  25. 1G size file, 1M memory, each line consists of words, find the 100 most frequently. (Merge) minimum heap

 

Two sides (80min)

  1. Self introduction
  2. What happens if epoll does not finish processing the data
  3. TCP status corresponding to connect and accept
  4. File system of the container
  5. How does the container achieve CPU resource isolation
  6. How to expand ConcurrenHashMap and its implementation mechanism
  7. Solution to hash conflict
  8. Conditions for deadlock
  9. Mutually exclusive conditions (inalienable conditions, request and hold conditions, loop waiting conditions)

  10. The characteristics of mysql transaction, isolation level, what problems can be solved, page locking (header will hear)
  11. Algorithm question:
-有序的二维数组查找

-LRU+TTL

 

Three sides (40 min)

  1. Self introduction, project question
  2. What aspects of redus is used in projects, commonly used data structures, how zset is implemented, and zset application scenarios
  3. How does udp realize reliable transmission, how to ensure reliable transmission of large files, and how to realize breakpoint transmission.
  4. Nginx load balancing algorithm, consistent hash algorithm, how to implement consistent hash with weight
  5. How many bytes are the sequence number in the header of TCP and why is it used like this?
  6. What you have learned how to learn technology.
  7. Container (docker) network model
  8. Research topic related
  9. Rhetorical question

 HR surface (30min)

     I mainly asked what offers, where I plan to go, whether there are any girlfriends, and some conceptual explanations of technical issues.


 

Huawei

One side (30min)

  1. Self introduction
  2. . Ask the project, introduce yourself
  3. 3. Algorithm problem: Given an array, find out the maximum perimeter that can form a triangle in it, and return 0.
  4. 4.java design pattern (template pattern, agent pattern, factory pattern, singleton pattern)
  5. 5. The difference between fast sorting and merge sorting (both are based on the idea of ​​divide and conquer, merge sorting is a stable sorting, O(nlogn), the worst case is the same, fast sorting is unstable sorting time complexity O(nlogn ), the worst case is O(n2))
  6. 6. What is the role of final usage (modified variables, classes, methods)
  7. 7. Immutable objects
  8. 8. Find the post-order according to the pre-order middle-order

Two sides (40min)

1. Introduction

2. Object-oriented design principles, single responsibility principles, opening and closing principles (how to achieve)

3. Design patterns that you are familiar with (template pattern, agent pattern, factory pattern, singleton pattern)

4. Middleware (redis, kafka)

5. mysql statement, query a field, sort by a field, display how many content on a page

6. Algorithmic questions: spelling words, which words can be spelled out by characters.

Three sides (45min)

1. Introduction

2. Digging deep into the project (WeBank’s competition, selection criteria, criteria for obtaining results, what are you responsible for, the division of labor, whether the team has differences, how to solve them, whether the project encounters any problems, how to solve them, If you want to commercialize this thing, how to improve it, have you considered security issues, how to judge malicious access)

3. Asked the scientific research project, did you encounter any problems, what was the most difficult problem encountered, how to solve it, and whether you have seen the source code.

4. Rhetorical question (asked about the department composition and what is the connection and collaboration (Internet of Things))

At that time, Byte and JD directly hesitated for a long time, and finally chose Huawei

 


Meituan (Liang Jing)

one side

     1. Introduction

     2. Chat project

     3. Tear mysql by hand, query the most on-demand video

select viod_name from table order by times desc limit 0,1

     4. mysql, query the highest user on demand

select userid,count(*) as times from table group by userid order by times desc limit 0,1

    5. Redis data structure, why redis performance is good

    6. Redis expiration mechanism and memory elimination strategy

    7. Redis persistence method (not answered)

    8. Redis concurrency problem (no answer, two users modify a key at the same time)

    9. How is redis lru realized. (Realized by linked list)

   10.Java collection, how does concurrenthashmap solve the concurrency problem, and how does Hashtable solve it.

   11. Commonly used garbage collection algorithm (parralell)

   12. How does cms solve the problem of memory fragmentation (full gc)

  • Increase Xmx or decrease Xmn

  • When the application traffic is lowest, call System.gc() actively in the program, for example, every morning.

  • After the application starts and completes all the initialization work, it actively calls System.gc(), which can compress the initialized data into a single chunk to free up more continuous memory space for new generation promotion.

  • Lower the -XX:CMSInitiatingOccupancyFraction parameter to execute the CMSGC action earlier. Although CMSGC will not compress and organize memory fragments, it will merge adjacent free spaces in the old generation. This can accommodate more new generation promotion behaviors.

   13. The principle of mysql index creation

   14. The process and state of the four waves

   15. Algorithm question: Find the integer addition of two String types String num1 = "123"; String num1 = "456"; Add and reverse

 

Two sides (80min)

    1. Introduction

    2. Tell me about the specific things in the project and how to save the number of people watching online

    3. mysql large table optimization

    4. What redis commands have you used (none)

    5. What tables are in the database

    6. What is the most difficult function to implement in the project

    7. The difference between process and thread

    8. Why process switching is slow and thread switching is fast

    9. How to achieve multithreading

    10. What are the thread pools, how to create them, thread pool parameters, have you used thread pools (none)

    11. What are the states of the thread, how to make the thread enter the blocking state, the difference between blocking, non-blocking, synchronous and asynchronous

    12.JVM memory model

    13. Algorithmic questions

两个链表相加,1-2-3-4-5,1-2-3-4结果就是1-3-5-7-9

两个线程交替打印奇数和偶数(说了想法,没有写)

    14. Have you been reading any books recently? Have you been exposed to any new technologies?

    15. Is there an offer?

I didn't receive any notice later, it was cool. For such a simple algorithm question, the interviewer looked at the weak expression on his face at the time, and was scared to me. I didn't write it well, although I wrote it out. 

 


Write at the end

 

     Heaven rewards hard work. Although it is late to prepare, there will be good results with hard work. There will be confusion and loss in the middle, but I bit my head and brushed about 400 questions in less than 2 months.

    Of course the most important thing is to persevere and don't give up. all will be good. There is another village in the dark. There will always be an offer, don't underestimate yourself. Persistence will lead to victory. Duck! ! !

   Finally, I will share 100% of the interview information with everyone for free, and help everyone get a promotion and a salary increase!

Information collection: Click here to get it for free, password: CSDN

 

Love programming, love to share, I heard that those who like + follow have joined the big factory! ! !

 

 

Guess you like

Origin blog.csdn.net/qq_43080036/article/details/109226628