This year's market is so bad, how do you enter a big factory?

After the Spring Festival, I, a junior student who was not a stubborn student, embarked on an internship trip and interviewed no less than thirty times. Although it was very good, I took some offers accordingly, such as Jingdong Finance People and cars waiting for five or six offers

To sum up, the spring move is one word: difficult.

No education, good technology, resume can pass but the interview is a bit difficult. During this period, I received discrimination from N interviewers. Some interviewers felt that they looked down on us, those of us who are not right. The following content is only recalled from memory, and there are some things that must be asked. Summarized here, I hope to help everyone!

algorithm

This really depends on brushing questions. I dare not say how much each company attaches importance to the written test. Anyway, the written test is basically a pass

  • queue.

  • Array.

  • Stack.

  • Linked list.

  • tree.

  • Hash table (hash table).

  • stack.

  • Figure.

  • Unordered tree: There is no order relationship between the child nodes of any node in the tree. Such a tree is called an unordered tree, also known as a free tree.

  • Ordered tree: There is an order relationship between the child nodes of any node in the tree. This kind of tree is called an ordered tree.

  • Binary tree: A tree with up to two subtrees per node is called a binary tree.

  • Completely binary tree.

  • Full of binary trees.

  • Inclined tree.

  • Balance the binary tree.

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

  • Red black tree.

And various traversal methods, printing by layers, statistical distance, etc.

The tree is the foundation. The basic data structure also includes graphs and graph traversal methods.

DFS, BFS, various advantages and disadvantages, greedy algorithms, backtracking, modeling, etc. can only be improved by brushing questions.

computer network

  • GET / POST difference.
  • UDP / TCP difference.
  • TCP three-way handshake. And a series of TCP-derived problems: what is TIME-WAIT, why can it be a three-way wave, why not a two-way handshake, flow control, sliding window, Nagle algorithm, confused window syndrome, congestion control, slow start, congestion What to avoid, fast retransmission, fast recovery, long connection vs short connection, application scenarios.
  • HTTP 1.0、1.1、2.0。
  • Talk about the process of HTTPS, what is SSL, what is asymmetric encryption, symmetric encryption, and RSA specific implementation.
  • What is the seven-layer OSI model, what protocols are there, and what is the four-layer TCP / IP.
  • Principles of DNS and ARP protocols.
  • Enter what happened to the URL in the address bar.
  • What is WebSocket.
  • Some network security issues, such as how to solve DOS attacks, how to resolve DNS spoofing, ARP spoofing, SQL injection, XSS, CSRF, iframe security issues, local storage data issues, security issues that third parties rely on.
  • HTTP is a protocol that does not save state, so how to save user state.
  • What is the role of cookies and what is the difference between Session.
  • What is the implementation mechanism of Session, what are the precautions in a distributed environment, how to operate if you log out of Session, set the duration of Session, and what is the default duration.
  • What are the main differences between HTTP 1.0 and HTTP 1.1.
  • The relationship between various protocols and the HTTP protocol.
  • What are Servlet, Filter, and Listener respectively, where are they used, and how to handle JSP pages.
  • What is the difference between request forwarding, URL redirection and inclusion, and how to achieve it.
  • How to determine whether a port is opened on the remote machine, the project needs to check the local resolution IP of the domain name, how to operate.
  • In Servlet, what is the difference between calling JSP to display the element and returning String (that is, api, generally json data).
  • In nginx + tomcat mode, how does the server segment get the client request IP.
  • What is the life cycle of Servlet.
  • Whether the Servlet is thread safe.

Java basics

  • Describe the difference between value passing and reference passing.

  • == What is the difference between equals, how to rewrite the equals method in String, why to rewrite the equals method, and why to rewrite the hashCode method.

  • String s1 = new String ("abc"), String s2 = "abc", s1 == s2. Statement 1 creates several objects in memory.

  • Why is String immutable, how is String defined in the jdk source code, and why is it so designed.

  • Please describe the usage of static keyword and final keyword.

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

  • The difference between overloading and rewriting.

  • Three object-oriented features, talk about your understanding of xx.

  • It examines the conversion of basic types and the operation of the complement of the original code.

  • What is the value range of byte and how is it calculated?

  • Related to HashMap, 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, the multi-thread operation of HashMap leads to an endless loop problem, what are the thread safety implementations of HashMap, and the underlying implementation of ConcurrentHashMap .

  • Integer cache pool.

  • The relationship between UTF-8 and Unicode.

  • The project is UTF-8 environment, char c = 'medium', is it legal.

  • What should be paid attention to when using List obtained by Arrays.asList.

  • The difference between Collection and Collections.

  • Do you know fail-fast and fail-safe.

  • The difference between ArrayList and LinkedList and Vector.

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

  • Why does UTF-8 and GBK transfer garbled characters?

  • The difference between overloading and rewriting.

  • Why Java is an interpreted language.

  • The difference between ConcurrentHashMap 1.7 and 1.8: overall structure; put () method, get () method, resize () method, size () method

  • Enter what happened to the URL in the address bar.

  • The difference between combination and aggregation.

  • Talk about the CMS garbage collector.

  • JDK dynamic agent and GClib dynamic agent, JDK dynamic agent specific implementation principle, CGLib dynamic agent, the comparison of the two.

  • Threadlocal memory leak.

  • How StringBuilder security is implemented, detailed description of how to expand capacity.

