In this paper, starting from cartoon blogs reprint please indicate the source: cartoonyu. Making. IO/cartoon – bio…

JAVA based

  1. The difference between abstract classes and interfaces
    1. Class level
      1. Neither abstract classes nor interfaces can be instantiated
      2. Abstract classes can inherit only one direct parent and implement multiple interfaces. An interface can inherit multiple interfaces
      3. Abstract classes are mostly used as template classes, and interfaces are used to regulate behavior between modules
    2. methods
      1. Abstract classes can have abstract methods, static methods, and ordinary methods. Interfaces can only be abstract methods
      2. An abstract class has the same method scope as a normal class; Interface methods can only be public
      3. Abstract classes can implement their own logic by referring to each other’s methods, whereas interfaces can only implement logic by subclasses
      4. Abstract classes can have constructors; interfaces have no constructors
    3. variable
      1. Abstract classes can have member and static variables, and interfaces can only have final static variables
  2. What member methods does the Object class have
    1. wait/notify
    2. clone
    3. hashCode/equals
    4. getClass
    5. finalize
    6. What are the methods of cloning
      1. Implement Cloneable override clone method
      2. Implement the Serialize interface
  3. What are the methods for Collections
    1. Returns a thread-safe class
      1. synchronizedXxx
    2. Returns an immutable collection
      1. emptyXxx
      2. singletonXxx
      3. unmotifitableXxx
    3. Conversions between sets
    4. Operates on elements in a collection
      1. Adds elements to the collection
        1. addAll
        2. copy
      2. Look for the element
        1. binarySearch
        2. frequency
        3. indexOfSubList
        4. shuffle
      3. replace
        1. fill
        2. replaceAll
      4. Change element position
        1. sort
        2. swap
        3. rotate
        4. reverse
      5. Element contrast
        1. min/max
        2. disJoint
  4. Java common exception classes
    1. The system level
      1. IllegalAccessException
      2. OutOfMemoryException
    2. The class level
      1. ClassNotFoundException
      2. ClassDefFoundException
    3. Object level
      1. NullPointerException
      2. ClassCastException
      3. CloneNotSupportedException
      4. NoSuchFieldException
      5. InstantiationException
    4. Method level
      1. IllegalArgumentException
      2. NoSuchMethodException
    5. Operating level
      1. digital
        1. ArithmeticException
        2. NumberFormatException
      2. An array of
        1. ArrayStoreException
        2. IndexOutOfBoundException
      3. IO
        1. IOException
        2. FileNotFoundException
        3. EOFException
      4. The database
        1. SQLException
      5. thread
        1. InterruptedException
  5. What is the class loading mechanism
    1. steps
      1. loading
      2. check
      3. To prepare
      4. parsing
      5. Initialize the
      6. use
      7. uninstall
    2. How the parental delegation model works
      1. Class loader
        1. BootstrapClassLoader
        2. ExtensionClassLoader
        3. ApplicationClassLoader
        4. UserClassLoader
      2. When a class is loaded into memory, the parent loader is asked layer by layer if it can be loaded, and if all the parent loaders cannot be loaded, the current class loader is responsible for loading
      3. The reason for doing this is to ensure that the class is unique
  6. Expansion mechanism of HashMap
    1. The capacity mechanism of a HashMap relies on three elements: capacity (default: 16), loadFactory load factor, and size
    2. When the current number of elements is greater than 8, the internal array is automatically converted to a red-black tree for storage
    3. When the current number of elements is greater than the initial capacity x load factor, the array is expanded twice and the positions of the internal elements are re-hashed
    4. When the current number of elements is less than 0.1 times the initial size, the array is halved and the same element positions need to be hashed again
  7. ArrayList capacity expansion mechanism
    1. ArrayList capacity expansion depends on the comparison of size(the current number of elements) and capacity(default 10)
    2. If the element is larger than integer. MAX_VALUE, raise OOM
  8. ArrayList is different from LinkedList
    1. ArrayList is an array and LinkedList is a bidirectional list
    2. The new element
      1. ArrayList involves array expansion (or along with arrayCopy)
      2. LinkedList changes pointer to (or along with traversal)
    3. Remove elements
      1. ArrayList requires an arrayCopy
      2. LinkedList traverses the LinkedList and modifies the pointer to
    4. ArrayList size is affected by integer.max_value, LinkedList size is theoretically infinite (affected by maximum memory for JVM calls)
    5. ArrayList inserts elements in consideration of the current capacity and arrayCopy operations, LinkedList inserts do not require additional operations
  9. Array is different from ArrayList
    1. Storage type
      1. Array: basic data types and objects
      2. ArrayList: only objects
    2. Size limit
      1. Array: specified at definition and cannot be enlarged or shrunk
      2. ArrayList: this parameter is not specified (the initial value is 10) and can be expanded
    3. Insert elements
      1. Array: Inserting basic data type elements does not involve unpacking or unpacking
      2. ArrayList: Involves unpacking and unpacking
  10. Poll differs from remove in Queue
    1. Poll and remove both fetch the header element
    2. When the queue is not empty, the result of the two methods is the same
    3. The queue is empty
      1. Poll returns null
      2. Remove throw NoSuchElementException
  11. How is a thread unsynchronized set converted into a thread synchronized set
    1. Returned via the Collections utility class
      1. Locks are read/write locks, and the granularity of locks is object-level
    2. Wrapped through java.util.concurrent
      1. The lock is a write lock and the granularity of the lock is element level
    3. It is usually wrapped as Concurrent

