preface

This article is a summary of the essential knowledge points for the Interview of Java programmers. It explains in detail the principle of JVM, multi-threading, data structure and algorithm, distributed cache, design pattern and other contents. I hope readers can have a deeper and comprehensive understanding of the basic principles of Java through reading this book.

The interviewer is usually able to get a thorough understanding of the knowledge structure of the interviewee in only two hours. If the interviewee is slow and fails to get to the essence of the question, it will be difficult for the interviewee to fully express himself and ultimately affect the interview result. In response to this situation, this article tries to be concise and not slow in explaining the core knowledge points that Java programmers are often asked about in job interviews.

 

This article will be introduced from the contents, main content and suggestions for readers to read this article in three parts, I hope you can like it, but also hope to help you learn!

directory

 

The main content

There are 9 chapters in this paper, and the contents of each chapter are as follows.

Chapter 1 covers the principles of the JVM, including the JVM running mechanism, the JVM memory model, common garbage collection algorithms, and the JVM class loading mechanism.

1.1 Running mechanism of the JVM

1.2 a multithreaded

1.3 Memory area of the JVM

1.4 Runtime memory for the JVM

1.5 Garbage collection and algorithm

The four types of guide | use Java 1.6

1.7 Generation collection algorithm and Zone collection algorithm

1.8 Garbage Collector

1.9 Java Network programming model

1.10 Class loading mechanism for the JVM

 

Chapter 2, this chapter will introduce the common Java basic knowledge in detail, including Java collection, exception classification and processing, reflection mechanism, annotation, inner class, generics, serialization of these parts

2.1 the collection

2.2 Abnormal classification and handling

2.3 Reflection Mechanism

2.4 annotations

2.5 the inner class

2.6 generics

2.7 the serialization

 

Chapter 3 Compared with the traditional single thread, multithreading can make better use of multiple CPU resources of the server on the basis of the multi-core configuration of the operating system, and make the program run more efficiently. Java provides support for multithreading to execute multiple threads concurrently within a process, with each thread performing different tasks in parallel to meet the requirements for writing efficient programs.

3.1 How to create Java threads

3.2 How thread pools work

3.3 Five common thread pools

3.4 Thread life cycle

3.5 Basic methods of threading

3.6 Locks in Java

3.7 Thread context switch

3.8 Java blocking Queues

3.9 Java Concurrent Keyword

3.10 How do Multiple threads share Data

3.11 ConcurrentHashMap concurrent

3.12 Thread scheduling in Java

3.13 Process Scheduling Algorithm

3.14 What is CAS

3.15 ABA problem

3.16 What is AQS

 

Chapter 4 Data Structure Storage and organization of data. Some people think that “program = data structure + algorithm”. Therefore, a good data structure is very important for the operation of the program, especially in the complex system, the design of excellent data structure can improve the flexibility and performance of the system. In the design and development process of the program inevitably need to use a variety of data structures, such as sometimes need to define their own data structures according to the characteristics of the product, so the data structure is very important for the program design. This chapter will detail common data structures, including stacks, queues, linked lists, binary trees, red-black trees, hash tables, and bitmaps.

4.1 Stack and its Java implementation

4.2 Queues and their Java implementation

4.3 list

Hash table 4.4

4.5 Binary sorting tree

4.6 the red-black tree

Figure 4.7

4.8 the bitmap

 

In the computer world, “data structure + algorithm = program”, so algorithm plays a crucial role in program development. Although we design algorithms in the development of the situation is not much, in the work can not do without algorithms. Algorithms are ubiquitous in programs, whether they are provided by development kits or designed by ourselves.

Commonly used algorithms are search algorithm and sorting algorithm. Search algorithms include linear search algorithm, depth-first search algorithm, breadth-first search algorithm and binary search algorithm. Here we focus on the most commonly used and fastest binary search algorithm.

Sorting algorithms are very common, ranging from database design to sorting lists. Common sorting algorithms are bubble sort algorithm, insertion sort algorithm, quick sort algorithm, Hill sort algorithm, merge sort algorithm, bucket sort algorithm, heap sort algorithm and radix sort algorithm. These algorithms are described in detail in this chapter.

In addition, it also introduces some essential algorithms in application, such as pruning algorithm, backtracking algorithm, shortest path algorithm, maximum subarray algorithm and longest common factor algorithm.

5.1 Binary search algorithm

5.2 Bubble Sorting algorithm

5.3 Insert sort algorithm

5.4 Quicksort Algorithm

5.5 Hill sorting algorithm

5.6 Merge Sort Algorithm

5.7 Bucket Sorting Algorithm

5.8 Cardinality sorting algorithm

5.9 Other Algorithms

 

