Foreword:
First, let me introduce my classmates, who graduated from a junior college majoring in Applied Electronic Technology, and have graduated almost two years ago . Because of professional reasons, he wanted to switch careers after working for a year and felt that there was no future for development. As his "good friend", he thought my job was quite good, so he consulted me, and refused severely (under various temptations) ), still can't stop him. Afterwards, he signed up for training at a certain bird of Peking University, and conducted a half-year accelerated Java programmer processing.
Because he finished his training a year ago and was preparing for an interview after the year, who knew that this pandemic was delayed until May. Subsequently, the interview process lasted for 2 months. Who knows that the dog thief passed the interview during the chat yesterday, and it was still 12K, but I was envious of it (I was only 11K). After consulting the teacher, I realized that he was working hard to review the interview questions + watch the video. Share the interview questions learned with you, and hope that everyone can get the offer you want!
In addition, I have compiled and collected more than 20 years of company interview knowledge points, as well as various Java core knowledge points for free to share with you. The following are just some screenshots. If you want information, you can also click 795983544 to receive the secret code CSDN.
1. Java basic interview knowledge points
The difference between == and equals and hashCode in java
How many bytes does int, char, and long occupy
The difference between int and integer
Tan Tan's understanding of java polymorphism
String、StringBuffer、StringBuilder区别
What is an inner class? The role of inner classes
The difference between abstract class and interface
The meaning of abstract classes
Application scenarios of abstract classes and interfaces
Can an abstract class have no methods and attributes?
The meaning of the interface
The difference between extends and super in generics
Can the static method of the parent class be overridden by the child class
The difference between process and thread
The difference between final, finally, finalize
Serialization method
The difference between Serializable and Parcelable
Can static properties and static methods be inherited? Can it be rewritten? And why?
Design intent of static inner classes
Understanding of member inner classes, static inner classes, local inner classes, and anonymous inner classes, as well as the application in the project
Talk about the understanding of kotlin
The difference between closure and local inner class
The way and principle of converting string to integer
Two. java in-depth interview questions
Under what circumstances will objects be disposed of by the garbage collection mechanism?
Tell me about common encoding methods?
How many bytes does Chinese in utf-8 encoding occupy; how many bytes does int type?
What is the difference between static proxy and dynamic proxy, in what scenarios?
Java's exception system
Talk about your understanding of resolution and dispatch.
Modify the signature of the equals method of object A, then when using HashMap to store this object instance, which equals method will be called?
What is the mechanism of polymorphism in Java?
How to serialize a Java object into a file?
Talk about your understanding of Java reflection
Talk about your understanding of Java annotations
Talk about your understanding of dependency injection
Talk about the principle of generics and give examples
Understanding of String in Java
Why should String be designed to be immutable?
Override the equal and hashCode methods of the Object class. Why?
Three. Data structure
Introduction to common data structures
What do you know about concurrent collections?
List java collections and the inheritance relationship between collections
Collection class and collection framework
Introduction to container classes and the difference between them (container classes are estimated to be unheard of by many people. Java containers can be divided into 4 parts: List list, Set collection, Map mapping, tool class (Iterator iterator, Enumeration enumeration class, Arrays and Collections)
The difference between List, Set, Map
Implementation and storage methods of List and Map
The realization principle of HashMap
HashMap data structure?
HashMap source code understanding
How to put data in HashMap (from the perspective of HashMap source code)?
How to implement HashMap by hand?
The realization principle of ConcurrentHashMap
Comparison of ArrayMap and HashMap
HashTable implementation principle
TreeMap implementation
The difference between HashMap and HashTable
The difference between HashMap and HashSet
How do HashSet and HashMap determine that the set elements are duplicated?
How to prevent collisions when implementing Hash in Set
The difference between ArrayList and LinkedList, and application scenarios
The difference between array and linked list
Specific implementation of depth-first traversal and breadth-first traversal of binary trees
Heap structure
The difference between heap and tree
What is the difference between heap and stack in memory (answer hint: you can answer from the aspects of data structure and actual implementation)?
What is deep copy and shallow copy
Handwritten linked list reverse code
Talk about the understanding of trees, B+ trees
Talk about the understanding of the graph
Determine whether the singly linked list is a ring or not?
Linked list flip (ie: flip a single necklace table)
Merge multiple singly ordered linked lists (assuming that they are all increasing)
Four. Thread, multi-thread and thread pool
Three ways to start threads?
The difference between thread and process?
Why use threads instead of just processes?
The difference between run() and start() methods
How to control the number of threads that a method allows concurrent access to?
The difference between wait and seelp methods in Java;
Talk about the understanding of wait/notify keywords
What causes thread blocking?
How to close the thread?
Talk about the synchronization method in java
How to ensure data consistency?
How to ensure thread safety?
How to achieve thread synchronization?
Can two processes require writing or reading at the same time? How to prevent process synchronization?
List of operations between threads
The life cycle of objects in Java
Synchronized usage
Principle of synchronize
Talk about the understanding of Synchronized keywords, class locks, method locks, and reentry locks
Multithreaded access and function of static synchronized method
Two synchronized methods in the same class, the problem of simultaneous access by two threads
The principle of volatile
Talk about the usage of volatile keyword
Talk about the role of volatile keyword
Talk about the understanding of NIO
The difference between synchronized and volatile keywords
The difference between synchronized and Lock
Comparison of ReentrantLock, synchronized and volatile
Internal implementation of ReentrantLock
lock principle
Four necessary conditions for deadlock?
How to avoid deadlock?
Will object locks and class locks affect each other?
What is a thread pool and how to use it?
Java's concurrency, multithreading, threading model
Talk about the understanding of multithreading
What are the issues to pay attention to in multithreading?
Talk about your understanding of concurrent programming and give examples
Talk about your understanding of multi-thread synchronization mechanism?
How to ensure the safety of multithreading to read and write files?
Multi-threaded breakpoint resumable transfer principle
Realization of Resumable Transmission
Five. Algorithm
What are the sorting algorithms?
Which is the fastest sorting algorithm?
Handwriting a bubble sort
Handwritten quick sort code
Quick sort process, time complexity, space complexity
Handwritten heap sort
Heap sorting process, time complexity and space complexity
Write down the sorting algorithm you know, its complexity and stability
Binary tree gives root node and target node, find the path from root node to target node
Which algorithm should be chosen to sort Ali's more than 20,000 employees by age?
GC algorithm (the advantages and disadvantages of various algorithms and application scenarios)
Ant Colony Algorithm and Monte Carlo Algorithm
Substring inclusion problem (KMP algorithm) write code to achieve
An unordered, non-repeating array, outputs N elements, so that the sum of N elements is added to M, giving time complexity and space complexity. Handwriting algorithm
Two trillion-level URL files A and B, how to find the difference C of A and B (hint: Bit mapping -> hash grouping -> multi-file read and write efficiency -> disk addressing and application-level addressing optimization)
Six. Database related
What are the characteristics of MySQL InnoDB and Mysaim?
The difference between optimistic lock and pessimistic lock?
What is the database isolation level? what's the effect?
The basic principle of MySQL master-slave synchronization.
Select * from table t where size> 10 group by size order by size SQL statement execution order?
How to optimize database performance (index, sub-database and table, batch operation, paging algorithm, upgrade hard disk SSD, business optimization, master-slave deployment)
Under what circumstances will SQL not use indexes (exclude, not equal, function)
What field is generally indexed on (the field with the most filtered data)
How to find all rows whose name field does not contain "XYZ" from a table?
MySQL, B+ index implementation, row lock implementation, SQL optimization
Redis, RDB and AOF, how to make high availability, cluster
How to solve the problem of high concurrency and inventory reduction
Implementation mechanism of indexes in mysql storage engine;
Several granularities of database transactions;
Row lock, table lock; optimistic lock, pessimistic lock
Seven. Redis and other cache system middleware
List a common concurrency model for Redis clients.
How does HBase implement fuzzy query?
Enumerate a commonly used message middleware, how to realize the order if the message is to be preserved?
How to implement a Hashtable? How does your design consider Hash conflicts? How to optimize?
Distributed cache, consistent hash
LRU algorithm, slab allocation, how to reduce memory fragmentation
How to solve the problem of single-machine caching hot spots
What is a Bloom filter, and its implementation principle? What does false positive mean?
The difference between memcache and redis
What are the functions of zookeeper and how is the election algorithm performed?
Map/reduce process, how to use map/reduce to achieve joint statistics of two data sources
to sum up
Although you can find a job by brushing the interview questions, there is still a gap in the actual development. So finding a job is not necessarily the end. It is just the beginning. When you first start working, you will not develop your business or you will be eliminated. In the early stage, you still have to work harder and learn to adapt to the pace of work before you can really go. Go down. I hope everyone can work hard, find a job and not be eliminated, and find a satisfactory offer!
So far, these are the interview questions sent to me by my classmates, I hope it will be useful to you. If you want the answer to the information, you can click 795983544 to receive the secret code CSDN.