Recently received feedback from a fan! This fan has successfully joined Ali xiaobian is very envious ah!
Today I will share this 30W word Java interview notes with you. It happens that this information is also compiled by an Ali technical officer. This is not considered “shooting oneself in the foot” haha!
Java Interview Notes
The content of this information is very comprehensive and detailed, there are Java entry, foundation, string, advanced, project, virtual machine, database, micro services, algorithms, concurrency, threading, collection, Linux, interview questions and so on Java related technical points, I hope you can rely on this information to point to offer!Content Overview:
Detailed display of contents
Internet Java engineer interview questions
MyBatis interview questions
- What is Mybatis?
- The advantages of Mybaits
- Disadvantages of MyBatis framework
- MyBatis framework for applications
- What are the differences between MyBatis and Hibernate?
- What’s the difference between #} and $}?
- What if the attribute names in the entity class are different from the field names in the table?
- How to write fuzzy query like statement?
- Usually an Xml mapping file will write a Dao interface corresponding to it. What is the working principle of this Dao interface? Can methods in the Dao interface be overloaded if their parameters are different?
- How does Mybatis paginate? Paging? How does paging plug-ins work?
- Mybatis how sq | execution results encapsulated in the target object and returns? What are the mappings?
- How do I perform a batch insert?
- How do I get automatically generated (primary) key values?
- How do I pass multiple parameters in Mapper?
- What’s the use of Mybatis dynamic sq |? How does it work? What dynamic SQL is there?
- Xml mapping file, in addition to the common select | insert | updae | delete tags, what other tags?
- Mybatis semi-automatic ORM mapping tool What’s the difference between it and automatic?
- One-to-one, -to – many associative query?
- MyBatis implementation – How many ways are there for one? How does it work?
- MyBatis implementation – there are several ways, how to operate?
- Does Mybatis support lazy loading? If so, how does it work?
- Mybatis level 1, level 2 cache
- What is interface binding for MyBatis? What are the implementation methods?
- What are the requirements when using MyBatis mapper interface?
- How can YOU write a Mapper?
- Brief introduction of Mybatis plug-in operation principle, and how to write a plug-in.
They are the interview questions
- ZooKeeper?
- What does ZooKeeper offer?
- Zookeeper file system
- ZAB agreement?
- Four types of data nodes zNodes
- Zookeeper Watcher mechanism – Data change notification
- The client registers the Watcher implementation
- The server handles the Watcher implementation
- The client calls back Watcher
- ACL permission control mechanism
- Chroot feature
- Session management
- Server role
- Zookeeper Server running status
- Data synchronization
- How does ZooKeeper keep the order of transactions consistent?
- Why is there a Master in a distributed cluster?
- What can I do if the ZK node is down?
- Zookeeper load balancing differs from NGINx load balancing
- What are the deployment modes of Zookeeper?
- How many machines are required for a cluster? What are the clustering rules?
- Does the cluster support dynamic addition of machines?
- Is Zookeeper’s watch listening notification on a node permanent? Why not permanent?
- What are the Java clients of Zookeeper?
- What is Chubby and how does it compare to Zookeeper?
- Here are some common ZooKeeper commands.
- The relation and difference between ZAB and Paxos?
- Typical application scenarios of Zookeeper
Dubbo interview questions
- Why Dubbo?
- What are the layers of Dubbo’s overall architectural design?
- What communication framework is used by default, and what other options are there?
- Is the service invocation blocking?
- What registry is commonly used? Is there any other option?
- What serialization framework is used by default, and what else do you know?
- What is the mechanism by which service providers can implement fail-kick?
- Service. How to go online does not affect the old version?
- How to solve the problem of long service invocation chains?
- What are the core configurations?
- What protocol does Dubbo recommend?
- Can a service be directly connected to multiple registrations of the same service?
- Draw 1 – Flowchart for service registration and discovery?
- How many options are there for Dubbo cluster fault tolerance?
- Dubbo service degraded, failed to retry what to do?
- What are some of the problems with Dubbo?
- How does Dubbo Monitor work?
- What design patterns does Dubbo use?
- How is the Dubbo configuration file loaded into Spring?
- What is the difference between Dubbo SPI and Java SPI?
- Does Dubbo support distributed transactions?
- Can Dubbo cache the results?
- How can the service be compatible with the old version?
- What packages must Dubbo rely on?
- What does the Dubbo Telnet command do?
- Is Dubbo support service degraded?
- How does Dubbo stop gracefully?
Elasticsearch interview questions
- How about your es cluster architecture, index data size, how many shards there are, and some tuning methods?
- What is the inverted index of ElasticSearch?
- Select * from elasticSearch; select * from elasticSearch;
- How does ElasticSearch implement master voting?
- Elasticsearch indexing documents
- How does Elasticsearch search work?
- What are the optimizations for Linux Settings when Elasticsearch is deployed?
- What is the internal structure of Lucence?
- How does Elasticsearch implement Master voting?
- What if 10 of the 20 Elasticsearch nodes select one master and the other 10 select another master?
- How do clients select specific nodes to execute requests when connecting to a cluster?
- The process of indexing a document under Elasticsearch.
- Details – Update for Elasticsearch
- Details: Searches for Elasticsearch
- How to find an inverted index based on a word in Elasticsearch?
- What are the optimizations for Linux Settings when Elasticsearch is deployed?
- For the GC side, what should I look out for when using Elasticsearch?
- How to implement Elasticsearch aggregation for large data (tens of millions of magnitude)?
- How does Elasticsearch guarantee read/write consistency in concurrent cases?
- How do I monitor the Status of the Elasticsearch cluster
- Describe the overall technical architecture of your e-commerce search.
- What about your personalized search solution?
- Do you know dictionary trees?
- How is spelling correction implemented?
Memcached interview questions
- What is Memcached and what does it do?
- How to implement distributed cluster of Memcached service?
- What are the features of the Memcached service and how it works?
- How does Memcached memory management work?
- How does memcached work?
- What is memcached’s biggest advantage?
- Memcached and MySQL query?
- How does memcached compare to a server’s local cache, such as PHP APC, Mmap files, etc.?
- How does memcached cache work?
- How does memcached implement redundancy?
- How does memcached handle fault tolerance?
- How to import and export memcached items in batches?
- What do you do with cached data if it expires between exports and imports?
- How does memcached do authentication?
- What are threads in Memcached?
- What is the maximum length of a key that memcached will accept?
- How many items can memcached store?
- Can memcached use memory more efficiently?
- What is binary protocol, and should I care?
- How does memcached’s memory allocator work?
- Why not malloc/ Free! ?
- Why use Slabs /
- Is memcached atomic?
- How to implement session shared storage in a cluster?
- The difference between Memcached and Redis?
Redis interview questions
- What is Redis?
- Redis data type?
- What are the benefits of using Redis?
- What advantages does Redis have over Memcached?
- What are the differences between Memcache and Redis?
- Is Redis single process single thread?
- – What is the maximum size of a string value?
- What is the persistence mechanism of Redis? What are their strengths and weaknesses?
- Redis Common Performance Issues and Solutions Redis Expiration key deletion strategy?
- Redis’ recycling strategy?
- Why does Edis need to put all the data in memory?
- How about Redis synchronization?
- What are the benefits of pipelines and why do you use them?
- Have you used Redis clustering? How does clustering work?
- When does the Redis cluster solution cause the entire cluster to become unavailable?
- What Java clients are supported by Redis?
- Which is the official recommendation?
- What are the pros and cons of Jedis versus Redisson?
- How to set and verify a password in Redis?
- What is the concept of a Redis hash slot?
- What is the master-slave replication model for Redis clusters?
- Will there be write losses in the Redis cluster? Why is that?
- How are Redis clusters replicated?
- What is the maximum number of nodes in Redis cluster?
- How do Redis clusters select databases?
- How do I test Redis connectivity?
- How to understand Redis transactions?
- What are the Redis transaction related commands?
MySQL interview questions
- What types of locks are available in MySQL?
- What are the different tables in MySQL?
- Describe the difference between MyISAM and InnoDB in MySQL database
- InnoDB supports four transaction isolation levels in MySQL, and what are the differences between them?
- The difference between CHAR and VARCHAR?
- What’s the difference between primary keys and candidate keys?
- What is Myisamchk used for?
- What happens if a table has a column defined as TIMESTAMP?
- How do you see all the indexes defined for the table?
- What do % and _ mean in the LIKE declaration?
- What is the column comparison operator?
- What’s the difference between BLOB and TEXT?
- What is the difference between MySQL_fetch_array and MySQL_fetch_object?
- Where will the MyISAM table be stored and its storage format provided?
- How does MySQL optimize DISTINCT?
- How do I display the first 50 lines?
- How many columns can be used to create an index?
- What’s the difference between NOW() and CURRENT_DATE()?
- What is a nonstandard string type?
- What are generic SQL functions?
- Does MySQL support transactions?
- What is the best field type in MySQL to record currency
- MySQL > select * from ‘MySQL’ where ‘privileges’ are stored.
- What can be the string type of a column?
- MySQL database is used as the storage of the release system, with more than 50,000 increments per day. It is expected to be operated and maintained for three years. How to optimize?
- Optimization strategies for locking
- The underlying implementation principles and optimizations of indexes
- When is an index set but not available
- How to optimize MySQL in practice
- Methods to optimize the database
- MySQL > select key (s), primary key (s), unique index (s), and joint index (s)
- What are transactions in a database?
- What is the cause of SQL injection vulnerability? How to prevent it?
- Select the appropriate data type for the fields in the table
- Storage period
- Indexes are an important concept for relational databases. Please answer some questions about indexes:
- Explain the difference between external join, inner join and self-join in MySQL
- Overview of the transaction rollback mechanism in Myql
- What are the parts of SQL? What are the operation keys for each section?
Java Concurrent Programming (part 1)
- Is there a difference between daemon threads and local threads in Java?
- What’s the difference between thread and process?
- What is context switching in multithreading?
- The difference between a deadlock and a live lock, a deadlock and starvation?
- What is the thread scheduling algorithm used in Java?
- What is a thread group and why is it not recommended in Java?
- Why use the Executor framework?
- The difference between Executor and Executors in Java?
- How do I find which thread is using the most CPU time on Windows and Linux?
- What is atomic operation? What atomic classes are available in the Java Concurrency API?
- What is the Java Concurrency API’s Lock interface? What are the advantages over synchronization?
- What is Executors Framework?
- What is a blocking queue? What is the implementation principle of blocking queues? How to implement the producer-consumer model using blocking queues?
- What are Callable and Future?
- What is a FutureTask? Start tasks using the ExecutorService.
- What is the implementation of concurrent containers?
- There are several ways to implement multithreaded synchronization and mutex. What are they?
- What are the competitive conditions? How do you find and solve competition?
- How would you use Thread dump? How would you analyze Thread dump?
- Why do we call the run() method when we call the start() method, and why can’t we call the run() method directly?
- How do you wake up a blocked thread in Java?
- What is the difference between CycliBarriar and CountdownLatch in Java?
- What are immutable objects, and how does it help write concurrent applications?
- What is context switching in multithreading?
- What is the thread scheduling algorithm used in Java?
- What is a thread group and why is it not recommended in Java?
- Why is using the Executor framework better than using applications to create and manage threads?
- How many ways can you implement a thread in Java?
- How do I stop a running thread?
- What’s the difference between notify() and notifyAll()?
- What are Daemon threads? What does it mean?
- How does Java implement communication and collaboration between multiple threads?
- What is a ReentrantLock?
- When a thread accesses a synchronized instance of an object, can other threads access other synchronized methods of that object?
- The understanding of optimistic lock and pessimistic lock and how to achieve, what are the implementation methods?
- What is the difference between SynchronizedMap and ConcurrentHashMap?
- In what application scenarios can CopyOnWriteArrayList be used?
- What is thread safety? Are servlets thread-safe?
- What is volatile good for? Can you explain in one sentence how volatile is used?
- Why is the code being reordered?
- What is the difference between wait and sleep in Java?
- Implement blocking queues in Java
- What happens when a thread runs with an exception?
- How do I share data between two threads?
- What is the difference between notify and notifyAll in Java?
- Why are wait, notify, and notifyAll not in thread?
- What are ThreadLocal variables?
- What is the difference between the interrupted and isInterrupted methods in Java?
Concurrent Programming in Java (2)
- Three elements of concurrent programming?
- What are the ways to achieve visibility?
- The value of multithreading?
- What are the ways to create a thread?
- How do you compare the three ways to create threads?
- Thread state flow diagram
- Java threads have five basic states
- What is a thread pool? What are the ways to create it?
- There are four types of thread pool creation:
- What are the advantages of thread pools?
- What are the common concurrency utility classes?
- CyclicBarrier and CountDownLatch
- The role of synchronized?
- The role of the volatile keyword
- What is the CAS
- The problem of the CAS
- What is Future?
- What is the AQS
- AQS supports two synchronization modes:
- What is the ReadWriteLock
- What is FutureTask
- The difference between synchronized and ReentrantLock
- What are optimistic locks and pessimistic locks
- How does thread B know that thread A changed A variable
- Synchronized, volatile, CAS comparison
- What is the difference between the sleep method and the wait method?
- What is a ThreadLocal? What’s the use?
- Why are wait() and notify()/notifyAll() called in synchronous blocks
- What are the methods of multithreaded synchronization?
- Scheduling policy for threads
- What is the concurrency of ConcurrentHashMap
- How do I find which thread is using the longest CPU in Linux
- Java deadlocks and how to avoid them?
- Cause of deadlock
- How do I wake up a blocked thread
- How can immutable objects help multithreading
- What is multithreaded context switching
- What happens if the thread pool queue is full when you submit a task
- What is the thread scheduling algorithm used in Java
- What are Thread schedulers and Time Slicing?
- What is spin
- What is the Java Concurrency API’s Lock interface
- Thread safety in singleton mode
- What does Semaphore do
- Executors?
- The constructor of the thread class, the static block, is called by which thread
- Which is a better choice, synchronous method or synchronous block?
- What exceptions can be caused by too many Java threads?
Java Interview Questions (1)
- What are the characteristics of object orientation?
- What are the differences between access modifiers public, private, protected, and do not write (default)?
- Is String the most basic data type?
- Float f = 3.4; Is that correct?
- short s1 = 1; s1 = s1 + 1; Didn’t you? short s1 = 1; s1 += 1; Didn’t you?
- Does Java have a Goto?
- What’s the difference between int and Integer?
- The difference between & and &&?
- Explain the use of stack, heap, and method area in memory.
- Math.round(11.5) equals what? What is math.round (-11.5)?
- Can switch work on byte, can switch work on long, and can switch work on String?
- What’s the most efficient way to calculate 2 times 8?
- Does an array have a length() method? Does String have a length() method?
- How do I get out of the current multiple nested loops in Java?
- Can the constructor be overridden?
- Two objects with the same value (x.equals(y) == true) can have different hash codes.
- Can I inherit from the String class?
- When an object is passed as an argument to a method that changes the object’s properties and returns the changed result, is it value passing or reference passing?
- What’s the difference between String and StringBuilder?
- The difference between Overload and Override. Can overloaded methods be differentiated by return type?
- Describe how the JVM loads class files.
- Can a char variable hold a Chinese character? Why?
- What are the similarities and differences between abstract classes and interfaces?
- The difference between a Static Nested Class and an Inner Class?
- Is there a memory leak in Java? Please describe it briefly.
- Can abstract methods be static, native, and synchronized at the same time?
- Explain the difference between static variables and instance variables.
- Can calls to non-static methods be made from within a static method?
- How to implement object cloning?
- What is GC? Why GC?
- String s = new String(” xyz “); How many string objects are created?
- Does an interface extend an interface? Does an abstract class implement an interface? Can an abstract class inherit a Concrete class?
- Can a “.java “source file contain multiple classes (not inner classes)? What are the restrictions?
- Can Anonymous Inner classes inherit from other classes? Can interfaces be implemented?
- Can an inner class reference a member of its containing class (the outer class)? Are there any restrictions?
- What are the uses of the final keyword in Java?
- Indicate the results of the following program
- Conversion between data types:
- How to reverse and replace strings?
- How to convert GB2312 encoded string to ISO-8859-1 encoded string?
- Date and Time:
- Print the current moment from yesterday.
- Compare Java with javascript.
- When do you use assertions?
- What is the difference between Error and Exception?
- If there is a return statement ina try{}, will the code in finally{} immediately following the try be executed and when, before or after the return?
- How to handle exceptions in Java language? How to use keywords: throws, throw, try, catch, finally?
- What are the similarities and differences between runtime exceptions and checked exceptions?
- List some of your common runtime exceptions?
- Explain the differences between final, finally and Finalize.
- The ExampleA class inherits Exception, and the ExampleB class inherits ExampleA.
- Do List, Set, and Map inherit from the Collection interface?
- Describes the storage performance and features of ArrayList, Vector and LinkedList.
- What’s the difference between Collections and Collections?
- What are the features of the List, Map, and Set interfaces when accessing elements?
Java Interview Questions (2)
The topics covered in this list of Java interview questions are listed below
- Multithreading, concurrency and threading basics
- Basic principles of data type conversion
- Garbage Collection (GC)
- Java Collections Framework
- An array of
- string
- GOF design patterns
- SOLID
- Abstract classes and interfaces
- Java basics such as Equals and HashCode
- Generics and enumerations
- Java IO and NIO
- Common Network Protocols
- Data structures and algorithms in Java
- Regular expression
- The JVM the underlying
- Java Best Practices
- JDBC
- The Date, Time and Calendar
- The Java XML processing
- JUnit
- programming
There are 133 questions in total. Due to space problems, I will not list them one by one. Here are some screenshots.
Spring Interview Question (1)
① General problems
- What are the main features of the different versions of the Spring Framework?
- What is the Spring Framework?
- List the advantages of the Spring Framework.
- What are the different features of the Spring Framework?
- How many modules are there in the Spring Framework, and what are they?
- What is a Spring configuration file?
- What are the different components of a Spring application?
- What are some ways to use Spring?
② Dependency injection (Ioc)
- What is the Spring IOC container?
- What is dependency injection?
- How many ways can dependency injection be accomplished?
- Distinguish constructor injection from setter injection.
- How many IOC containers are available in Spring?
- Distinguish between BeanFactory and ApplicationContext.
- List some of the benefits of IoC.
- Implementation mechanism of Spring IoC.
(3) Beans
- What are Spring beans?
- What configuration options does Spring provide?
- Spring supports centralized bean scopes?
- What is the lifecycle of the Spring Bean container?
- What are Spring’s internal beans?
- What is Spring assembly
- What are the methods of automatic assembly?
- What are the limitations of autowiring?
(4) annotations
- What is annotation-based container configuration
- How do I start annotation assembly in Spring?
- What is the difference between @Component, @Controller, @repository, and @service?
- What’s the use of the @required annotation?
- What are the @autowired annotations for?
- What is the use of the @qualifier annotation?
- What are the @requestMapping annotations for?
⑤ Data access
- What does the Spring DAO do?
- List exceptions thrown by the Spring DAO.
- What classes exist in the Spring JDBC API?
- What are the ways to access Hibernate using Spring?
- List the transaction management types supported by Spring
- Which ORM frameworks spring supports
6. AOP
- What is AOP?
- What is Aspect?
- What is JoinPoint?
- What is Advice?
- What types of Advice are there?
- Point out the difference between Concern and cross-cutting concern in Spring AOP.
- What are the implementations of AOP?
- What is the difference between Spring AOP and AspectJ AOP?
- How do you understand proxies in Spring?
- What is Weaving?
All landowners MVC
- What is the use of the Spring MVC framework?
- Describe the workflow of the DispatcherServlet
- Introduce WebApplicationContext
Spring Interview Question (2)
- What is spring?
- What are the benefits of using the Spring framework?
- What modules does Spring consist of?
- Core container (application context) module.
- BeanFactory – Example of a BeanFactory implementation.
- XMLBeanFactory
- Explain AOP modules
- Explains the JDBC abstraction and DAO modules.
- Explains the object/relational mapping integration module.
- Explain the WEB module.
- Spring configuration file
- What is the Spring IOC container?
- What are the advantages of IOC?
- What is the usual implementation of ApplicationContext?
- What is the difference between Bean Factory and Application Contexts?
- What does a Spring application look like?
① Dependency injection
- What is Spring’s dependency injection?
- What are the different types of IOC (dependency injection) approaches?
- Which dependency injection method do you recommend, constructor injection or Setter injection?
(2) Spring Beans
- What are Spring beans?
- What does a Spring Bean definition contain?
- How do I provide configuration metadata to the Spring container?
- How do you define the scope of a class?
- Explains the scope of several beans supported by Spring.
- Are singleton beans in the Spring framework thread-safe?
- Explains the life cycle of beans in the Spring framework.
- What are the important bean lifecycle methods? Can you reload them?
- What are Spring’s internal beans?
- How do I inject a Java collection in Spring?
- What is bean assembly?
- What is bean autowiring?
- Explain the different ways of automatic assembly.
- What are the limitations of autowiring?
- Can you inject a null and an empty string into Spring?
(3) the Spring annotations
- What is the Java-based Spring annotation configuration? Give some examples of annotations.
- What is annotation-based container configuration?
- How to start annotation assembly?
- @ Required annotations
- The @autowired annotation
- @ the Qualifier annotations
④Spring data access
- How can I use JDBC more effectively in the Spring framework?
- JdbcTemplate
- Spring support for DAOs
- How do YOU access Hibernate using Spring?
- ORM supported by Spring
- How to combine Spring and Hibernate with Hibernateda Support?
- The type of transaction management supported by Spring
- What are the advantages of transaction management in the Spring framework?
- Which transaction management style do you prefer?
⑤Spring Faceted Programming (AOP)
- Explain the AOP
- The Aspect Aspect
- What is the difference between concerns and crosscutting concerns in Spring AOP?
- The join
- notice
- Point of tangency
- What is introduction?
- What is the target object?
- What is agency?
- How many different types of automatic agents are there?
- What is weaving in. What are the differences in weaving applications?
- Explains the implementation of aspects based on XML Schema.
- Explains annotation-based aspect implementations
6. The Spring MVC
- What is Spring’s MVC framework?
- DispatcherServlet
- WebApplicationContext
- What is the Spring MVC framework controller?
- @ Controller annotations
- @ RequestMapping annotations
Micro service interview questions
Linux interview questions
Spring Boot interview question
Spring Cloud interview question
- What is Spring Cloud?
- What are the advantages of using Spring Cloud?
- What do I mean by service registration and discovery? How is Spring Cloud implemented?
- What does load balancing mean?
- What is Hystrix? How does it achieve fault tolerance?
- What is Hystrix circuit breaker? Do we need it?
- What is Netflix Feign? What are its advantages?
- What is Spring Cloud Bus? Do we need it?
The RabbitMQ interview questions
- What is the rabbitmq
- Why use RabbitMQ
- Rabbitmq scenarios
- How do I ensure that messages are sent to RabbitMQ correctly? How do I ensure that message recipients consume messages?
- How can I avoid double-delivery or double-consumption of messages?
- What transport is the message based on?
- How are messages distributed?
- How are messages routed?
- How do I ensure that messages are not lost?
- What are the benefits of using RabbitMQ?
- The RabbitMQ cluster
- The disadvantage of mq
Kafka interview questions
- How do I get a list of topic topics
- What is the producer and consumer command line?
- Is consumer push or pull?
- Talk about how Kafka maintains consumption status tracking
- Talk about master-slave synchronization
- Why do you need a messaging system? Can’t mysql meet the requirements?
- What does Zookeeper do for Kafka?
- What are the three transaction definitions for data transfer?
- What are the two conditions for Kafka to determine if a node is still alive?
- There are three key differences between Kafka and traditional MQ messaging systems
- Talk about the three mechanisms for Kafka ack
- How do consumers not automatically submit offsets by application submission?
- How to solve the problem of consumer failure and live lock?
- How to control the location of consumption
- How can messages be consumed sequentially in a distributed (not stand-alone) Kafka scenario?
- What is kafka’s high availability mechanism?
- How does Kafka reduce data loss
- How does Kafka not consume duplicate data? For example, deduction, we can’t double deduction.
How to get information: JAVA Architecture Crash Notes