【JAVA Technology】September Ali agency recruiting and sharing the same journey

 

The interview is just a test of personal skills and adaptability. Only when one problem is solved can you have the opportunity to meet the next problem and encourage each other.

Alibaba news agency recruiting JAVA engineers

 

1. The difference between ArrayList, LinkedList and Vector

(1) The baiArrayList, Vector, and LinkedList classes are all in the java.util package and are all scalable arrays.

(2) The bottom layers of ArrayList and Vector are implemented by arrays, so indexing data is fast, and deleting and inserting data is slow.

(3) ArrayList adopts asynchronous method, has good performance, and belongs to non-thread-safe operation category. Vector adopts a synchronous method, has low performance, and belongs to a thread-safe operation category.

(4) The bottom layer of LinkedList is a linked list implementation. Therefore, the index is slow, and the deletion and insertion are fast, which is a non-thread-safe operation category.

 

2. The difference between HashMap and HashTable, the principle of Hashmap implementation

 

3. The difference between String and StringBuffer

(1)String:

     • Is the object not a primitive type.

     • It is an immutable object, once it is created, its value cannot be modified.

     • To modify an existing String object is to re-create a new object, and then save the new value.

     • String is a final class, which cannot be inherited.

 

(2)StringBuffer:

    • Is a mutable object, when it is modified, it will not re-create the object like String.

    • It can only be established through the constructor, StringBuffer subffer=new StringBuffer();

    • After the object is created, memory space will be allocated in memory, and a null will be initially saved, and subffer.append("hello word") is assigned to it through its append method;

 

(3) The efficiency of StringBuffer in the string concatenation operation is obviously higher than that of String;

The String object is an immutable object. Every time you manipulate the String, a new object will be created to save the new value.

After the StringBuffer object is instantiated, only operate on this object.

 

4. The concept of gc, if A and B objects are cyclically referenced, can they be GC?

5. How is the memory overflow in Java caused? Do you know the memory leak? the reason?

6. String s = "123"; this statement has several objects generated

7. What is the difference between Exception and RuntimeException?

8. Do you know the java exception system? What is the difference between error and exception?

9. The difference between FileInputStream and FileReader.

 

FileInputStream is a byte stream, and FileReader is a character stream. When using a byte stream to read Chinese, there may be garbled characters, while using a character stream will not appear garbled, and the speed of reading with a character stream is faster than that of a byte stream. ;

 

1 0. Can a Chinese character be stored in a char variable? Why?

11. Do List, Set and Map all inherit from Collection interface? Their difference

12. Application scenarios in java reflection

13. Have annotations been used? What is the role?

14. What is the difference between java compile time and runtime?

15. Do you know the socket? What is the difference between Websocket and Websocket?

 


[Tong Cheng Yilong] One or two years of experience in Java for one year (have got an offer)

 

Directly above the content:

1. How to solve the request response broken link? After requesting to place an order, the network is disconnected, what should we do if the result of the order is not received by our request?
2. How to deal with repeated ticket issuance? How to deal with repeated orders?
3. How is the distributed lock implemented? What is the difference between redis distributed lock and zk distributed lock?
4. If the redis distributed lock is implemented, the setnx and expire commands, if the A thread operates the expire operation to the B thread, that is, the resource of another thread expires, how to avoid this?
5. What is the thread pool?
6. What is Future? what's the effect?
7. The number of cores in the thread pool is 20, and the maximum number of threads is 40. Tell me about the principle and logic of tasks entering the thread pool?
8. What kinds of thread pool blocking queues are there?
9. Do you understand the priority queue? The underlying implementation mechanism of priority queue?
10. What is the underlying blocking principle of LinkedBlockingQueue?
11. What is the difference between ReentrantLock and Synchronize?
12. What is the difference between ReentrantLock and read-write lock?
12. When is setState() in AQS called?
13. Tell me about the lock upgrade strategy?
14. What is the difference between HTTP and HTTPS?
15. What is the difference between symmetric encryption and asymmetric encryption? What kind of encryption is used for HTTPS?
16. According to your resume, you are familiar with JVM. What GC algorithms does JVM have?
17. Why are there From Survice and To Survice areas in the new generation?
18. When using the CMS garbage collector, there are more large objects and frequent GCs. How to solve this situation?
19. What is GCRoot? Which objects are GCRoot?
20. What index types are there in MySQL?
21. What is the difference between B+ tree and B tree?
22. Under what circumstances will the joint index fail?
23. What is the leftmost matching principle?
24. What kinds of isolation levels does MySQL have?
25. What is phantom reading? Can RR isolation level solve phantom reading? How does the RR isolation level solve phantom reading?
26. Do you know the gap lock? What is the function of the gap lock? How to solve the phantom reading?
27. Do you understand SpringAOP? What are the ways to achieve it?
28. Under what circumstances will CGLIB fail?
29. Why rewrite equals and hashcode at the same time?
 

