Since the Spring Festival, I, as a junior student, have been on an internship trip. I have had more than 30 interviews. Although it is very delicious, I have correspondingly taken some offers, such as five or six offers from JINGdong Finance and Renren Car

To sum up, spring moves are in one word: difficult.

No degree, skills ok, resume passable but interview a little difficult. During this period, I received discrimination from N interviewers, and some interviewers felt that they looked down upon us in their bones. The following content only by memory recall, there are some things to ask, summarized here, I hope to help you!

algorithm

This really can only rely on brush the question, dare not say each company to the written test of importance, anyway, the written test is basically must pass a pass

  • The queue.

  • The array.

  • The stack.

  • A linked list.

  • The tree.

  • Hash table.

  • The heap.

  • Figure.

  • Disordered tree: A tree in which there is no order between the children of any node is called a disordered tree or a free tree.

  • Ordered tree: A tree in which the children of any node have an ordered relationship is called an ordered tree.

  • Binary tree: A tree with a maximum of two subtrees per node is called a binary tree.

  • Perfect binary tree.

  • Full binary tree.

  • Inclined tree.

  • Balanced binary tree.

  • Huffman tree: The binary tree with the shortest weighted path is called a Huffman tree or an optimal binary tree.

  • A red-black tree.

And various traversal methods, printing by layer, statistical distances, and so on.

The tree is the foundation, the basic data structure also includes the graph, the graph traversal way.

DFS, BFS and all the pros and cons, greedy algorithms, backtracking, modeling, etc., can only be improved by brushing.

Computer network

  • GET/POST.
  • UDP/TCP.
  • TCP Three-way handshake. And it spawned a list of TCP problems: What is time-wait, why it can be three waves, why it can’t be two handshakes, flow control, sliding window, Nagle algorithm, Confused Window syndrome, Congestion control, slow start, Congestion avoidance, Fast retransmission, Fast recovery, long VS short connections, what are the application scenarios?
  • HTTP 1.0, 1.1, and 2.0.
  • Talk about the HTTPS process, what is SSL, what is asymmetric encryption, symmetric encryption, RSA concrete implementation.
  • What is the OSI layer 7 model, what are the protocols, and what is the TCP/IP layer 4?
  • Principles of DNS and ARP.
  • Address bar Enter what happened to the URL.
  • What WebSocket is.
  • Some network security issues, such as how to solve DOS attack, DNS spoofing, ARP spoofing, SQL injection, XSS, CSRF, IFrame security issues, local storage data issues, third-party dependency security issues.
  • HTTP is a protocol that does not save state, so how do you save user state?
  • What is the function of Cookie and what is the difference between Session and Cookie?
  • What is the implementation mechanism of the Session, precautions in a distributed environment, how to log out of a Session, how to set the Session duration, and the default Session duration?
  • What are the main differences between HTTP 1.0 and HTTP 1.1?
  • The relationship between various protocols and HTTP.
  • What servlets, filters, and listeners are, where they are used, and how the JSP page is processed.
  • What is the difference between request forwarding, URL redirection, and inclusion, and how to implement it?
  • How to check whether a port on a remote machine is enabled? Check the local IP address for domain name resolution.
  • In servlets, what’s the difference between calling a JSP to display an element and a mandatory String (that is, an API, typically JSON data)?
  • In nginx + Tomcat mode, how do I obtain the CLIENT request IP address on the server segment?
  • What is the life cycle of a Servlet.
  • Whether the Servlet is thread safe.

Java based

  • Describe the difference between pass-by-value and pass-by-reference.

  • What is the difference between equals and equals, how equals is overridden in String, why equals is overridden, why hashCode is overridden.

  • String s1 = new String(” ABC “), String s2 = “ABC”, s1 == s2. Statement 1 creates several objects in memory.

  • Why String is immutable, how String is defined in the JDK source code, and why it is designed that way.

  • Describe the use of static and final keywords.

  • What is the difference between an interface and an abstract class?

  • The difference between overloading and overwriting.

  • Talk about your understanding of XX.

  • It is the conversion of the basic type and the operation of the inverse complement of the original code.

  • What is the range of byte values and how to calculate them?

  • The difference between HashMap and Hashtable, the difference between HashMap and HashSet, the underlying implementation of HashMap, why the length of HashMap is a power of 2, why multithreaded operation of HashMap causes infinite loop problem, HashMap What are the thread safety implementations, the underlying implementation of ConcurrentHashMap.

  • Integer Indicates the cache pool.

  • Utf-8 and Unicode.

  • Char c = ‘in’ for utF-8 environment

  • What should we pay attention to when using the List obtained by Arrays.asList?

  • A Collection is different from a Collection.

  • You know fail-fast and fail-safe.

  • ArrayList versus LinkedList versus Vector.

  • The difference between Set and List, and how to ensure that the elements of Set are not repeated.

  • Utf-8 and GBK intertranslate, why garbled characters.

  • The difference between overloading and overwriting.

  • Why Java is an interpreted language.

  • Difference between ConcurrentHashMap 1.7 and 1.8: overall structure; Put () method, get () method, resize () method, size () method

  • Address bar Enter what happened to the URL.

  • The difference between composition and aggregation.

  • Talk about the CMS garbage collector.

  • JDK dynamic proxy and GClib dynamic proxy, the implementation principle of JDK dynamic proxy, CGLib dynamic proxy, and the comparison between them.

  • Threadlocal memory leak problem.

  • StringBuilder security is implemented and details how it is expanded.

