LZ believes that the best way to learn about Java is to interview and advanceBrush + blog + book + summaryLZ will give full play to the first three aspects in this article. As for the summary, you will find that the interview is not difficult as far as you go. The second is whether you think during the process of brushing the questions, and the second is just brushing the questions.
LZ has summarized a series of frequently asked interview techniques, in-depth analysis and answers, which will help every developer who is preparing for the interview to go to the big factory.
What is an interview? According to LZ, interview is a process of continuous precipitation, summary, and good communication of professional skills and problem-solving ability. Below are some interview questions summarized by LZ. If there are any mistakes in the article, please correct them.
Java based
- The difference between object-oriented and procedural
- What are the features of the Java language?
- JVM JDK (JDK) and JRE (JRE
- Oracle JDK vs. OpenJDK
- The difference between Java and C++?
- What is the main class of a Java program how is the main class of an application different from that of a small program?
- What are the differences between a Java application and a small program?
- What’s the difference between a character constant and a string constant?
- Can the Constructor be override?
- The difference between overloading and overwriting
- Three major features of Java object-oriented programming: encapsulation inheritance polymorphism
- What is the difference between String StringBuffer and StringBuilder? Why is String immutable?
- Automatic packing and unpacking
- Why is it illegal to call a non-static member in a static method?
- Define the role of a constructor in Java that does nothing and takes no arguments
- What is the difference between import Java and Javax?
- What is the difference between interfaces and abstract classes?
- What is the difference between a member variable and a local variable?
- What operator is used to create an object? How is an object entity different from an object reference?
- What is the return value of a method? What is the function of a return value in a class method?
- What does a class constructor do? If a class does not declare a constructor, the program executes correctly
- All right? Why is that?
- What are the properties of constructors?
- How static methods differ from instance methods
- What is the difference between the equality of objects and the equality of references to them?
- The subclass constructor is called before the subclass constructor is called.
- == equals(important)
- HashCode vs. Equals (Important)
- Why is there only value passing in Java?
- Describes the basic concepts of threads, programs, and processes. And what is the relationship between them?
- What are the basic states of a thread?
- Some summary of the fifinal keyword
- Exception handling in Java
- What if some fields in Java serialization do not want to be serialized?
- Gets two common methods of typing with a keyboard
- In Java IO streams
- Summary of common keywords: static, fifinal, this, super
- Deep copy vs shallow copy
Java basic questions answer analysis
Java collection
- What is the difference between a List, a Set, and a Map?
- Is Arraylist different from LinkedList?
- How is an ArrayList different from a Vector? Why replace Vector with Arraylist?
- Let’s talk about how ArrayList can be expanded
- HashMap is different from HashSet
- How does a HashSet check for repetitions
- The underlying implementation of HashMap
- Why is the length of a HashMap a power of 2
- HashMap multithreading causes an infinite loop
- ConcurrentHashMap and Hashtable
- ConcurrentHashMap Thread-safe implementation/low-level implementation
- Comparable and Comparator
- Summary of the underlying data structure of the collection framework
- How to choose a set?
Java collection answer parsing
multithreading
-
What are threads and processes?
-
Please briefly describe the relationship between threads and processes, their differences and advantages and disadvantages.
-
What’s the difference between concurrency and parallelism?
-
Why multithreading?
-
What are the possible problems with using multithreading?
-
What about the life cycle and state of threads?
-
What is context switching?
-
What is a thread deadlock? How do I avoid deadlocks?
-
What are the differences and similarities between sleep() and Wait ()?
-
Why do we call the run() method when we call the start() method, and why can’t we call the run() method directly
-
Method?
-
Talk about what you know about synchronized
-
Describe how you use the synchronized keyword. Did you use it in your project
-
There are three main ways to use the synchronized keyword
-
Talk about the underlying principles of synchronized
-
Describe the underlying optimization of synchronized keyword after JDK1.6. Can you introduce these optimization in detail
-
Talk about the difference between synchronized and ReentrantLock
-
Let’s talk about the Java memory model
-
Talk about the difference between the synchronized keyword and the volatile keyword
-
ThreadLocal principle and ThreadLocal memory leakage problem
-
Implement the difference between Runnable interface and Callable interface
-
What is the difference between the execute() method and the submit() method?
-
Analysis of thread pool principle
-
Can you give me a brief introduction to the AtomicInteger class
-
AQS principle analysis access: pay attention to the end of the public account
Multithreaded answer analysis
JVM
- Introducing the Java memory area (runtime data area)
- Talk about the Java object creation process
- What are the two ways in which objects can be accessed?
- Let’s talk about the basic strategy for allocating objects in heap memory
- What’s the difference between the Minor AND Full Gc?
- How do I determine if an object is dead? (Two methods)
- A brief introduction to strong references, soft references, weak references, virtual references
- How to determine if a constant is discarded?
- How do you tell if a class is useless?
- What are the algorithms for garbage collection and their characteristics?
- Why HotSpot is divided into new generation and old generation?
- What are the common garbage collectors?
- Class loading process
JVM interview question answer analysis
network
- OSI and TCP/IP each layer structure and function, what are the protocols?
- TCP Three handshakes and four waves (frequent interviewers)
- TCP and UDP are different
- How does TCP ensure reliable transmission
- ARQ protocol
- Sliding Windows and flow control
- Congestion control
- Ijk how to display the home page by typing the URL in the browser (frequent interviewer)
- Status code
- The relationship between various protocols and the HTTP protocol
- HTTP long connection, short connection
- HTTP is a protocol that does not save state. How to save user state?
- What does a Cookie do? How is it different from Session?
- What are the main differences between HTTP 1.0 and HTTP 1.1?
- What’s the difference between URI and URL?
- What’s the difference between HTTP and HTTPS?
Network interview questions answer analysis
The data structure
- Queue in the Java Collection framework
- HashSet and TreeSet underlying data structures
- List of common implementation classes ArrayList and LinkedList source learning
- Map
- Binary tree
- Complete binary tree
- Full binary tree
- The heap
- Binary Search tree (BST)
- Self-balancing Binary Search Tree
- Red and black tree
- B minus, B plus, B star tree
- LSM tree
Data structure answer parsing
algorithm
- A few common string algorithm summary
- Longest public prefix
- Palindrome string
- The two together
- Reverse a linked list
- The KTH last node in a linked list
- Deletes the penultimate node of the linked list
- Merges two sorted lists
- Reference to part of the offer programming questions
- Step jumping problem
- Abnormal jump step problem
- Two-dimensional array lookup
- Replace the blank.
- A number raised to an integer power
- Reorder the array so that the odd number precedes the even number
- The KTH last node in a linked list
- Reverse a linked list
- Merges two sorted lists
- Implement queues with two stacks
- Stack push in, pop-up sequence
Algorithm Example answer parsing
The database
- MySQL Storage Engine
- Character set and proofreading rules
- The index
- Query the use of cache
- What is a transaction?
- Four properties of things (ACID)
- What are the problems associated with concurrent transactions?
- What are the transaction isolation levels? What is the default isolation level for MySQL?
- Locking mechanism and InnoDB locking algorithm
- Big table optimization
- Explain what the pooling design idea is. What is database connection pooling? Why do YOU need a database connection pool?
- How to deal with the id primary key after the database is divided into tables?
- How does an SQL statement execute in MySQL
- Recommended specifications for MySQL high-performance optimization
- What are the reasons why an SQL statement executes slowly?
MySQL database
Redis
- Why redis/ why cache
- Why redis and not Map/Guava?
- Redis thread model
- The difference between Redis and memcached
- Redis common data structure and application scenario analysis
- Redis sets the expiration time
- Redis memory flushing mechanism (MySQL has 2000W data, redis only 20W data, how to ensure that redis data is hot data?)
- Redis persistence mechanism (how to ensure that redis hangs and then restarts data can be recovered)
- Redis transactions
- Cache avalanche and cache penetration solutions
- How to solve the Redis concurrent competing Key problem
- How to ensure data consistency between the cache and the database in dual write?
Redis
Spring
- What is the Spring Framework?
- Name some important Spring modules?
- @RestController vs @Controller
- Talk about Spring IoC and AOP
- What are the scopes of beans in Spring?
- Do you understand the thread-safety issues of singleton beans in Spring?
- What’s the difference between @Component and @Bean?
- What are the annotations that declare a class as a Spring bean?
- Bean life cycle in Spring?
- Do you know how SpringMVC works?
- What design patterns are used in the Spring framework?
- What are the isolation levels in Spring transactions?
- What kinds of transaction propagation behavior do Spring transactions have?
- The @transactional (rollbackFor = exception.class) annotation.
- How do I use JPA to nonpersist a field in a database?
Spring interview
MyBatis
-
What is the difference between {} and ${}?
- Xml mapping file, in addition to the common select | insert | updae | delete tags, what other tags?
- As a best practice, an Xml mapping file is usually written with a Dao interface. How does this Dao interface work? Can methods in the Dao interface be overloaded if their parameters are different?
- How does Mybatis paginate? How does paging plug-ins work?
- Brief introduction of Mybatis plug-in operation principle, and how to write a plug-in.
- Mybatis performs batch insert, can return database primary key list?
- What does Mybatis dynamic SQL do? What is the dynamic SQL? Can you briefly explain how dynamic SQL is executed?
- How does Mybatis encapsulate SQL execution results as target objects and return them? What are the mappings?
- Can Mybatis perform one to one, one to many associated query? What are the implementation methods and the differences between them?
- Does Mybatis support lazy loading? If so, how does it work?
- In the Xml mapping files of Mybatis, can the IDS of different Xml mapping files be repeated?
- How to perform batch processing in Mybatis?
- What Executor executors does Mybatis have? What’s the difference between them?
- How to specify which Executor Executor to use in Mybatis?
- Can Mybatis map Enum classes?
- In Mybatis mapping file, if tag A refers to tag B by include, can tag B be defined after tag A, or must be defined before tag A?
- Describe the mapping between Mybatis Xml mapping file and Mybatis internal data structure.
- Mybatis semi-automatic ORM mapping tool What’s the difference between it and automatic?
MyBatis
Kafka
- What is Kafka? What are the main application scenarios?
- What is Kafka’s advantage over other message queues?
- Is the queue model understood? Is Kafka’s message model known?
- What are Producer, Consumer, Broker, Topic, Partition?
- Kafka has multiple copies. What benefits did it bring?
- Zookeeper in Kafka?
- How does Kafka guarantee the order in which messages are consumed?
- How does Kafka ensure that messages are not lost
- How does Kafka ensure that messages are not consumed twice
image
Kafka
Netty
- What is Netty?
- Why use Netty?
- Are you familiar with Netty application scenarios?
- What are the Netty core components? What are the roles of the two?
- EventloopGroup? What does it have to do with EventLoop?
- Bootstrap and ServerBootstrap?
- How many threads does the NioEventLoopGroup default constructor start?
- The Netty thread model?
- How do I start the Netty server and client?
- What is TCP sticky/unpack? What’s the solution?
- What is the Netty long connection and heartbeat mechanism?
- Netty zero copy.
Netty答案解析
Space is limited. There are more about distributed, micro services, high availability, high concurrency, etc., not shown, you can directly obtain the original file to view, learn. I hope I can help more friends.
How to obtain: pay attention to the public account at the end of the article
Big factory interview real question analysis
The last
In fact, Java development knowledge is so much, the interview to ask or so things. So there are no other tips for interviews, just how prepared you are for them. So, when you go out for the interview, find out where you are in your revision.
Tencent, headlines, ali, share above Meituan companies such as beating, bytes in 2019-2020 high frequency interview questions, LZ has put together a video these technical points and PDF (actually spent a lot of energy more than expected), contains the knowledge context + details, as space is limited, the above is just one part in the form of pictures to show you. There are more about distributed, micro services, high availability, high concurrency, etc., not shown, you can directly obtain the original file to view, learn. I hope I can help more friends.
How to obtain: follow the public account below to obtain.