preface

Come up after the year, will usher in gold three silver four immediately. Many of us are preparing for this golden age, whether it’s changing jobs, getting a raise, or looking for a job. Today I would like to share with you a set of Java interview questions, which took some time to sort out.

Java basics interview questions

1, The difference between List and Set.

2. How is a HashSet guaranteed to be non-repetitive?

3. Is HashMap thread safe, and why not?

4. Expansion process of HashMap.

5. What are the differences between HashMap1.7 and 1.8?

6. Final Finally Finalize

7. Strong reference, soft reference, weak reference, virtual reference.

Java reflection.

9, Arrays. Sort implementation principle and Collection implementation principle

10. LinkedHashMap application

11. Implementation principle of Cloneable interface.

What’s the difference between ‘wait’ and ‘sleep’?

How are arrays allocated in memory?

Java concurrency interview questions

1. Realization principle of synchronized and lock optimization?

2. How does volatile work?

Java semaphores?

4. The difference between synchronized and ordinary methods?

5. How to implement that all threads wait for an event to occur before executing it?

6, the CAS? What are the defects of CAS and how to solve them?

7. What’s the difference between synchronized and lock?

8, How to lock Hashtable?

HashMap concurrency problem?

10, ConcurrenHashMap? Why red black trees in 1.8?

11. Brief introduction to AQS.

12. How to detect deadlocks? How do I prevent deadlocks?

13. Java Memory Model?

14. How to ensure that i++ results are correct in multiple threads?

What are the types, differences and usage scenarios of thread pools?

JVM interview questions

1. Memory structure of JVM.

2. How does a JVM method stack work? What is the difference between a method stack and a local method stack?

3. How JVM stack references relate to objects in the heap.

4. Learn about escape analysis techniques.

5. Common algorithms of GC, garbage collection process of CMS and G1, which two Stop the world in each stage of CMS, whether CMS will generate fragments, advantages of G1.

6. Understanding, advantages and disadvantages of tag clearing and tag collation algorithms.

7. Proportion of Eden Survivor zone, why this proportion, and Eden Survivor working process.

8. How does the JVM determine if an object should be GC, and what types of objects can be considered root?

9. What is the difference between strong and weak virtual references and what does GC do to them?

10. Whether Java can GC direct memory.

11.Java class loading process.

12. The process and advantages of parental delegation model.

13. Common JVM tuning parameters.

14. Analysis of dump files.

15. Does Java actively trigger GC (no)?

Spring interview questions

BeanFactory and FactoryBean?

2. Understanding of Spring IOC and its initialization process?

BeanFactory and ApplicationContext?

How is the life cycle of Spring beans managed?

5. What is the loading process of Spring beans?

6. If you were asked to implement Spring AOP, how would you do it?

7. What issues would you pay attention to if you were asked to implement Spring IOC?

How does Spring manage transactions? Transaction management mechanism?

What are the different transaction propagation behaviors of Spring?

What design patterns are used in Spring?

How does Spring MVC work?

How does Spring loop injection work?

13. Understanding Spring AOP, terms, how do they work with each other?

14. If you have used Struts2, what is the difference between springMVC and Struts2?

15. How does Spring Mvc set redirection and forwarding?

16. How to write interceptors in Spring Mvc?

17. What is the Spring IOC container?

18. What is dependency injection? How many ways can dependency injection be accomplished?

19. Distinguish between BeanFactory and ApplicationContext

20. What is the lifecycle of the Spring Bean container?

Redis related interview questions

1. Differences between RDB and AOF.

2. Why does the RDB fork the child process instead of the thread?

3. Redis basic data type.

4. The underlying data structure of Zset, when to increase the height of the hop table.

5. Distributed Redis, cache and database read and write inconsistent, should be delayed double deletion.

6. The interviewer asked me to talk about Redis, so I also talked about cache penetration, breakdown, avalanche and how to deal with it.

7. What advantages does Redis have over memcached?

8. What physical resources do Redis mainly consume?

9. What kinds of data elimination strategies does Redis have?

10. Why doesn’t Redis officially provide Windows version?

11. What is the maximum capacity of a string value?

12. Why does Redis need to put all data in memory?

13. What should Redis cluster solution do? What are the options?

14. What should Redis cluster solution do? What are the options?

15. When will the Redis cluster solution make the whole cluster unavailable?

16. What are the suitable scenarios for Redis?

17. What does Redis have to do with Redisson?

18. What are the advantages and disadvantages of Jedis compared with Redisson?

19. What about the Redis hash slot?

20. How does Redis cluster select a database?

MySQL related interview questions

Atomicity, consistency, isolation, durability?

2. Transaction concurrency? Transaction isolation levels, what problems are caused by each level, which level is MySQL’s default?

3. What is the difference between InnoDB, MyISAM and MEMORY?

4. What are the applicable scenarios of the two storage engines of MySQL MyISAM and InnoDB at transaction and lock levels?

5. Order of execution of different elements (WHERE, jion, limit, group by, having, etc.)