JVM

  1. Garbage collection algorithm
    1. Mark-clear
      1. Tag does not clean up objects, but cleans up unmarked objects
      2. Fast, but memory fragmentation
    2. copy
      1. Divide memory into two areas: clean area and live area
      2. Move uncleared objects to the live zone and delete all objects in the clean zone
      3. Waste of space
    3. Mark-tidy
      1. Tag does not clean up objects, but cleans up unmarked objects
      2. Move collate live objects
      3. High cost, but effectively solve the memory fragmentation problem
  2. G1 Workflow
    1. Initial flag (pause thread)
      1. Flag the GC Root directly associated object
    2. Concurrent tags
      1. Analyze the reachability of objects in the heap from GC Root
    3. Final tag (pause thread)
      1. Merge data from the Remembered Set Logs into Remembered Set in parallel
    4. Screening of recycling
      1. Make recovery plan according to recovery value and cost of each Region

Spring

  1. What modules are available in Spring
    1. Spring Core
    2. Spring AOP
    3. Spring ORM
    4. Spring Dao
    5. Spring Web
    6. Spring Context
    7. Spring Web MVC
  2. The Spring MVC process
    1. Requests are processed via DispatchServlet
      1. Normal logic processing is handled by the Controller, which returns to model
      2. View processing, DispatchServlet calls View Temlate for View return
  3. AOP concepts
    1. AOP is faceted oriented programming, which complements OOP by treating originally vertical programs as a collection of facets
    2. Dynamically inserts execution logic into the original execution flow
    3. Advice: Concrete implementation logic
    4. JoinPoint: the place to use the notification
    5. PointCut: Specifies the join point location where advice is used
    6. Aspects: Collections of advice and pointcuts
    7. Introduction: Add new method attributes to an existing class
    8. Target: The notified object
    9. The agent (proxy)
    10. Static agent
    11. A dynamic proxy
    12. Weaving: The process of generating proxy objects by referring aspects to target objects
  4. Scope of the Spring bean
  5. The singleton (default)
  6. prototype
  7. request
  8. session
  9. globalSession

