2021 latest java interview questions finishing

Algorithmic questions:

1. A ball falls freely from a height of 100 meters, and bounces back to half of its original height each time it hits the ground. When it falls again, how many meters does it travel when it hits the ground for the 10th time? How high is the 10th rebound?

 

Procedural questions:

1. Find the minimum value in the array

2. Sort the elements in an array

3. Invert a doubly linked list

 

Interview questions:

1. Talk about the framework and job responsibilities used in the projects you have done

2. Talk about your understanding of springboot

3. Talk about your understanding of springcloud

4. Talk about the sentinel mechanism of redis

5. Tell me what an avalanche is

6. What are the implementation classes of Map?

7. The underlying principle of HashMap

8. Talk about your understanding of zookeeper

9. What are the distributed locks?

10. A variable of type int, for example, int a =12345, how do you get the single digit number

11. How to convert arrays and collections

12. How to avoid sql injection

13. How to avoid xss attacks

14. What are the advantages of the ssm framework

15. What are the core configuration files in ssm?

16. Do you understand Oracle's stored procedures?

17. How to synchronize data in redis

18. Tell me about a project you are most familiar with, how the database design of the module you did was designed

19. Talk about the difference between springboot and springcloud

20, talk about commonly used java tool classes

21. How to write paging for mysql and oracle

22, mybatis timing configuration

23. The difference between singleton mode and multiple mode

24. How to configure multiple instances mode

25. Do you know the java virtual machine, talk about it briefly

26, the way to create multiple threads

27. What are the ways to create objects in java

28. Zookeeper is down, can dubbo call the service?

29. What are the optimization methods for the database?

30. How to call between systems

31, how to understand spring

32, Linux commonly used commands

33. The traversal method of map and set

34. How to remove heavy set

35. How to use redis cache

36, the use of dynamic sql

 

Other interview questions:

1. What is the serialization of Java? Are there any serialization methods you know?

2. New a HashMap, add Long, Boolean data to it, mainly the data whether the mobile phone number is available, add one, add two, and add up to 1000w. In this process

How does the data structure of HashMap change? After adding 1000w data, how much memory does HashMap take up?

3. For 1000w or even 100 million mobile phone numbers to filter duplicates, which methods/data types can be used? What are the characteristics of each?

4. How does ConcurrentHashMap achieve high concurrent thread safety?

5. What is the memory semantics of the Synchronized keyword in Java?

6. What is the memory semantics of the Volatile keyword in Java?

7. What are atomic operations in Java?

8. What CAS operation in Java, and the realization principle of AtomicLong?

9. What are reentrant locks, optimistic locks, pessimistic locks, fair locks, unfair locks, exclusive locks, and shared locks?

10. Talk about the principle of exclusive lock ReentrantLock? Talk about the principle of ReentrantReadWriteLock?

11. ThreadLocal is used as a variable thread isolation method, how is it done internally?

12. How is the internal implementation of CyclicBarrier different from CountDownLatch?

13. There are 3 threads, thread A and thread B are executed in parallel, thread C needs to be executed after A and B are executed. How can it be achieved?

14. Now there are two threads operating on an integer I at the same time, doing self-increment operation, how to realize the thread safety of I?

15. How do multiple threads transfer data in Java? LinkedBlockingQueue principle

16. What is the difference between CountDownLatch and thread join method?

17. What is java instruction reordering?

18. How does Spring implement AOP? Take things as examples

19. What design patterns does Spring have?

20. How is circular dependency solved in Spring? For example, A depends on B, B depends on A

21. Understanding of the realization principle of Java interface proxy mode? How to implement dynamic proxy using Java launch? The designated enhancement of the Java interface proxy mode?

22. Talk about the implementation of enhanced dynamic proxy for Cglib class? What is the difference between Jdk dynamic proxy?

23. What is the difference between BeanFactory and FactoryBean?

24. What is the difference between BeanFactory and ApplicationContext?

25. What storage engines does Mysql have? what's the difference?

26. What is the difference between Float and Decimal storage amount? What is the difference between Datetime and Timestamp storage time? What is the difference between Char, Varchar and Varbinary storage characters?

