In order to facilitate the subsequent review of the interview, I have summarized all kinds of interview questions. Each question is selected by myself and I feel that I need to master it. This compilation includes Java, data structures and algorithms, computer networks, operating systems, and databases. Wait. I will release the answers to these questions later. For more interview questions plus interview answers and learning materials, click here to get them for free! !
1. Java
(1). Basic knowledge of Java
- The difference between == and equals and hashCode in java
- The difference between int and integer
- The meaning of abstract classes
- The difference between interface and abstract class
- Is it possible to create an immutable object that contains mutable objects?
- Talk about the understanding of java polymorphism
- String、StringBuffer、StringBuilder区别
- The difference between extends and super in generics
- The difference between process and thread
- The difference between final, finally, finalize
- Serialization method
- The way and principle of converting string to integer
- Can static properties and static methods be inherited? Can it be rewritten? And why?
- Understanding of member inner classes, static inner classes, partial inner classes and anonymous inner classes, and the application in the project
- Tell me about common encoding methods?
- How to format the date?
- Java exception system
- What is an exception chain
- The difference between throw and throws
- The principle of reflection, what are the three ways that reflection creates class instances.
- Four references in java
- What is the difference between deep copy and shallow copy?
- What are compiler constants? What are the risks of using it?
- Are you familiar with the intern() of String objects?
- Is there any difference between a=a+b and a+=b?
- What is the difference between static proxy and dynamic proxy, in what scenarios?
- 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?
For more interview questions plus interview answers and learning materials, click here to get them for free! !
(2). Multithreading
- Three ways to start threads?
- Talk about the difference between process, thread, coroutine
- How do the threads communicate?
- What is a Daemon thread? What does it mean?
- What is the difference between daemon thread and local thread in java?
- Why use threads instead of just processes?
- What is a reentrant lock (ReentrantLock)?
- What is a thread group, and why is it not recommended in Java?
- The understanding of optimistic lock and pessimistic lock and how to realize it, what are the ways to realize it?
- What is the thread scheduling algorithm used in Java?
- Synchronization method or synchronization block, which is a better choice?
- 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;
- What is the function of the yield method in the Thread class?
- What is an immutable object, and how does it help to write concurrent applications?
- Talk about the understanding of wait/notify keywords
- Why wait, notify and notifyAll are not in the thread class?
- What causes thread blocking?
- Talk about the synchronization method in java
- 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
- How do you ensure that the thread where the main() method is located is the thread where the Java program ends?
- Talk about the role of volatile keyword
- Talk about the role of ThreadLocal keyword
- Talk about the understanding of NIO
- What are Callable and Future?
- The difference between ThreadLocal, synchronized and volatile keywords
- The difference between synchronized and Lock
- Comparison of ReentrantLock, synchronized and volatile
- What is the difference between CycliBarriar and CountdownLatch in Java?
- What application scenarios can CopyOnWriteArrayList be used for?
- Internal implementation of ReentrantLock
- lock principle
- What is Semaphore in Java?
- What is the difference between invokeAndWait and invokeLater in Java?
- What is the busy loop in multithreading?
- How to detect whether a thread owns a lock?
- Four necessary conditions for deadlock?
- Will object locks and class locks affect each other?
- What is a thread pool and how to use it?
- What is the difference between the submit() and execute() methods in the Java thread pool?
- What is the difference between interrupted and isInterruptedd methods in Java?
- Implement blocking queue in Java
- Introduction to BlockingQueue:
- What are the issues to be aware of for multithreading?
- How to ensure the safety of multithreading to read and write files?
- Multi-threaded breakpoint resumable transfer principle
- Realization of Resumable Transmission
- Implement the producer consumer model
- What is ReadWriteLock in Java?
- Writing a program in Java that will cause a deadlock, how would you solve it?
- Is SimpleDateFormat thread safe?
- What is the difference between synchronous collection and concurrent collection in Java?
- What is the concurrency of ConcurrentHashMap in Java?
- What is the Java Timer class? How to create a task with a specific time interval?
(3). Collection
- What is the difference between Collection and Collections?
- 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?
- The difference between List, Set, Map
- Implementation and storage of List and Map
- The realization principle of HashMap
- How to put data in HashMap (explained from the perspective of HashMap source code)?
- How is the expansion operation of HashMap realized?
- What are the differences between HashMap in JDK1.7 and JDK1.8?
- The realization principle of ConcurrentHashMap
- HashTable implementation principle
- Comparison of ArrayMap and HashMap
- The difference between HashMap and HashTable
- The difference between HashMap and HashSet
- How to prevent collisions when implementing Hash in Set
- The difference between array and linked list
- What is the difference between Array and ArrayList? When is it better to use Array
- What is .EnumSet?
- What is the difference between Comparable and Comparator interfaces?
- The fast failure mechanism of Java collection "fail-fast"?
- What is the difference between fail-fast and fail-safe?
- What is BlockingQueue?
- What is the role of the Iterator class
- What is the difference between poll() method and remove() method?
- Why did JAVA8's ConcurrentHashMap give up the segment lock? Is there any problem? If you design it, how do you design it.
(4).JVM
- Under what circumstances will trigger the initialization of the class?
- Talk about your understanding of resolution and dispatch.
- What do you know or what GC strategy do you use online? What are its advantages and what scenarios is it suitable for?
- The Ja0v00a class loader includes 00 including 0? What is the sub-relationship between them? What does the parental delegation mechanism mean? what is the benefit?
- How to customize a class loader? Which ones have you used or in what scenarios do you need a custom class loader?
- What are the parameters for heap memory settings?
- What data is stored in Perm Space? Will it cause OutOfMemory?
- When doing GC, what is the order in which an object is moved in each Space in the memory?
- Have you encountered the OutOfMemory problem? How do you deal with this problem? What are the gains in the process?
- Have you encountered StackOverflow exceptions? Normally you guess under what circumstances will it be triggered? How to specify the stack size of a thread? How much do you write in general?
- The memory model and partitions need to be detailed to what to put in each area.
- Dispatching: static dispatch and dynamic dispatch.
- What are the optimization strategies for virtual machines at runtime
- Please explain the difference between StackOverflowError and OutOfMemeryError?
- . In the JVM, how to determine whether an object is dead?
computer network
- Load a 10M picture from the network and talk about the precautions
- OSI network architecture and TCP/IP protocol model
- TCP's 3-way handshake and four waved hands
- Why does the TCP connection require a three-way handshake, but not twice? Why?
- How does TCP protocol ensure the reliability of transmission
- The difference between TCP and UDP
- What are the applications of TCP and UDP
- The difference between HTTP1.0 and 2.0
- HTTP message structure
- Long and short HTTP connections?
- The difference between HTTP and HTTPS and how to achieve security
- How to verify the validity of the certificate
- The difference between Get and POST
- TCP congestion handling
- How TCP performs flow control
- Common application layer protocols corresponding to TCP and UDP
- Classification of IP addresses
- Why do I need an IP address if I have a unique Mac address?
- What is the difference between a switch, a hub and a router?
- The role of bridges
- ARP is an address resolution protocol. Explain the working principle in simple language.
- What is the function of the network interface card (network card)?
- The difference between synchronous and asynchronous, blocking and non-blocking in IO
- The difference between URI and URL
- The meaning of URL encoding in GET request
- Common status codes and reason phrases
- Talk about Session, Cookie and Application
- How to avoid browser caching
- What is block transfer.
- Talk about SQL injection
- DDos attack
- What are the prevention methods for DDos attacks?
- What is XSS attack
- The process from entering the URL to getting the page
Data Structures and Algorithms
This part will manually implement some data structures, I have summarized the following important data structures
data structure
- Linked list (add, delete, check operation)
- Singly linked list
- Doubly linked list
- Queue (add, delete, check operation)
- Normal queue
- Priority teammate
- tree
- Binary tree (preorder, middle order, postorder)
- Balance tree (try to implement the code as much as possible)
- heap
- Red-black tree (understand the nature and application scenarios)
- B tree (understand the nature and application scenarios)
- Figure
- Depth first search
- Breadth first search
- Shortest path
- Minimum spanning tree
- Prim algorithm
- Kruskal algorithm
- Topology
- String
- Knuth-Morris-Pratt algorithm
- Boyer-Moore algorithm
For more interview questions plus interview answers and learning materials, click here to get them for free! !
Several algorithm ideas
- Recursion
- Recursion
- greedy
- enumerate
- Dynamic programming
- Backtracking
- Divide and conquer
Top ten sorting algorithms you must learn
- Select sort
- Insertion sort
- Bubble Sort
- Hill sort
- Merge sort
- Quick sort
- Heap sort
- Count sort
- Bucket sort
- Base sort
Brush questions
Niukewang Jianzhi offers six to seventy questions
leetcode
database
- Please briefly describe the names of the four transaction isolation levels supported by InnoDB in Mysql and the differences between each level?
- What is the usage of ENUM in Mysql?
- The difference between CHAR and VARCHAR?
- How the transaction is realized through the log, the more in-depth the better
- The difference between drop, delete and truncate
- The principle of locality and disk read-ahead
- Database paradigm
- The difference between stored procedures and triggers
- Lock optimization strategy
- Under what circumstances is the index set but cannot be used
- Under what circumstances should not be indexed?
- Explain the difference between MySQL outer connection, inner connection and self connection
- What are the integrity constraints?
- Mysql storage engine, the difference between myisam and innodb.
- How to optimize SQL
- What are optimistic locks and pessimistic locks? What are the two types of INNODB's standard row-level locks? Explain their meanings.
- The meaning of MVCC and how to achieve it
- How to solve the master-slave delay of MYSQL.
spring
1. Spring overview
- What are the benefits of using the Spring framework?
- What modules does Spring consist of?
- Explain the AOP module
- Explain the WEB module
- Core container (application context) module.
- 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 is the difference between Bean Factory and Application Contexts?
2. Spring dependency injection
- What is dependency injection in Spring?
- What are the different types of IOC (dependency injection) methods?
- What are Spring beans?
- What does a Spring Bean definition include?
- Explain the scope of several beans supported by Spring.
- Are singleton beans in the Spring framework thread safe?
- Explain the life cycle of beans in the Spring framework
- What are the important bean life cycle methods? Can you overload them?
- What is bean assembly?
- What is automatic assembly of beans?
- Explain the different ways of automatic assembly.
- What are the limitations of automatic assembly?
3. Spring annotation
- How to turn on annotation assembly?
- Talk about @Required, @Autowired, @Qualifier annotations.
4. Spring data access
- How to use JDBC more efficiently in the Spring framework?
- How to access Hibernate using Spring?
- What are the advantages of Spring Framework transaction management?
5. Spring aspect-oriented programming (AOP)
- Explain AOP
- Aspect
- What is the difference between focus and crosscutting focus in Spring AOP?
- Notice
- How many different types of automatic agents are there?
- What is weaving. What are the differences in weaving applications?
6. springMVC
- What is Spring's MVC framework?
- DispatcherServlet
- WebApplicationContext
- What is the controller of the Spring MVC framework?
- @Controller annotation
- @RequestMapping annotation
JavaWeb
servlet与Tomcat
- Servlet life cycle
- The difference between forward and redirect
- How does tomcat container create servlet class instance? What principle was used?
- What is a cookie? What is the difference between Session and cookie?
- Servlet security issues
- What kinds of connector operating modes (optimization) does Tomcat have?
JSP
- The difference between jsp static inclusion and dynamic inclusion
- What are the built-in objects of jsp? What are their functions?
- What is the difference between jsp and servlet, what are they in common, and the scope of their respective applications?
- Write 5 common JSTL tags
- How is JSP executed? Is the execution efficiency lower than SERVLET?
- Tell the difference between Servlet and CGI?
- Briefly describe the design pattern of JSP.
At last
Later, I will find some other questions, such as redis, message queues and some situational questions. I will put so many for the time being, and I will give answers later.