Summary: In fact, the scene question is still the same, the answer is not good, and then the details between the knowledge points are not full. In the final analysis, the study is not good enough and not solid enough. There is still a big gap between myself and the big Internet companies. Next, I need to redouble my efforts to improve my level and fill in the details! ! !

 

Company: Tongcheng Yilong Chengdu

Position: Java development engineer Form: On-site interview (two sides) Duration: 50min

On the second side, the head of the on-site department interviewed at Tongcheng Yilong’s Chengdu office. The time was at 3 pm on Saturday. The company did not go to work on weekends and weekends. There were only interviewers, hr, and the front desk lady.

  1. What have you learned in the project? Or what difficulties have you encountered? How to solve it?
  2. How to ensure the stability of your call link? How to ensure the idempotence of the service call link request?
  3. How to ensure the idempotence of mq messages?
  4. How does mq guarantee sequential consumption?
  5. What are the ways to create a thread pool?
  6. What are the core parameters of the thread pool?
  7. What are the rejection strategies in the thread pool? What are the roles of each?
  8. What scenarios are used in Redis? Are there other scenarios besides caching?
  9. What are cache avalanches, penetrations, and breakdowns? How to solve?
  10. For the penetration solution, when the value pair corresponding to the key is written as null, an unknown error, and a later retry, how to solve the problem that when the database does have corresponding data, the cache data is not updated and the official user requests to access the cache?
  11. Did you just talk about Bloom filters? Tell me about the role of Bloom filter and the underlying principle?
  12. How to ensure the consistency of cache and database data?
  13. How to ensure the data consistency of the cache with the database with high real-time requirements?
  14. What are the commonly used data structures in Redis?
  15. What is the expansion mechanism of the Hash structure in Redis? Can you talk about the expansion mechanism of HashMap?
  16. What are the expiration mechanisms in Redis? How is the bottom layer implemented?
  17. What are the ways to deploy Redis?
  18. What is the implementation principle of Redis cluster and Setinel?
  19. How are database query optimization, slow SQL troubleshooting, and SQL optimization performed? Let me explain in detail
  20. What is the implementation mechanism of hash index in InnoDB?
  21. How does the performance of the unique index in MySQL compare to the JuYin index?
  22. In addition to commonly used sorting algorithms, what other algorithms do you use? Or know what algorithm?
  23. Do you understand the principle of jumping tables in Redis?
  24. Have you used a custom SpringBoot starter in the project? How is the starter implemented?
  25. Have you ever done or learned about large-scale data migration, similar to the operation of large-scale MySQL data migration to ES?
  26. Do you understand distributed transactions? What distributed transactions are used in your project? What are the advantages and disadvantages?
  27. What are the JVM memory models? Talk about the memory area of ​​the JVM?
  28. In Java, which packages are directly defined in external memory?
  29. What performance troubleshooting and performance optimization operations have you done online?
  30. Understand the happen-before principle in Java?
  31. In addition to using locks and volatile, how to ensure that the variables of one thread can be read in real time by the variables of another thread?

Summary: This interview was taped after the interviewer's consent, so that the interview can be reviewed later. Judging from the results of this review, the department boss did not ask much about the content on the resume. It is estimated that there is an interview record on one side, so most of the content on the other side was not asked again. From this interview, there are two different situations when you understand a knowledge point and express it in your own language! ! Then I lack too much in the breadth and depth of the Java technology stack. If you want to enter the Internet giant, there is still a long way to go. Make a wish offer.


Fortunately, I successfully got ashore and got an offer. After I joined the company, I still need to continue to work harder to get a better job! ! !

 

This is the end of this about article!

 

Pay attention, don't get lost! If this article is helpful to you, don't forget to like and support!

Guess you like

Origin blog.csdn.net/SQY0809/article/details/108620851