MyBatis

  • Mybatis execution process.

  • Mybatis cache.

  • The design pattern used by Mybatis.

Java lock

  • Lock type

  • Pessimistic lock vs optimistic lock

    Pessimistic locks represent Synchronized keywords.

    Synchronized keyword implementation method.

    Optimistic locking represents CAS operations.

    ABA problems caused by CAS.

    The long cycle time caused by CAS is a big problem.

    CAS brings about the problem of atomic operations that can only guarantee a shared variable.

    How CAS guarantees atomic operations.

    The principle of AtomticXXX implementation.

    The volatile keyword.

    Reasons for memory visibility.

    Reasons for prohibiting instruction reordering.

    The volatile keyword cannot guarantee the cause of atomic operations.

    Discussion about the volatile keyword.

    The introduction of happen-before rules.

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

    Talk about your understanding of AQS.

    Reentrant lock.

    Interruptible lock.

    Fair lock.

    Read-write lock.

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

  • supplement

    Spin lock.

    Segment lock.

    Are lightweight locks faster than heavyweight locks?

Java multithreading

  • The difference between threads and processes

    The state of the thread.

    Notify 和 wait 。

    Similarities and differences between 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 understanding multithreading.

    The difference between the run and start methods.

  • Multithreading

    The method of creating threads.

    The thread pool creates threads.

    ThreadPoolExecutor introduction.

    BlockingQueue。

    ArrayBlockingQueue。

    LinkedBlockingQueue。

    The main difference between LinkedBlockingQueue and ArrayBlockingQueue.

    handler rejection strategy.

    Five states of thread pool.

    Deep understanding of ThreadPoolExecutor.

    What is the role of the ctl attribute in the thread pool.

    The difference between shutdownNow and shutdown.

    The principle of thread reuse.

    Soul torture: How do 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 keyword.

    ThreadLocal 类。

    Related lock classes in the JUC package

Jvm memory model

  • JVM memory model

    Program counter (record the current thread).

    Java stack (virtual machine stack).

    Local method stack.

    stack.

    Method area.

    Direct memory.

  • JVM garbage collection

    Judgment criteria for garbage.

    Reference counting method.

    Reachability analysis algorithm (root cable method).

  • Garbage collection algorithm

    The mark is cleared.

    Copy algorithm.

    Mark up.

    Generational recycling.

    GC garbage collector.

  • Garbage collector

    Serial garbage collector (single thread, replication algorithm) (new generation).

    ParNew garbage collector (Serial + multi-threaded) (new generation).

    Parallel Scavenge collector (multi-threaded replication algorithm, high efficiency) (new generation).

    Serial Old Collector (Single-Thread Mark Sorting Algorithm) (Old Generation).

    Parallel Old Collector (multi-thread mark sorting algorithm) (old generation).

    CMS collector (multi-thread mark removal algorithm) (old generation).

    G1 garbage collector.

  • The current garbage collector in web applications.

  • Throughput priority and response priority.

  • Minor GC and Full GC.

  • Full Gc trigger condition.

  • Object memory layout.

  • Why there are two survivor areas in the new generation.

  • An object is really unavailable, it has to go through two marking processes.

MySQL

  • What are the four characteristics of database transactions and database transactions.

  • Please give examples of phantom reading and non-repeatable reading, and describe the difference between them.

  • What is the default isolation level of MySQL.

  • Why use an index.

  • Index has so many advantages, why not create an index for each field in the table.

  • How does indexing improve query speed.

  • Please state the few situations where you know the index is invalid.

  • What is a clustered index and non-clustered index

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

  • Talk about the difference between MyISAM and InnoDb to achieve BTree index.

  • What is covered 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 use explain to analyze SQL execution efficiency.

  • The fields displayed in the explain are explained in detail.

  • Please list the possible causes of database deadlock and how to avoid deadlock.

  • What is the difference between optimistic locks and pessimistic locks in the database, and what scenarios are they suitable for?

  • Please combine your development experience and talk about how the optimistic and pessimistic locks in the database are applied.

  • The essence of the index.

  • MySQL storage engine.

  • MySQL index

    Data structure, B-Tree and B + Tree.

    B + Tree with sequential access pointer

    The physical storage of the index.

    Compared with B-Tree, B + Tree is different.

    Why B + Tree is more suitable for file indexing.

    Why not use AVL trees or red-black trees for indexing.

    Index storage mechanism of two engines.

    MyISAM index implementation.

    InnoDB index implementation.

    Index failure conditions.

    Index type

    Hash index.

    Ordered array.

    B + tree index (InnoDB).

    Joint index.

    The principle of the leftmost prefix.

    Cover the index.

    The index is pushed down.