The database

  1. # and $in MyBatis
    1. Incoming data
      1. #: pass it into SQL as a string, equivalent to a PrepareStatement
      2. $: Directly passes the parameter into SQL
    2. security
      1. # prevents SQL injection, $does not
  2. Four characteristics of transactions
    1. consistency
      1. Transaction execution is consistent before and after
    2. atomic
      1. The result of an operation is the same in a transaction
    3. Isolation,
      1. The operations between transactions are isolated from each other
    4. persistence
      1. The execution result of a transaction is permanent
  3. Char is different from varchar
    1. The length of char is fixed, the length of varchar is unfixed
    2. Char is padded with Spaces to the specified length, varchar is not
    3. Char data is followed by Spaces removed, not vARCHar
    4. Char has a higher retrieval efficiency than VARCHAR
  4. Logical paging versus physical paging
    1. Logical paging loads all the data into memory and returns the paging results using code logic
    2. Physical paging is paging at the database level
  5. MyBatis paging mode
    1. An array of paging
    2. SQL paging
    3. Interceptor paging
    4. RowBounds paging
  6. Database three paradigm
    1. The first paradigm
      1. Attributes are already indivisible units of data
    2. The second paradigm
      1. All non-primary attributes are completely dependent on candidate attributes
    3. The third paradigm
      1. There are no transition-dependent candidate attributes
  7. Inner connection outer connection difference
    1. The inner join returns only the eligible common records
    2. The outer join returns all the records of the table and inserts the columns that match the criteria

The operating system

  1. The difference between thread and process
    1. A process is the smallest unit of time that an operating system allocates resources, and a thread is an entity that is invoked within a process
    2. Different processes have different address Spaces allocated by the operating system, and different threads of the same process share the memory address of the parent process
    3. Process resources and space are allocated by the operating system, and thread resources and space are allocated by the process
    4. Process switching costs more than threads
    5. A process crash does not affect other processes. A thread crash causes the parent process to die
    6. A process has an entry point through which the program runs, and threads live on the process

network

  1. What are the HTTP methods
    1. methods
    2. get
    3. post
    4. delete
    5. put
    6. options
    7. connect
    8. trace
    9. link
    10. unline
    11. head
    12. Get vs. Post
      1. Power etc.
        1. Get is an idempotent operation and POST is a non-idempotent operation
      2. The data transfer
        1. Get data is transmitted through URLS, and POST data is transmitted through HTTP packets
        2. The size of GET data is limited by the URL length, while that of POST data is not limited
      3. cacheable
        1. Get data can be cached, but POST data cannot be cached
      4. The HTTP message
        1. The GET packet has no entity, and the POST packet has entity
  2. The difference between forward and redirect
    1. Behavior of party
      1. Forward is the browser behavior
      2. Redirect is the server behavior
    2. Does the URL change
      1. The forward url remains the same
      2. Redirect url change
    3. Resource consumption
      1. Forward consumes less resources than redirect
    4. Data sharing
      1. The Redirect does not share data. The Forward can share request data
    5. The efficiency of
      1. Forward high
      2. Redirect low
  3. TCP three-way handshake
    1. One handshake (client initiated)
      1. Create a TCB
      2. Send the SYN = 1, seq = x
      3. Enter the SYN – SENT
    2. Secondary handshake (server initiated)
      1. An ACK = 1, syn = 1, ACK = y + 1, seq = x + 1
      2. Enter the SYN – RCVD
    3. Three-way handshake (client initiated)
      1. An ACK = 1, seq = x + 1, ACK = x + 1
      2. Enter the ESTABLISHED
  4. UDP is different from TCP
    1. TCP is connection-oriented, UDP is not
    2. TCP has congestion control, but UDP does not
    3. TCP has a high resource cost and UDP has a low resource cost
    4. TCP supports one-to-one, UDP supports one-to-many
    5. TCP provides reliable transport and UDP delivers wherever possible
    6. TCP byte stream oriented and UDP packet oriented

Design patterns

  1. Three methods of singleton pattern implementation

    1. www.cnblogs.com/ngy0217/p/9…
    2. Static inner class
    3. LanHanShi
    4. Double check
  2. BIO NIO AIO

    1. BIO
      1. A synchronized block
      2. The thread blocks to perform the operation and returns the result
    2. NIO
      1. Synchronous nonblocking
      2. Requests share a single thread for processing
      3. The thread returns the result directly to the request
    3. AIO
      1. Asynchronous nonblocking
      2. After processing, the thread returns the result via a callback
  3. reflection

    1. The JAVA reflection mechanism allows you to know all the properties and methods of any class in the running state. For any object, you can call any of its methods and properties;
    2. Dynamic proxy and static proxy