MyBatis

  • Mybatis executes the process.

  • Mybatis cache.

  • The design pattern used by Mybatis.

Java lock

  • The lock type

  • Pessimistic lock VS optimistic lock

    The pessimistic lock represents the Synchronized keyword.

    Synchronized keyword implementation method.

    An optimistic lock represents a CAS operation.

    ABA problems caused by CAS.

    Long loop time and high overhead caused by CAS.

    CAS introduces the problem of atomic operations that guarantee only one shared variable.

    How CAS guarantees atomic operations.

    AtomticXXX implementation principle.

    The volatile keyword.

    Memory visibility reasons.

    The reason for prohibiting instruction reordering.

    The volatile keyword does not guarantee the cause of an atomic operation.

    Discussion of the volatile keyword.

    Occur-before rule introduction.

  • Reentrant lock, interruptible lock, fair lock, read/write lock

    Talk about understanding AQS.

    Reentrant lock.

    Interruptible lock.

    Fair lock.

    Read and write locks.

  • Biased lock/lightweight lock/heavyweight lock upgrade process.

  • supplement

    The spin lock.

    Subsection locking.

    Lightweight locks must be faster than weight locks.

Java multi-thread

  • The difference between threads and processes

    The state of the thread.

    Notify and wait.

    Thread.sleep() and thread.yield ().

    The concept of deadlock.

    The difference between concurrency and parallelism.

    Three elements of thread safety.

    How to achieve thread safety.

    A mechanism to ensure thread safety.

    Talk about the understanding of multithreading.

    The difference between the run and Start methods.

  • multithreading

    Method to create a thread.

    Thread pools create threads.

    ThreadPoolExecutor is introduced.

    BlockingQueue.

    ArrayBlockingQueue.

    LinkedBlockingQueue.

    The main difference between LinkedBlockingQueue and ArrayBlockingQueue.

    Handler rejects the policy.

    Thread pools have five states.

    Learn more about ThreadPoolExecutor.

    What is the function of the CTL property in the thread pool?

    The difference between shutdownNow and shutdown.

    Thread reuse principle.

    Soul Torture: How you set your thread pool parameters.

    The difference between CountDownLatch and CyclicBarrier.

  • Several ways of communication between multiple threads

    Use the volatile keyword.

    Locking mechanism.

    Final keywords.

    Ref;.

    The associated Lock class in the JUC package

Jvm memory Model

  • JVM memory Model

    Program counter (which records the current thread).

    Java stack (virtual machine stack).

    Local method stack.

    The heap.

    Methods section.

    Direct memory.

  • JVM Garbage Collection

    Garbage judgment standard.

    Reference counting.

    Accessibility analysis algorithm (root-cable method).

  • Garbage collection algorithm

    Mark clearing.

    Replication algorithm.

    Tag sorting.

    Generational recycling.

    GC Garbage collector.

  • Garbage collector

    Serial garbage collector (single threaded, copy algorithm) (new generation).

    ParNew Garbage collector (Serial+ multithreaded) (new generation).

    Parallel Scavenge (multithreaded replication algorithm, efficient).

    Serial Old Collector (single-threaded tag sorting algorithm)

    Parallel Old collector (multithreaded tag sorting algorithm).

    CMS collector (multithreaded marker cleanup algorithm) (old age).

    G1 Garbage collector.

  • Garbage collectors in current Web applications.

  • Throughput priority and response priority.

  • Minor GC and Full GC.

  • Full Gc triggering condition.

  • Object memory layout.

  • Why there are two survivor zones in the Cenozoic.

  • When an object is truly unavailable, it is marked twice.

MySQL

  • What is a database transaction and what are the four characteristics of a database transaction.

  • Give examples of phantom and non-repeatable reads and describe the differences between them.

  • What is the default isolation level for MySQL.

  • Why use indexes.

  • With all the advantages of indexes, why not create indexes for every field in the table?

  • How indexes speed up queries.

  • Name several cases where you know of index failure.

  • What are clustered indexes and non-clustered indexes

  • What are the main data structures used by MySQL indexes?

  • Talk about the difference between how InnoDb and MyISAM implement BTree indexes.

  • What is an overwrite index? Please give an example.

  • Talk about your understanding of the leftmost prefix principle.

  • What is the difference between InnoDb and MyISAM in MySQL?

  • Talk about how to optimize SQL.

  • How to analyze SQL execution efficiency with Explain.

  • Explain Explain the fields displayed.

  • Please describe the possible causes of database deadlocks and how they can be avoided.

  • What is the difference between optimistic and pessimistic locks in the database and what scenarios each applies to?

  • Talk about how optimistic and pessimistic locks are used in databases, based on your development experience.

  • The nature of indexes.

  • MySQL storage engine.

  • MySQL index

    Data structure, b-tree and B+Tree.

    B+Tree with sequential access pointer

    Physical storage of the index.

    What’s the difference between B+Tree and B-Tree?

    Why B+Tree is better for indexing files.

    Why not use an AVL tree or a red-black tree for indexing.

    Index storage mechanisms for both engines.

    MyISAM index implementation.

    InnoDB index implementation.

    Index invalidation condition.

    The index type

    Hash index.

    Ordered array.

    B+ tree index (InnoDB).

    Join indexes.

    Leftmost prefix rule.

    Overwrite the index.

    Index push-down.

