Alibaba, ByteDance, JD, Tencent, Xiaomi high-frequency interview questions (Java post)

1. Common questions about the written test?

The links to the interview questions given above are basically all common questions in the interview. I just mention a few points:

  1. Writing SQL: Writing SQL often examines group by, inner join and outer join.

  2. Handwritten code: Handwritten code generally tests singleton, sorting, threading, and consumer producer. I suggest that in addition to bubble sorting, the sorting algorithm is best to write another sorting code by hand. Just think: if the average interviewer writes bubble sort, and you write quick sort/heap sort, it will definitely leave a good impression on the interviewer.

2. Interview process?

  1. Let you introduce yourself

  2. Ask Java basics

  3. Ask the project

  4. Scenario problems, such as: After one of your functions is put into the production environment, the server pressure increases sharply, how to troubleshoot.

  5. What do you want to ask the interviewer

3. Knowledge points frequently asked in interviews?

1) Set-related questions (must ask):

  • The underlying implementation of HashMap, LinkedHashMap, ConcurrentHashMap, ArrayList, LinkedList.

  • The difference between HashMap and Hashtable.

  • The difference between ArrayList, LinkedList and Vector.

  • The difference between HashMap and ConcurrentHashMap.

  • The difference between HashMap and LinkedHashMap.

  • Is HashMap thread safe?

  • How does ConcurrentHashMap achieve thread safety.

2) Multi-threaded concurrency related issues (must ask):

  • 3 ways to create threads.

  • What is thread safety.

  • The difference between Runnable interface and Callable interface.

  • The difference between wait method and sleep method.

  • synchronized、Lock、ReentrantLock、ReadWriteLock。

  • Introduce CAS (lockless technology).

  • The role and principle of the volatile keyword.

  • What is ThreadLocal.

  • 4 ways to create a thread pool.

  • The internal working principle of ThreadPoolExecutor.

  • How to ensure thread safety in a distributed environment.

3) JVM related issues:

  • Introduce the garbage collection mechanism (when, what, what was done).

  • What are the algorithms for garbage collection and their characteristics.

  • The process of class loading.

  • Parent delegation model.

  • What class loaders are there.

  • Can you write a class called java.lang.String by yourself?

4) Questions about design patterns (must ask):

  • First ask which design patterns you are familiar with

  • Then ask you specific questions about the specific implementation of a certain design pattern and related extensions.

5) Database related questions, for Mysql (must ask):

  • Give the topic to let you write SQL by hand.

  • Have SQL optimization experience.

  • The data structure of the Mysql index.

  • How to optimize SQL.

  • The execution order of SQL keywords.

  • What kinds of indexes are there.

  • When should (and should not) build an index.

  • Explain which columns are included.

  • What kind of values ​​are in the Type column of Explain.

6) Framework related issues:

  • The difference between Hibernate and Mybatis.

  • The difference between Spring MVC and Struts2.

  • What design patterns does Spring use.

  • What AOP is mainly used for in Spring.

  • The way Spring injects beans.

  • What is IOC and what is dependency injection.

  • Is Spring a single case or multiple cases, and how to modify it.

  • Spring transaction isolation level and propagation.

  • Introduce the caching mechanism of Mybatis/Hibernate.

  • The difference between # and $ in the mapper file of Mybatis.

  • The difference between resultType and resultMap in the mapper file of Mybatis.

  • There is no implementation class for the DAO layer interface in Mybatis. How are the methods in the Mapper and the DAO interface method bound together, and how is it implemented internally.

7) Other problems encountered:

  • Introduce the next stack and queue.

  • The difference between IO and NIO.

  • The difference between an interface and an abstract class.

  • Issues related to automatic unboxing/boxing of int and Integer.

  • Constant pool related issues.

  • The difference between == and equals.

  • The difference between overloading and rewriting.

  • The difference between String and StringBuilder and StringBuffer.

  • Are static variables, instance variables, and local variables thread safe, and why?

  • Which one is executed when try, catch, and finally have a return statement.

  • Introduce B-tree and binary tree.

  • What do the 4 letters of ajax mean?

  • What is the full name of xml.

  • Implementation of distributed locks.

  • Distributed session storage solution.

  • Commonly used linux commands.

Let’s share with you the interview materials I have compiled for review of benchmark manufacturers.

Quick start channel: interview materials, Java high-frequency interview collection, open source framework to get the address for free ! Full of sincerity! ! !

  • Part 1: Java Basics-Intermediate-Advanced

  • Part 2: Open source framework (SSM: Spring+SpringMVC+MyBatis)

  • Part 3: Performance Tuning (JVM+MySQL+Tomcat)

  • Part 4: Distributed (current limit: ZK+Nginx; cache: Redis+MongoDB+Memcached; communication: MQ+kafka)

  • Part 5: Microservices (SpringBoot+SpringCloud+Dubbo)

  • Part VI: Others: Concurrent Programming + Design Patterns + Data Structure and Algorithms + Network

These interviews are all from the real interview questions and interview collections of Dachang. The editor has compiled it for everyone (PDF version) Quick start channel: interview materials, Java high-frequency interview collection, open source framework to get the address for free ! Full of sincerity! ! !

  • Java Architecture Advanced Architecture Foundation (Java Foundation+Concurrent Programming+JVM+MySQL+Tomcat+Network+Data Structure and Algorithm)

  • Advanced Java Architecture Open Source Framework (Design Pattern+Spring+SpringMVC+MyBatis)

  • Advanced Java Architecture Distributed Architecture (Current Limit (ZK/Nginx) + Cache (Redis/MongoDB/Memcached) + Communication (MQ/kafka))

Interview materials, Java high-frequency interview collection, open source framework to get the address for free

 

  • Advanced Java Architecture Microservice Architecture (RPC+SpringBoot+SpringCloud+Dubbo+K8s)

Quick start channel: interview materials, Java high-frequency interview collection, open source framework to get the address for free ! Full of sincerity! ! !

It is not easy to organize, friends who feel helpful can help, like, share and support the editor~

Your support, my motivation; I wish you all a bright future and constant offers! ! !

Guess you like

Origin blog.csdn.net/weixin_45132238/article/details/115282346