116, every way is the essence (including a collection of interviews from large companies)-directly hit Ali P7Java interview questions,

Interview questions

  • 1. junit usage, the execution order of before, beforeClass, after, afterClass
  • 2. Distributed lock
  • 3. The request forwarding algorithm of nginx, how to configure forwarding based on weight
  • 4. What are the problems with implementing redis with hashmap (deadlock, dead loop, ConcurrentH ashmap can be used)
  • 5. The state of the thread, the way the thread is blocked
  • 6. The difference between sleep and wait
  • 7. The underlying implementation of hashmap
  • 8. Ten thousand people grab 100 red envelopes, how to achieve it (without queue), how to ensure that 2 people cannot grab the same red envelope, and distributed locks are available
  • 9. Java memory model, garbage collection mechanism, unreachable algorithm
  • 10. Two Integer reference objects are passed to a swap method to exchange references within the method. After returning, will the values ​​of the two references be found to change?
  • 11. The underlying implementation of aop, how dynamic is the dynamic proxy? If there are 100 objects, how to dynamically proxy these 100 objects
  • 12. Have you ever used maven install. maven test. git (make install is to install the local jar package)
  • 13. Various configurations of tomcat, how to configure docBase
  • 14. Several ways of spring bean configuration
  • 15. Web.xml configuration
  • 16. Listener for spring.
  • 17. The implementation mechanism of zookeeper, there is a cache, how to store the registration service
  • 18. Will IO block? Is readLine blocking
  • 19. Have you ever used spring thread pool or java thread pool?
  • 20. String formatting method (20, 21 these two questions are too low-level)
  • 21. Time formatting method
  • 22. What is the timer made of?
  • 23. How the thread exits and ends
  • 24. What locks does java have? Optimistic lock, pessimistic lock, synchronized, reentrant lock, read-write lock, have you used reentrantlock? The difference between reentrantlock and synmchronized
  • 25. Usage scenarios of ThreadLocal
  • 26. Java's memory model, garbage collection mechanism
  • 27. Why do thread execution call start instead of run directly (direct run is no different from ordinary methods, start first, run will run as a thread method)
  • 28. The realization mechanism of qmq messages (qmq is a message queue encapsulated by Qunar.com)
  • 29. The third way to traverse the hashmap
  • 30. Some commands of jvm
  • 31. The difference between memcache and redis
  • 32. Where is the row-level lock of mysql added?
  • 33. How is the lock of ConcurrentHashmap added? Is the more segments the better
  • 34. The difference between myisam and innodb (innodb is a row-level lock, myisam is a table-level lock)
  • 35. mysql other performance optimization methods
  • 36. Where to look at the linux system log
  • 37. How to view network process
  • 38. Count the number of bit 1 in the binary representation of an integer
  • 39. jvm memory model, java memory model
  • 40. How to dump all the data in java memory
  • 41. How to manually trigger full garbage collection, how to trigger garbage collection immediately
  • 42. What will happen to hashmap if there is only one write and the other read all
  • 43. git rebase
  • 44. The difference between mongodb and hbase
  • 45. How to solve concurrency problems
  • 46. ​​Purpose of volatile
  • 47. java thread pool (it seems that there is a problem with my understanding before)
  • 48. mysql binlog
  • 49. Proxy Mode
  • 50. How does mysql implement transactions
  • 51. When is read and write separation mandatory to read the main library, which method is used to determine which slave library is read, and what method is used to synchronize mysql from the library
  • 52. mysql storage engine
  • 53. The default isolation level of mysql, other isolation levels
  • 54. Reverse a linked list (use three pointers, but only send one at a time)
  • 55. The realization principle of spring Aop, talk about it in detail
  • 56. When will memory leak and what are the exceptions of memory leak
  • 57. Have you used Autowire annotation
  • 58. Spring's way of bean injection
  • 59. The execution order of various conditions of sql statement, such as select, where, order by, grou p by 60. select xx from xx where xx and xx order by xx limit xx; how to optimize this (see explain)
  • 61. Four elements to write code
  • 62. Count the 100 ips with the most ips in 100G ip files. 63. Zookeeper things, nodes, and service providers how to inform consumers
  • 64. How do 5 servers elect a leader (election algorithm)
  • 65. The difference between adapter and proxy mode
  • 66. Read-write lock
  • 67. static lock
  • 68. Transaction Isolation Level
  • 69. Facade mode, class diagram (appearance mode)
  • 70. How does mybatis map the table structure
  • 71. Binary Tree Traversal
  • 72. Master-slave replication
  • 73. mysql engine difference
  • 74. Which area is the static inner class loaded into? Method area
  • 75. Where is the class file loaded after compilation
  • 76. How does the overall response time of web http requests become longer and the number of requests processed decreases? How to deal with it? Using queues, when you can't handle so many http requests, put the requests in the queue and process them slowly. How does the web implement queues?
  • 77. Thread-safe singleton mode
  • 78. Quicksort performance considerations
  • 79. volatile keyword usage
  • 80. Find the size of the table, or what storage engine is available for data statistics
  • 81. What engine can read more and write less
  • 82. What engine should be used if you want to count multiple tables
  • 83. How does concurrenhashmap ask for size to be locked, and what to do if this section has changed after just asking for a section
  • 84. 1000 apples are placed in 10 baskets, how to put them so that I can get all possible numbers 85. How is reentrant read-write lock realized?
  • 86. Have you ever used NIO?
  • 87. Have you ever used java's concurrent package?
  • 88. sting s=new string("abc") which objects are newly created on the stack
  • 89. The area allocation of java virtual machine, what are stored in each area
  • 90. Distributed Transaction (JTA)
  • 91. Pay attention to the problems when using threadlocal (ThreadLocal and Synchronized are both used to solve multi-threaded concurrent access. However, ThreadLocal and synchronized are essentially different. Synchronized is the use of a lock mechanism, so that variables or code blocks can only be accessed at a certain time One thread access. And ThreadLocal provides a copy of the variable for each thread, so that each thread does not access the same object at a certain time, thus isolating the data sharing of multiple threads. However, Synchronized On the contrary, it is used to obtain data sharing when communicating between multiple threads)
  • 92. What are the containers in java (collection, tomcat is also a container)
  • 93. Binary Search Algorithm
  • 94. The advantages of myisam, and the difference with innodb
  • 95. What types of redis can store
  • 96. http protocol format, the difference between get and post
  • 97. Corresponding wait and notify in reentrant locks
  • 98. Can redis swap the memory space into the disk (this should be possible, but the interviewer told me that it is not possible)
  • 99. How to deal with two kinds of thread pool based on cache and based on fixed length in java thread pool when there are too many requests? The queue for fixed-length events, what if the queue is also full? Swap into disk? What about the cache-based thread pool solution?
  • 100. What kind of lock is synchronized on the method?
  • 101. The difference between lock and trylock in reentrant locks
  • 102. Will innodb fetter the reading of a row of data? No shackles, the actual reading is the copy
  • 103. Is redis cache distributed? Is the data stored on different servers duplicated? What about guava cache? Is it redundant? Different machines store different data
  • 104. Use awk to count top10 in an ip file
  • 105. When doing statistics on the table, you can directly look at the schema info information, that is, view the system information of the table
  • 106. The current version of mysql
  • 107. How did the experienced people in the company help? (Generally, the boss will ask about this)
  • 108. What are the advantages of oneself over the same freshman
  • 109. What help does my good summary habit bring to my future work? Give examples as proof
  • 110. Atomic classes, thread-safe objects, exception handling
  • 111.4 billion int numbers, how to find the repeated number (using the hash method, create a hash array of 2 to the 32th power of bits, every time you take an int number, you can find it in the h The position in the ash array, and then set the bit to 1 to indicate that it already exists)
  • 11.2.4 billion URLs, find out the duplicates among them (considering insufficient memory, allocate the URLs to 1000 files through the hash algorithm, the different files will definitely not be duplicated, and then find the duplicates separately) There is 1 Ten thousand arrays, each array has 1000 integers, and each array is in descending order. Find the largest N number from them, N<1000
  • 113. The underlying implementation of LinkedHashmap
  • 114. The purpose of the version number of the class during class serialization. If a version number is not specified, how does the system handle it? What happens if you add a field?
  • 115. The difference between Override and Overload, and in what scenarios
  • 116. How Java's reflection is implemented

to sum up:

Don’t think that these interview questions are useless. You will regret it when you are torn by your hands during the interview. Interview Questions has compiled a collection of more than 1,000 interview questions (including the answers to the above interview questions). If you want to live a life, You have to work hard!

 

There are too many documents for interview questions, all articles are kept simple, please add if you need

Directly hit Ali P7Java interview questions in May, 116 questions, every way is the essence (including a collection of interviews from big factories)

 

Directly hit Ali P7Java interview questions in May, 116 questions, every way is the essence (including a collection of interviews from big factories)

 

Including JVM, Mysql, Concurrency, Spring, Mybatis, Redis, MQ, Zookeeper, Netty, Dubbo, Spring Boot, Spring Cloud, data structure and algorithm, design pattern, network and operating system and other related technical fields interview questions and detailed explanations

Guess you like

Origin blog.csdn.net/yuandengta/article/details/109243245