Spring

  • The life cycle of Spring Beans

    Initialize the container.

    Bean property injection, change, and initialization.

    Use of beans.

    Close the container and destroy the Bean.

  • How does Spring address the cyclic dependency of beans

    Container cyclic dependencies.

    Setter loop dependency.

    Constructor cyclic dependencies

  • The Bean loading process

  • The difference between BeanFactory and FactoryBean

  • Bean registration and use

  • How Spring level 3 caching resolves circular dependencies.

  • Spring transactions, principles, propagation behavior, invalidation conditions.

  • AOP

  • IOC

  • SpringBoot automatic injection principle, Stater principle, and startup process.

  • Spring transaction management principles.

distributed

  • What protocols are supported by Dubbo, the application scenarios of each protocol, and their advantages and disadvantages?

  • How to set the Dubbo timeout period.

  • What registries Dubbo has.

  • What are the load balancing policies for the Dubbo cluster?

  • Main application scenarios of Dubbo.

  • The core functionality of Dubbo.

  • Core components of Dubbo.

  • Process of Dubbo service registration and discovery.

  • Dubbo’s service invocation process.

  • What protocols are supported by Dubbo, the application scenarios of each protocol, and their advantages and disadvantages?

  • Dubbo’s registry cluster is down. Can publishers and subscribers communicate with each other?

  • Dubbo’s relationship to Spring.

  • What communication framework does Dubbo use.

  • What are Dubbo’s cluster fault tolerant solutions?

  • Which serialization modes Dubbo supports.

zookpeer

  • Zookpeer Indicates the node type.

  • Functions of zookpeer.

  • Watcher mechanism of Zookpeer.

  • Zookpeer how to implement distributed locking.

  • Zookpeer election algorithm.

  • Paxos algorithm.

  • Raft algorithm.

  • ZAB agreement.

  • What is a distributed transaction.

    Distributed transaction solutions.

    Know about Seata.

    Consistent hashing?

    Hash slot, and why it’s two to the fourteenth.

  • SpringCloud components?

  • What is Hystrix and how it implements fault tolerance.

  • What is RestTemplate?

  • What is Ribbn.

  • Nacos /Eureka comparison.

  • What is zuul?

  • What is Getway.

  • What is Config.

  • What are microservices

    What is SOA.

    The difference between SOA and microservices.

  • Why use microservices.

  • Problems with using microservices and solutions.

  • How microservices communicate with each other.

  • How microservices are discovered.

  • Micro service hung, how to solve.

  • Retry mechanism, idempotence.

    Current limiting

    Circuit breaker, downgrade

Linux

  • What are the common Linux commands? Examples

  • How to write the Linux command for querying the usage of port 3306?

  • Linux to view a Java process id PID, how to operate it.

  • Process communication mode.

  • Process, thread, coroutine.

  • Process scheduling algorithm.

  • I/O model under Liunx.

  • User mode, kernel mode.

  • How to reduce kernel mode to user mode copy (MMAP).

  • Common commands.

  • View logs.

How to review

Generally speaking, Java is nothing more than: JUC, multi-threading, locking, collection, basic knowledge, framework, distributed.

A body of knowledge must be learned together,

For example, JUC, which is a big package, the system learning will be more time consuming, but the benefits are also relatively good, can some details of the points are connected, so that the memory is more profound

For example, HashMap can be crumbled to learn, why 0.75 load factor, why unsigned right shift 16 bits? Why is it a multiple of 2? Why an eight and not a seven or a nine?

** tools are easy to replace, ** SSH is now spring-boot, Cloud, maybe a few years later is a new pattern, but the underlying technology is the same principle, understand the bottom, not only help to troubleshoot problems, for the program ape the whole promotion path, It is a good way of thinking and learning.

Taboo east a hammer, west a hammer study, so knowledge in order to deal with the interview, the interview, it is easy to forget.

Usually in this order:

  • Look at the source code, dig out the details

  • See the corresponding explanation of blogs and public accounts

  • Summarize it for yourself and write it in your MD file or blog

  • Review it a week later, or a few days later, (Ebbinghaus forgetting curve)

Brush the topic

Brush topic two good places:

  • Ox guest, also I recommend everybody to go, all topic is free, and basically have big guy discussion

  • LeetCode, this is also ok, but there will be a corresponding charge, VIP and so on

Bytedance is very fond of algorithms, almost every side will have at least two algorithm problems, so to get into the byte, at least two months algorithm problems brush up.

Don’t say that algorithms don’t matter. Programmers can’t handle algorithms any more than cooks can handle spoons or drivers can handle gears.