27. Understanding of Explain parameters and important parameters?

28. What is the relationship between index and lock?

29. How to optimize B+Tree? What principles does the index follow?

30. Understanding of Innodb transaction?

31. Mysql table design and specification?

32. Index optimization? Talk about the principles of Sql optimization?

33. What are the Redis data structures?

34. Redis cache penetration, cache avalanche?

35. How to use Redis to implement distributed locks?

36. Tell me about the tcp protocol (connection process, slow start, sliding window, seven-layer model)?

37. Webservice protocol (wsdl/soap format, the difference with rest protocol)?

38. The basic process of Socket interaction?

39, deep copy and shallow copy

40. Describe the principle and mechanism of JVM loading Class files?

41. What is the structure of the Java heap?

42. When can an object be garbage collected in Java?

43. Briefly describe Minor GC and Major GC?

44. Briefly describe the Java garbage collection mechanism?

45. Code writing: quick sort

46. ​​Code writing: bubble sort

47. How does ConcurrentLinkedQueue use CAS non-blocking algorithm to ensure the thread safety of multi-threaded enqueue and dequeue operations?

48. What is the difference between CyclicBarrier's internal implementation and CountDownLatch?

49. What is the internal implementation of Semaphore?

50. How does the concurrent component CopyOnWriteArrayList implement a concurrent safe list through copy-on-write?

51. Synchronous and asynchronous? Blocking and non-blocking?

52. How does ThreadLocalRandom use the principle of TreadLocal to solve the limitations of Random?

53. Have you used MQ? In what scenarios is it used? What problem does it solve? What is the problem?

54. How to design the topic and partion of Kafka? How does Kafka ensure that data is not lost?

55. DB and MQ are two kinds of media. What methods can ensure that both DB and MQ data are written successfully? How did you do it?

56. What is ultimate consistency? How to achieve final consistency?

57. How are Redis distributed locks used? What are the advantages and disadvantages?

58. Tell me about the whole process of RPC call. What happened and what did each module do?

59. Under what circumstances will Innodb of Mysql deadlock? What is the deadlock scenario you encountered? How is the deadlock resolved?

60. Tell me about the characteristics and potential problems of database transactions?

61. What is the isolation level of mysql? How does Innodb solve phantom reading?

62. Talk about Innodb row lock?

63. What is deadlock and monitoring? Under what circumstances will deadlock occur? Example sql

64. What are self-growth and locks, lock algorithms, lock issues, and lock upgrades?

65. Several methods of Redis persistence, what are the advantages and disadvantages, and how are they implemented?

66. Redis cache invalidation strategy?

67. Redis's data elimination strategy?

68. Redis queue application scenario?

69. Distributed cache and consistent hash?

70. Talk about the Netty threading model, what is zero copy?

71. The underlying implementation principle and mechanism of Dubbo?

72. Describe the detailed process of a service from being published to being consumed?

73. How to deal with the failure of Dubbo's service request? How to fuse?

74. Understanding of distributed transactions?

75. How to achieve a unique serial number in a distributed cluster?

76. How to ensure message consistency?

77. How does TCP ensure reliable data transmission?

78. Code writing: merge two ordered arrays.

79. Code writing: front, middle, and subsequent traversal of the binary tree.

80. Code writing: Use a stack to implement a queue.

81. Code writing: print the inverted triangle.

 

At last


If you want to learn Java, I will share some Java learning materials with you. You don’t have to waste time searching everywhere. I have compiled all the materials from Java entry to proficiency. These materials are all made by me. The latest Java learning routes compiled in the year, Java written test questions, Java interview questions, Java zero-based to proficient video courses, Java development tools, Java practice projects, Java e-books, Java study notes, PDF document tutorials, Java programmers’ experience, Java job resume templates, etc. These materials will definitely help you learn Java in the future. It is a must for every Java beginner. Please enter my Java technology qq exchange group to download by yourself . All the materials are in the group. In the file, you need to communicate and learn more with you when you go in.

Guess you like

Origin blog.csdn.net/deqing271/article/details/115216090