Of course, you must memorize Java stereotyped essays in the interview. It is difficult to pass the interview without memorizing
java basics
Java basic interview questions
- Features of Java
- Difference between Java and C++
- The relationship between JDK/JRE/JVM
- Is the Java program compiled and executed or interpreted?
- What is the difference between object-oriented and process-oriented?
- What are the characteristics of object-oriented?
- Are arrays objects?
- What are the basic data types of Java?
- Why can't the amount be expressed in floating point?
- What are pass by value and pass by reference?
- Know Java's wrapper types? Why do you need a wrapper class?
- Automatic boxing and unboxing
- Why is String immutable?
- Why does JDK9 change the underlying implementation of String from char[] to byte[]?
- Difference between String, StringBuffer and StringBuilder
- What is StringJoiner?
- What are the commonly used methods of the String class?
- How many objects will new String() create?
- What is a string constant pool?
- What is the maximum length of String?
- What are the common methods of Object?
- Talk about deep copy and shallow copy?
- If the hashCode() of two objects is the same, is equals() necessarily true?
- How many ways does Java create objects?
- Talk about the order of class instantiation
- What is the difference between equals and ==?
- What are the common keywords?
- The difference between final, finally, finalize
- The role of the final keyword?
- What is the difference between method overloading and overriding?
- What is the difference between an interface and an abstract class?
- What are the common exceptions?
- The difference between Error and Exception?
- What is the difference between a runtime exception and a non-runtime exception (checked)?
- The difference between throw and throws?
- Tell NIO Clearly Through Stories
- What is the difference between BIO/NIO/AIO?
- What is a daemon thread?
- Does Java support multiple inheritance?
- How to achieve object cloning?
- The difference between synchronous and asynchronous?
- What is the difference between blocking and non-blocking?
- What are the new features of Java8?
- Serialization and deserialization
- When do you need to use serialization and deserialization?
- Why implement the Serializable interface for serialization and deserialization?
- After implementing the Serializable interface, why should the value of the specified serialVersionUID be displayed?
- Why are static properties not serialized?
- What is the role of the transient keyword?
- What is reflection?
- What are the application scenarios of reflection?
- Tell me what is generic?
- How to stop a running thread?
- What is cross domain?
- How to solve the cross-domain problem?
Java collection interview questions
- What are the common collections?
- The difference between List, Set and Map
- ArrayList understand?
- The expansion mechanism of ArrayList?
- How to remove an element while traversing ArrayList?
- The difference between Arraylist and Vector
- The difference between Arraylist and LinkedList
- HashMap
- What are the solutions to hash conflicts? Which one is used for HashMap?
- The hash algorithm used?
- Why is it recommended to set the capacity of HashMap?
- Expansion process?
- put method process?
- What are the characteristics of red-black tree?
- When solving hash conflicts, why choose to use linked list first, and then switch to red-black tree?
- Why is the length of HashMap a power of 2?
- What is the default load factor of HashMap? Why 0.75?
- What is generally used as the key of HashMap?
- Why is HashMap not thread-safe?
- The difference between HashMap and HashTable?
- The underlying principle of LinkedHashMap?
- Tell me about TreeMap?
- The underlying principle of HashSet?
- Difference between HashSet, LinkedHashSet and TreeSet?
- What is fail fast?
- What is failsafe?
- Tell me about ArrayDeque?
- Which collection classes are thread safe? Which ones are not safe?
- What is iterator Iterator?
- What is the difference between Iterator and ListIterator?
- How to make a collection cannot be modified?
- concurrent container
- ConcurrentHashMap
- put execution process?
- How to expand?
- The difference between ConcurrentHashMap and Hashtable?
- CopyOnWrite
- CopyOnWriteArrayList
- ConcurrentLinkedQueue
- blocking queue
- Blocking queue provided by JDK
- principle
This article has been included in the Github warehouse, which includes computer foundation, Java foundation, multithreading, JVM, database, Redis, Spring, Mybatis, SpringMVC, SpringBoot, distributed, microservices, design patterns, architecture, school recruitment and social recruitment sharing, etc. Core knowledge points, welcome to star~
Github address: https://github.com/Tyson0314/Java-learning
Java Concurrency Interview Questions
- Why do you usually use the thread pool to create threads, is it not good to directly create a new thread?
- Why use a thread pool?
- Thread pool execution principle?
- What are the thread pool parameters?
- How to set the thread pool size?
- What are the types of thread pools? Applicable scene?
- process thread
- thread life cycle
- Talk about thread interruption?
- What are the ways to create threads?
- What is thread deadlock?
- How does thread deadlock occur? How to avoid it?
- The difference between thread run and start?
- What methods do threads have?
- The underlying principle of volatile
- What are the uses of synchronized?
- What are the functions of synchronized?
- What is the underlying implementation principle of synchronized?
- What is the difference between volatile and synchronized?
- The difference between ReentrantLock and synchronized
- The similarities and differences between wait() and sleep()?
- What is the difference between Runnable and Callable?
- How to control the order of thread execution?
- What is a daemon thread?
- Inter-thread communication method
- ThreadLocal
- Principle of ThreadLocal
- Cause of ThreadLocal memory leak?
- What are the usage scenarios of ThreadLocal?
- Principle of AQS
- How does ReentrantLock achieve reentrancy?
- Classification of locks
- Fair locks and unfair locks
- Shared and exclusive locks
- Pessimistic lock and optimistic lock
- What's wrong with optimistic locking?
- What is CAS?
- Problems with CAS?
- concurrency tools
- CountDownLatch
- CyclicBarrier
- The difference between CyclicBarrier and CountDownLatch
- Semaphore
- atomic class
- Basic type atomic class
- array type atomic class
- reference type atomic class
- Why use the Executor thread pool framework?
- How to stop a running thread?
- What is a Daemon thread?
- What is the difference between SynchronizedMap and ConcurrentHashMap?
- How to judge whether the task of the thread pool has been executed?
JVM interview questions
- What are JVMs?
- Tell me about the JVM memory structure?
- How to locate Java objects
- Talk about the difference between the stack?
- Under what circumstances will stack overflow occur?
- class file structure
- What is class loading? The process of class loading?
- What is the Parental Delegation Model?
- Why do you need a parent delegation model?
- What is a class loader and what are the class loaders?
- Class instantiation order?
- How to judge whether an object is alive?
- What objects can be used as GC Roots?
- Under what circumstances will the class be unloaded?
- What are strong references, soft references, weak references, and phantom references, and what is the difference?
- What is GC? Why GC?
- What is the difference between Minor GC and Full GC?
- memory allocation strategy?
- What triggers Full GC?
- What are the garbage collection algorithms?
- What garbage collectors are there?
- What are the commonly used JVM tuning commands?
- Do you understand the object header?
- How many bytes does Object o = new Object() take?
- main method execution process
- object creation process
- How to troubleshoot OOM problems?
- What is memory overflow and memory leak?
MySQL interview questions
- Four characteristics of business?
- Three paradigms of database
- What are the transaction isolation levels?
- What isolation level is generally used for production environment databases?
- The relationship between encoding and character set
- The difference between utf8 and utf8mb4
- What is an index?
- Advantages and disadvantages of indexing?
- The role of the index?
- Under what circumstances do you need to build an index?
- Under what circumstances is the index not built?
- indexed data structure
- What is the difference between Hash index and B+ tree index?
- Why is B+ tree more suitable for implementing database index than B tree?
- What are the categories of indexes?
- What is the leftmost matching principle?
- What is a clustered index?
- What is a covering index?
- Index design principles?
- When will the index become invalid?
- What is a prefix index?
- index pushdown
- What are the common storage engines?
- What is the difference between MyISAM and InnoDB?
- What locks does MySQL have?
- MVCC implementation principle?
- Snapshot read and current read
- shared and exclusive locks
- bin log/redo log/undo log
- What is the difference between bin log and redo log?
- Tell me about the MySQL architecture?
- Sub-library and sub-table
- What is a partition table?
- partition table type
- partition problem?
- Query statement execution flow?
- Update statement execution process?
- The difference between exist and in?
- Difference between int() and char() in MySQL?
- What is the difference between truncate, delete and drop?
- What is the difference between having and where?
- What is MySQL master-slave synchronization?
- Why do master-slave synchronization?
- What are optimistic locks and pessimistic locks?
- Have you used processlist?
- Is MySQL query limit 1000,10 as fast as limit 10?
- How to optimize deep paging?
- How much data can a B+ tree with a height of 3 store?
- How big is a MySQL single table for sub-database sub-table?
- How to optimize the slow query of large tables?
- Talk about the difference between count(), count() and count()
- What is the difference between DATETIME and TIMESTAMP in MySQL?
- Tell me why it is not recommended to use foreign keys?
- What are the benefits of using an auto-increment primary key?
- Where is the auto-increment primary key stored?
- Must auto-increment primary keys be consecutive?
- Why can't InnoDB's self-increment value be recycled?
- How to synchronize MySQL data to Redis cache?
Redis interview questions
- What is Redis?
- Redis advantages and disadvantages?
- Why is Redis so fast?
- Tell me about the threading model of Redis?
- What are the application scenarios of Redis?
- The difference between Memcached and Redis?
- Why use Redis instead of map/guava for caching?
- What are the Redis data types?
- Similarities and differences between SortedSet and List?
- What happens when Redis runs out of memory?
- How does Redis do memory optimization?
- Problems with the keys command?
- Redis transaction
- Does Redis transaction support isolation?
- Does Redis transaction guarantee atomicity and support rollback?
- Persistence mechanism
- How to choose RDB and AOF?
- What are the deployment options for Redis?
- master-slave architecture
- Sentinel
- Redis cluster
- Deletion strategy for expired keys?
- What are the memory elimination strategies?
- How to ensure the data consistency between the cache and the database when double-writing?
- cache penetration
- cache avalanche
- cache breakdown
- Cache Warming
- cache downgrade
- How does Redis implement message queue?
- How Redis implements a delayed queue
- The role of the pipeline?
- LUA script
- What is RedLock?
- How to deal with Redis big key?
- Redis common performance problems and solutions?
- Tell me why Redis has expired and why the memory is not released?
- Redis suddenly slows down, what are the reasons?
- Why is the maximum slot number of Redis cluster 16384?
RabbitMQ interview questions
- What is RabbitMQ?
- Components of RabbitMQ
- When to use MQ
- Advantages and disadvantages of RabbitMQ
- What are the important roles of RabbitMQ?
- Exchange type
- message lost
- Producer Confirmation Mechanism
- route unreachable message
- Consumer manual message confirmation
- Persistence
- mirror queue
- How to deal with repeated message consumption?
- How to limit the flow on the consumer side?
- What is a dead letter queue?
- Talk about pull mode
- How to set the expiration time of the message?
Kafka interview questions
- What are the characteristics of Kafka?
- Please briefly describe in which scenarios you would choose Kafka?
- Do you know Kafka's design architecture?
- Purpose of Kafka partitions?
- Do you know how Kafka achieves the orderliness of messages?
- The execution process of Kafka Producer?
- Tell me about the threading model when you use Kafka Consumer to consume messages. Why is it designed this way?
- Please talk about the principle of Kafka data consistency
- What are ISRs, OSRs, and ARs?
- What do LEO, HW, LSO, LW, etc. represent
- How many types of data transfer transactions are there?
- Can Kafka consumers consume messages from specified partitions?
- Does Kafka message use Pull mode or Push mode?
- Kafka efficient file storage design features
- How to Place Partitions in Different Brokers When Kafka Creates a Topic
- Talk about the rebalancing of Kafka
- How does Kafka achieve high throughput?
- Disadvantages of Kafka?
- The difference between old and new Kafka consumers
- Can the number of Kafka partitions be increased or decreased? Why?
Spring interview questions
- Advantages of Spring
- What design patterns does Spring use?
- What is AOP?
- What are the implementations of AOP?
- Implementation principle of Spring AOP
- What is the difference between JDK dynamic proxy and CGLIB dynamic proxy?
- Spring AOP related terms
- What are the types of Spring advice?
- What are IOCs?
- Benefits of IOCs?
- What is Dependency Injection?
- IOC container initialization process?
- Bean life cycle
- The difference between BeanFactory and FactoryBean?
- What is the difference between BeanFactory and ApplicationContext?
- What are the ways to inject beans into containers?
- Bean scope
- What are the ways of Spring automatic assembly?
- Difference between @Autowired and @Resource?
- What does the @Qualifier annotation do
- What is the difference between @Bean and @Component?
- The difference between @Component, @Controller, @Repositor and @Service?
- What are the implementation methods of Spring transaction?
- What are the transaction propagation behaviors?
- Under what circumstances will Spring transactions fail?
- How does Spring solve the problem of circular dependency?
- Spring boot process
- Does Spring's singleton bean have concurrency safety issues?
- How does Spring Bean ensure concurrency safety?
- The principle of @Async annotation
SpringMVC interview questions
- Talk about your understanding of SpringMVC
- What is the MVC pattern?
- What are the advantages of SpringMVC?
- The difference between Spring MVC and Struts
- How Spring MVC works
- The main components of Spring MVC?
- What are the common annotations of Spring MVC?
- What is the @Controller annotation for?
- What is the use of @RequestMapping annotation?
- What is the difference between @RestController and @Controller?
- What is the difference between @RequestMapping and @GetMapping annotations?
- The difference between @RequestParam and @PathVariable annotations
- The difference between @RequestBody and @RequestParam
- Exception handling in Spring MVC
- What object does SpringMVC use to transfer data from the background to the foreground?
- Is the Controller of SpringMvc a singleton mode?
- Introduce the Spring MVC interceptor?
- How does SpringMvc configure interceptors?
- What is the difference between Spring MVC's interceptor and Filter filter?
- What is REST?
- What are the advantages of using REST?
Operating System Interview Questions
- Four characteristics of an operating system?
- process thread
- Concurrency and Parallelism
- Advantages of multithreading over single threading
- What is a coroutine?
- What is the difference between threads and coroutines?
- process communication
- What is deadlock?
- How does the deadlock occur? How to avoid it?
- What are the process scheduling strategies?
- What are the states of a process?
- How to understand the memory fragmentation in the operating system?
- Virtual Memory
- What is pagination?
- What is segmentation?
- What is the difference between paging and segmentation?
- Page Replacement Algorithm
- user mode and kernel mode
- Why are there these two states?
- when to convert
- What is a buffer overflow? What's the harm?
- I/O multiplexing
computer network interview questions
- Network Hierarchy
- three handshake
- Is it okay to shake hands twice?
- waved four times
- Why wait for 2MSL for the fourth wave?
- Why four waves?
- What are the characteristics of TCP?
- Talk about what fields are in the header of the TCP message, and what are their functions?
- The difference between TCP and UDP?
- What are the common application layer protocols corresponding to TCP and UDP?
- TCP sticky packet and unpacking
- Talk about how TCP ensures reliability?
- Talk about the sliding window mechanism of TCP
- Tell me about congestion control in detail?
- What are the characteristics of the HTTP protocol?
- HTTP message format
- What are the HTTP status codes?
- What requests does the HTTP protocol include?
- What is the difference between HTTP status code 301 and 302?
- Difference between URI and URL
- What is the difference between POST and GET?
- How to understand that the HTTP protocol is stateless
- HTTP long connection and short connection?
- How does HTTP implement long connections?
- When will the HTTP persistent connection time out?
- What is the difference between HTTP1.1 and HTTP2.0?
- What is the difference between HTTPS and HTTP?
- What is a digital certificate?
- Principle of HTTPS
- DNS resolution process?
- Enter the URL in the browser to return to the page process?
- What are cookies and sessions?
- The difference between cookie and session?
- What are symmetric and asymmetric encryption?
- Talk about the difference between WebSocket and socket
- The working process of the ARP protocol?
- Functions of the ICMP protocol
- What are DoS, DDoS, DRDoS attacks?
- What is a CSRF attack and how to avoid it
- What is an XSS attack?
- How to solve the XSS attack problem?
- Anti-leech
- Talk about the principle of ping
Mybatis interview questions
- What is Mybatis?
- What is ORM
- The difference between Mybatis and Hibernate?
- The advantages and disadvantages of the MyBatis framework and its applicable occasions
- How Mybatis works
- What Executors does Mybatis have? What is the difference between them?
- How many implementations are there for interface binding in MyBatis?
- How does Mybatis paginate?
- What is the rationale behind the pagination plugin?
- Briefly describe the operating principle of Mybatis plug-ins
- .How to write a plugin?
- . Does Mybatis support lazy loading?
- What is the rationale behind lazy loading?
- What is the difference between #{} and ${}?
- Precompilation of Mybatis
SpringBoot interview questions
- Advantages of Spring Boot
- What exactly is the starter in SpringBoot?
- What are the ways to run SpringBoot?
- What are the starters commonly used by SpringBoot?
- Which is the core annotation of Spring Boot?
- Principle of automatic configuration
- Implement automatic configuration
- The principle of @Value annotation
- Does Spring Boot need a standalone container to run?
- What logging frameworks does Spring Boot support?
- What are the advantages of YAML configuration?
- What are Spring Profiles?
- How to manage SpringBoot multi-data source transactions
- What is the use of spring-boot-starter-parent?
- What is the difference between the jar made by Spring Boot and the ordinary jar?
- The idea of SpringBoot multi-data source splitting
Microservices Interview Questions
- What are microservices?
- The difference between distributed and microservices
- How are services divided?
- Microservice Design Principles
- How do microservices communicate with each other?
- fuse
- service gateway
- What is a gateway?
- What is API Gateway
- Unified management of service configuration
- Service Link Tracking
- Microservice Framework
- Spring Cloud basics
Finally, I would like to share with you a Github repository, which has more than 300 classic computer book PDFs compiled by Dabin, including C language, C++, Java, Python, front-end, database, operating system, computer network, data structure and algorithm, machine learning , programming life , etc., you can star it, next time you look for a book directly search on it, the warehouse is continuously updated~
If you can't access Github, you can access the code cloud address.