Spring

  • Spring bean life cycle

    Initialize the container.

    Bean attribute injection, change, and initialization.

    Use of beans.

    Close the container and destroy the bean.

  • How does Spring solve the circular dependency of beans

    The container is circularly dependent.

    Setter is circularly dependent.

    Constructor circular dependency

  • Bean loading process

  • The difference between BeanFactory and FactoryBean

  • Bean registration and use

  • How does Spring Level 3 cache solve circular dependency.

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

  • AOP

  • IOC

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

  • Spring transaction management principles.

distributed

  • What protocols does Dubbo support, the application scenarios of each protocol, advantages and disadvantages.

  • How to set Dubbo timeout.

  • What registration centers are there in Dubbo?

  • What are the strategies for Dubbo cluster load balancing?

  • The main application scenario of Dubbo.

  • Dubbo's core functions.

  • The core component of Dubbo.

  • Dubbo service registration and discovery process.

  • Dubbo's service invocation process.

  • What protocols does Dubbo support, the application scenarios of each protocol, advantages and disadvantages.

  • Dubbo's registration center cluster hangs up. Can publishers and subscribers still communicate?

  • The relationship between Dubbo and Spring.

  • What communication framework Dubbo uses.

  • What are Dubbo's cluster fault tolerance solutions?

  • What serialization methods does Dubbo support?

cooking pear

  • Zookpeer node type.

  • The role of zookpeer.

  • Zookpeer's watcher mechanism.

  • How zookpeer implements distributed locks.

  • Zookpeer election algorithm.

  • Paxos algorithm.

  • Raft algorithm.

  • ZAB agreement.

  • What is a distributed transaction.

    Distributed transaction solution.

    Do you know seata.

    Consistent hash?

    Hash slot, and why 2 ^ 14.

  • SpringCloud components?

  • What is Hystrix and how does it achieve fault tolerance.

  • What is RestTemplate.

  • What is Ribbn.

  • nacos / Eureka comparison.

  • What is zuul.

  • What is Getway.

  • What is Config.

  • What is microservice

    What is SOA.

    The difference between SOA and microservices.

  • Why use microservices.

  • Problems and solutions in using microservices.

  • How to communicate between microservices.

  • How microservices are discovered.

  • How to fix the microservices.

  • Retry mechanism, idempotency.

    Limiting

    Fuse, downgrade

Linux

  • What are the common commands of linux, and give examples respectively.

  • How to write the linux command to query the status of port 3306.

  • Check the process number pid of a java in linux and how to operate it.

  • Process communication method.

  • Process, thread, coroutine.

  • Process scheduling algorithm.

  • The I / O model under Liunx.

  • User mode, kernel mode.

  • How to reduce the copy of kernel mode to user mode (mmap).

  • Commonly used commands.

  • View logs.

How to review

In terms of Java cage unification, nothing more than: JUC, multi-threading, locks, collections, basic knowledge, framework, distributed.

A knowledge system must be learned together,

For example, JUC, this is a big package, system learning will be more time-consuming, but the income is also relatively good, can connect some details, so that the memory is more profound

For example, HashMap can be broken up for learning, why is the load factor of 0.75, and why is it necessary to shift the unsigned right by 16 bits? Why is it a multiple of 2? Why is it 8 instead of 7, 9?

** Tools are easy to replace. ** Senjin's SSH now Spring-Boot, Cloud, maybe a new pattern after a few years, but the underlying technology is the same principle, understanding the bottom layer, not only helps For troubleshooting, it is a good way of thinking and learning for the entire promotion path of the programmer.

Taboo the learning of the East Hammer and the West Yi Bangmao, so that knowledge will be forgotten after the interview in order to cope with the interview.

Generally in this order:

  • Look at the source code, pull the details

  • See the corresponding explanation of the blog and public account

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

  • A week later, or review it a few days later, (Ebbinghaus Forgetting Curve)

Brush questions

Two good places for brushing questions:

  • Niuke, I also recommend everyone to go, all topics are free, and basically have big guys to discuss

  • LeetCode, this is also possible, but a certain fee will be charged accordingly, such as VIP

Byte bounce for the algorithm for ten minutes of love, almost every side will be at least two to the algorithm question, so, if you want to enter the byte, at least two months of algorithm questions brushed up.

Don't talk about what algorithm is not important, the programmer can't figure out the algorithm, just like the cook won't be upset, the driver will not be in gear.

Guess you like

Origin juejin.im/post/5e994427e51d45470a4ac8ea