6. What is a temporary table and when will a temporary table be deleted?

MySQL > alter table B+Tree Hash index

8. What type of index does the SQL query determine to create? How to optimize queries?

9. What is the difference between a clustered index and a non-clustered index?

10. What kind of lock (optimistic lock pessimistic lock), how to add exclusive lock select?

1. What is SpringBoot?

2. What are the advantages of SpringBoot?

3. What is JavaConfig?

4. How do I reload changes on Spring Boot without restarting the server?

5. What is the monitor in Spring Boot?

6. How to disable THE security of endpoints in Spring Boot?

7. How to run a Spring Boot application on a custom port?

8. What is YAML?

How to implement Spring Boot application security?

10. How to integrate Spring Boot and ActiveMQ?

MyBatis interview questions

1. What is Mybatis?

2. The advantages of Mybaits? Shortcomings of MyBatis framework?

3. Application of MyBatis framework

4. What are the differences between MyBatis and Hibernate?

5. What is the difference between #{} and ${}?

6. Fuzzy query like statement how to write?

7. How is Mybatis paginated? How does paging plug-ins work?

8. Why Mybatis is semi-automatic ORM mapping tool? What’s the difference between it and automatic?

9. How many ways can MyBatis implement one-to-one? How does it work?

10.MyBatis has several ways to implement one-to-many, how to operate?

Questions related to Tomcat

1. What is Tomcat?

2. What is the default Tomcat port and how to change it?

3. Which Connector operation modes (optimization) does Tomcat have?

4. How many deployment modes can Tomcat be used?

5. How does the Tomcat container create instances of servlet classes? What principles are used?

ZooKeeper 1. What is ZooKeeper?

2. What does ZooKeeper offer?

3.Zookeeper file system.

4. How does Zookeeper synchronize the status of the primary and secondary nodes?

5. Four types of data nodes zNodes.

6.Zookeeper Watcher mechanism – Data change notification.

7. The client registers the Watcher implementation.

8. The server handles the Watcher implementation.

9. The client calls back Watcher.

10.ACL permission control mechanism.

Micro-services related interview questions

1. How is the front and rear end separation done? What are the frameworks for microservices?

2. Talk about the implementation principle of RPC and Dubbo

3. What are the advantages of microservices architecture? What are the features of microservices?

4. What are the best practices for designing microservices?

5. How does the microservices architecture work?

6. What are the advantages and disadvantages of microservices architecture?

7. What are the differences between monolithic, SOA and microservice architectures?

8. What are the key differences between SOA and microservice architectures?

9. The API management

10. Service fusion (Hystrix), service tracking (starter-sleUTH)

Netty

What is 1.Net TY?

What are the features of 2.Net TY?

3. What are the advantages of.NET TY?

What are the application scenarios of 4.Net TY?

5.What are the high-performance aspects of NET TY?

6. What are the differences between BIO, NIO and AIO?

7. What is NIO made of?

8.Net TY thread model?

9. Causes and solutions of TCP packet sticking/unpacking?

10. What is Netty zero copy?

Concurrent programming in Java

1. What is context switching in multithreading?

2. The difference between deadlock and live lock, deadlock and starvation?

3. What is the thread scheduling algorithm used in Java?

4. What are thread groups and why are they not recommended in Java?

5. Why use the Executor framework?

6. What is blocking queue? What is the implementation principle of blocking queues? How to implement the producer-consumer model using blocking queues?

7. What are Callable and Future?

8. What is FutureTask? Start tasks using the ExecutorService

9. What is the implementation of concurrent containers?

10. There are several ways to implement multithreaded synchronization and mutex. What are they?

11. How do you wake up a blocked thread in Java?

12. What is the difference between CycliBarriar and CountdownLatch in Java?

13. What are thread groups and why are they not recommended in Java?

Database related interview questions

1. Index, common index principles, limit the number of indexes

2. Mylasm, Memory, Tokudb, B+ tree, concept

3. Sort binary tree, prefix tree, red-black tree, bitmap

4. Database concurrency strategy, optimistic locking, pessimistic locking, timestamp

5. Distributed lock based on Redis, two-phase commit protocol, preparation stage, commit stage, shortcomings

The last

For space, I’ve highlighted some common and important interview questions. All interview questions are not immutable, the above interview questions just give you a reference role, the most important is to increase their knowledge reserve, be prepared.

For space, I’ve highlighted some common and important interview questions.

All interview questions are not immutable, the above interview questions just give you a reference role, the most important is to increase their knowledge reserve, be prepared.

Jinsan Yin4 is coming, to brush this spring recruitment interview manual, there is a need to share free download! All interview questions are not immutable, the above interview questions just give you a reference role, the most important is to increase their knowledge reserve, be prepared. The interview questions mentioned in the article have been compiled into more than 40 PDF files:

Collection methods: Java basics, algorithms, databases, data structures, caching, big data components, message queues, multi-threading, Big data component principles, NIO&RPC.