Chapter 6 In the field of computer, network is a virtual platform for information transmission, reception and sharing. It connects the information of each point, surface and body together, so as to realize the sharing of these resources. In a large distributed system, the network plays an important role, this chapter of the commonly used network layer 7 architecture, as well as the TCP/IP, HTTP and the principle of CDN to do a simple introduction, this is what we build distributed system must understand, only understand these principles, to design a good system, system architecture and more targeted to do tuning.

Load balancing builds on existing network structures and provides a cheap, effective and transparent way to extend the bandwidth of network devices and servers, increase throughput, enhance network data processing capabilities, and improve network flexibility and availability. Common load balancers in projects include four-layer load balancers and seven-layer load balancers.

This chapter describes the principles of network and load balancing, including TCP/IP, HTTP, common load balancing algorithms, and LVS principles.

6.1 the network

6.2 Load Balancing

 

Chapter 7 Database is an essential component in software development. Whether it is relational database MySQL, Oracle, PostgreSQL, or NoSQL database HBase, MongoDB, Cassandra, they all solve different problems in different application scenarios. Not described in detail in this chapter the use of these database method, because the reader more or less all used these database, but the underlying database principle, especially the storage engine, database lock and the distributed transaction is easy to overlook, and these principles for database tuning and the solution of the problems is more important, Therefore, this chapter will introduce database storage engines, database indexes, stored procedures, database locks, and distributed transactions. We hope readers can understand these principles at a higher level, so that they can make correct judgments when database performance bottlenecks occur.

7.1 Basic Concepts and Principles of the Database

7.2 Concurrent Operations and locking of databases

7.3 Database Distributed Transactions

 

Chapter 8 Caching refers to the technique of storing frequently accessed data in memory to speed up user access. Cache is divided into process-level cache and distributed cache. Process-level cache means that data is cached inside services and stored using structures such as maps and lists. Distributed cache refers to storing cached data separately in a distributed system for unified management and access. Common distributed caching systems include Ehcache, Redis, and Memcached.

8.1 Introduction to Distributed Caching

8.2 Principle and application of Ehcache

8.3 Principle and application of Redis

8.4 Core issues of distributed cache design

 

Chapter 9 Design Patterns is a summary of highly abstract code Design experiences that can be used repeatedly in programming.

The correct use of design pattern can effectively improve the readability, reusability and reliability of the code, and the code that conforms to the design pattern specification is not only conducive to the stability and reliability of its own system, but also conducive to the docking of external systems. In the system engineering with good design pattern, it is of great help to meet the current demand, or to adapt to the future demand, or to the docking of modules between their own systems, or to the docking of external systems.

This chapter covers design patterns, covering 23 common classic design patterns.

9.4 Concept of singleton pattern and Java implementation

9.5 Builder pattern concept and Java implementation

9.6 Prototype pattern concept and Java implementation

9.7 Adapter pattern concept and Java implementation

9.8 Decorator pattern concept and Java implementation

9.9 Proxy mode concept and Java implementation

9.10 Concept of appearance pattern and Java implementation

9.11 Bridge mode concept and Java implementation

9.12 Composite pattern concept and Java implementation

9.13 Concept of share mode and Java implementation

9.14 Concept of policy pattern and Java implementation

9.15 Concept of template method pattern and Java implementation

9.16 Observer pattern concept and Java implementation

9.17 Concept of iterator pattern and Java implementation

9.18 Concept of responsibility chain pattern and Java implementation

9.19 Command mode concept and Java implementation

9.20 Concept of memo pattern and Java implementation

9.21 Concept of state pattern and Java implementation

9.22 Visitor pattern concept and Java implementation

9.23 Concept of mediator pattern and Java implementation

9.24 Concept of interpreter pattern and Java implementation

 

This is the first time that you have a job interview in Java. The first time you have a job interview in Java, you have a job interview in Java.Docs.qq.com/doc/DTlpqcU…100 % for free

Suggestions for readers reading this article

The contents are detailed, and it is suggested that readers review the past with the contents as a reference after reading this article, so as to achieve the purpose of comprehending and understanding.

Readers are advised to spend three weeks perusing the text to understand the knowledge points, code and architecture diagrams in detail.

Spend another two days to review, recall knowledge points in front of the catalogue, and timely check the missing parts that can’t remember;

Spend an additional three hours of revision before the interview to fully grasp the material.

In this way, readers will be able to understand the breadth and depth of each knowledge point in the article more fully, and be confident in the interview.

I hope you can carefully read this article, slowly understand the true meaning of this article, slowly increase the breadth and depth of their own technology, so that they become more valuable!

I hope this article can help you, everyone refueling good study!!