preface

My sister, north drift for three years, because in the original company to stay is not very happy, and then decided to naked resignation (never naked resignation!! On the one hand, psychological pressure is relatively large. On the other hand, may be pressured salary) after naked resignation did not worry about looking for a job, because the original thing is relatively low, so it is also learned for a period of time to take a small company practice hand, big factory asked nothing more than the project, foundation, algorithm, architecture, concurrency, project actual battle, the following take you to see the interview content!

Five Aspects of Alibaba

A:

1. Trigger the Cenozoic GC. If the total number of surviving objects exceeds the capacity of survivor zone, what should I do

2. If there are many tasks, which area of memory will be overwhelmed by the blocking queue of the thread pool

Is the stack on the heap

4. GC root

5. Can the instance variable be GC root

6. Know which GC algorithms and introduce them

How to set JVM parameters

8. Ask a lot of SQL tuning, various statements can hit the index, which can hit, how to optimize

MySQL > select * from ‘ABC’ where ‘ABC’ = ‘A’, ‘B’ = ’10W’, ‘C’ = ’10W’

The difference between Mybatis # and $

11. Can the method in Mybatis interface be different from the SQL name in XML

12. Mybatis is how to complete the mapping between SQL and methods in the interface (I answered how to configure), do you know how it is implemented

13. Introduce Spring’s IOC and AOP

14. The server sends I/O streams to the client

15. What do IO and NIO know

16. What states do threads have and how do they transition

17. The difference between Notify and notifyAll

18. Introduce thread pools, what are the differences between different thread pools and how do you normally use thread pools

MySQL > alter table data structure

20. How much does B+ tree know

Cookie and SessionId

22. How is the lock implemented

23. What do Synchronized blocks and Synchronized methods lock

24. Singleton mode, problems of hungry and lazy respectively

25. How does Volatile achieve visibility

26. Introduce JMM

27. Happen before

28. Does A happen before B mean that A must be implemented before B

29. What was the most difficult task on the most difficult project you have ever worked on and how did you solve it

2:

1. What source code have you read?

2. What maps are available in Java and how are they implemented

3. In addition to linkedhashMaps, you know which ordered maps

4. ConcurrentHashMap

5. Why a thread pool

6. What are the types of thread pools? What’s the difference? What are the parameters? What are the rejection strategies

7. What kinds of blocking queues are there and what are the differences

8. How to understand Java reflection

What about IOC and AOP in Spring

10. What resources are loaded when a Spring project starts, and in what order

11. What happens when the browser enters a URL

12. Http explain what the content of a request is and what the content of a response is

13. Your written test score is very high. Have you ever brushed many questions? How did you do it?

Three sides (leader side) (with mind map)

1. How much do you know about high availability and performance of MySQL

2. Taobao has 1000T of data, which cannot be stored in a single machine. How to do? Is there a way to access the server only once? How much does consistent Hash know

3. What’s the difference between MySQL and Redis

4. How to back up MySQL data

5. How much is the underlying principle of Redis

Why is Redis faster than MySQL

7. Redis RDB may lose data, what to do

8. Redis AOF also writes logs to disk, which is different from MySQL IO

9. How to do master/slave replication in Redis

10. What does distributed caching know

11. Know of any other NoSQL

12. What are the advantages and disadvantages of Java and C

13. Have you written the bottom layer with C

14. Java’s G1 collector takes a closer look

15. When will G1 stop the world

16. Has the Linux operating system been used

17. How much do you know about distribution and middleware

18. Tell me more about your project

19. What do you think could be expanded or improved on your current project

20. What do LABS do? Why switch to the Internet? How many students turn to the Internet in the laboratory

21. Have you ever handed out a paper? Is the tutor willing to intern?

22. How much do you know about Ali’s technology? What do you know about the department?

All around:

1. Common data structures for database indexes

2. Have you read the Juc source code? What is the implementation principle of locks?

3. Could you tell me more about CAS

4. The Builder model

5. Talk about the experience of the written test (high score in the written test)

6. What books have you read

7. Which book are you going to read next

8. Introduce the lab project

9. What was the biggest challenge you faced, whether it was a lab project, an internship or your own project

10. How did you solve this difficulty

11. Did you cooperate with others in the project

12. Current offer situation

13. Evaluate yourself

Five sides (cross face) :

1. Introduce the project, the source of the project, and did you do it by yourself

2. How is login authentication done

3. Talk about ThreadLocal

4. How do ThreadLocal prevent thread contamination?

5. How does liking work

6. Redis persistence mode

7. MySQL storage engine differences

8. Why is Myisam generally faster than InnoDB in read-only scenarios

9. How to use Mybatis

The difference between Mybatis # and $

11. The difference between Spring BeanFactory and ApplicationContext

12. What are the scopes of beans in Spring and what are the differences

13. Name a specific application scenario for a prototype scope

14. What design patterns have been learned and used

15. Talk about the producer-consumer model

16. How to implement blocking queue

17. Have you learned Linux (hardly)

18. In Linux, how can I find all files in a directory and ask the output order to be sorted according to the creation time of the files

19. You are given a bunch of student information, including student numbers and names, and asked to find the names of the top 10 students with student numbers

How is PriorityQueue implemented

21. How to find the square root of 3?

22. Your method is too slow, can you optimize it? The interviewer says: Yes, haven’t you studied numerical analysis?

23. Fibonacci sequence, find the NTH term (answer both recursion and DP)

24. If the array length is 100W, isn’t your DP matrix large? How do you optimize? Temp = a, a = b, b = a + temp; temp = a, a = b, b = a + temp;

25. A clock has an hour hand and a second hand. What is the shortest time between the three hands? (I have no idea at all, I only know that I can’t do it within one hour, because I walk at different speeds, and the fast and the slow can’t hit each other in one lap.)

26. How do you study

27. What book have you been reading and what book do you plan to read next

28. Assess your strengths and weaknesses

29. How can I prove that you are a quick learner

Bytes on three sides

One side

1. Introduce yourself.

2. Introduce the project;

3. Algorithm: returns the sort value of an array of numbers, for example, data [6,2,5,0] returns [4,2,3,1];

4. What data structures does Redis have and how to realize the underlying ones?

Second side (with mind map)

1. Introduce yourself.

2. Introduce the project;

3. System design: a system needs to load 100G of data and process external requests normally during this period;

3. Introduce virtual memory.

4. What is kernel state?

5. Algorithm: a positive array, length N, and array elements

On three sides

1. Introduce yourself.

2. Introduce the project;

3. Algorithm: Return the left view of a tree;

4. System design: how to design wechat moments of friends; What if it were microblogging?

Tencent on three sides

One side

Before see face classics heard Tencent interviewer cherish word such as gold, really want to cheat a few words ah

  • Golang multiplexing

  • Why is FasthTTP fast

  • Pprof use

  • How to do performance tuning

  • How is http2.0 multiplexing implemented

  • Maximum continuous subsequence sum

  • How does mysql monitor traffic

  • Golang scheduling can not p

  • What are the load balancing algorithms?

Second interview

The e second interview is basically about project development, people say I don’t ask what you write on your resume. The difference between ETCD and ZK is discussed in detail

On three sides

Detailed questions about the project include some basic questions about career planning and so on

Meituan 2 face

Side one :(with mind map)

Introduce projects, difficulties, etc

Java multithreading: synchronized, volatile, ReentrantLock, CAS, thread pool, etc

Spring related

Principle and process of Mybatis

Thread process distinction

Process communication mode

Message queue, Kafka

TCP/UDP, why not two or four handshakes

Introduction to JVM memory model, marking algorithm, GC

Linux commands such as ps,top,find, etc

Java collection

Database index structure B+ tree, hash index, etc

ACID and transaction isolation level

The Java design pattern covers several: singletons, policies, factories, agents, adapters, and so on

Write code for the singleton pattern

Write code to count N! The number of zeros in there

2:

Introducing projects, etc.

SpringMVC workflow

Thread pool underlying principle and code implementation

How to ensure synchronous execution of multiple threads?

ConcurrentHashMap Why cannot the key and value be null?

This section describes and compares mysql database engines

SQL > select top 3 students from a grade with the same name

Detailed process of class loading

What are Web attacks? How to solve it?

What are the types of Redis, caching and persistence mechanisms

How is cache penetration resolved

Have you ever used a non-relational database? To introduce

Write singleton mode double-checked locking mechanism

Calculate the probability that a 6-digit number contains the number of repetitions, for example 66 is the number of repetitions in 665321

Baidu all around

One side

Difference between Redis and ETCD

  1. In terms of data structure, Redis supports multiple data types (String, set, list, Hash, zset).

  2. In terms of read and write performance, Redis has excellent read and write performance and provides RDB and AOF persistence, while etCD V3 uses BoltDB for storage and value for direct persistence

  3. In terms of usage scenarios, ETCD is more suitable for service discovery and configuration management, while Redis is more suitable for non-strong consistency requirements, such as queue, cache and distributed Session

  4. Both are KV storage, but ETCD ensures the consistency of data and transactions between nodes through Raft algorithm, and emphasizes the communication between nodes. Redis is more like an in-memory cache, so it’s very read-write.

  5. Redis is developed by C, etCD is developed by GO, he is derived from the rise of K8S as a service discovery.

  6. Etcd V3 can only be accessed through gRPC, whereas Redis can be accessed through HTTP, so client development for ETCD is much higher.

  • The Raft algorithm of ETCD is introduced

  • The implementation of the ping command, which protocols are involved

  • Linux user mode and kernel mode, when switch to kernel mode

  • Why are threads switching slower than coroutines

  • Redis, ETCD distributed lock implementation

  • An underlying implementation of the Redis String type

  • And c language string difference

  1. Obtaining the string length is O (1) time complexity, and the program only needs to access the LEN attribute of SDS

  2. C language will produce buffer overflow. In Redis, if SDS needs to be modified, THE API will check whether the SDS space meets the requirements for modification. If not, THE API will automatically expand the SDS space to the size required for modification before the actual modification operation

  3. SDS records unused bytes through the free attribute. SDS realizes two optimization strategies of space pre-allocation and lazy space release through unused space. Yes Changing the string length N times requires a maximum of N memory reallocations.

  4. C strings can only hold text data, whereas SDS can hold text or binary data

Second interview

The second interview is basically a scene design question, I forgot to mention that the interview experience is very good, after discussing with the interviewer how to solve the problem, there is an intelligence question, there are 10 elements in the array of length 12, there are two elements repeated, find these two elements

For example, a plus b you can get a plus b by subtracting and multiplying and dividing and you can get a times b because if you overflow, you can get a2 plus b2 by square summing and you can get a and b from this relationship

On three sides

  • The difference between Go and Java can be explained in many ways such as object orientation, polymorphic inheritance and so on in terms of speed, go’s concurrency model channel and Goroutine in terms of package management, go mod includes the previous DEP and so on

  • The GMP scheduling principle of GO

  • CPU context switch problem

  • The difference between a channel and a buffer slot is mainly synchronous and asynchronous

  • Redis zset implementation

  • Load balancing implementation of several algorithm questions handwritten stack a problem, string integer type, linked list inversion

All around

Handwritten two algorithms, single linked list of intermediate nodes a DP topic Baidu algorithm topic are easy to meduim level and then ask the project of the more detailed, such as in the realization of the virtual link keepalive is how to achieve ah, what can be optimized point how to find the performance bottleneck procedures and so on

Drops on three sides

Didi self-driving Vovager

One side

Dp [I]= Max (dp[i-1],num[I]-num[j])

`func maxProfit(prices []``int``) ``int` `{`

`size := len(prices)`

`if` `size==``0``||size==``1``{`

`return` `0`

`}`

`profit := ``0`

`cost := prices[``0``]`

`for` `i := ``1``; i < size; i++ {`

`cost = min(prices[i], cost)`

`profit = max(profit, prices[i]-cost)`

`}`

`return` `profit`

`}`
Copy the code

I asked if I could not turn py

Second interview

The second interview mainly asked about the project, an algorithm question and a scene design question, which I personally think is not summative

On three sides

* Differences between epoll and poll

Three life, clockwise printing matrix, general layer simulation is good, I also do not know how the brain took out

`func spiralOrder(matrix [][]``int``) []``int` `{`

`if` `matrix == nil || len(matrix) == ``0` `|| len(matrix) == ``0` `{`

`return` `[]``int``{}`

`}`

`top := ``0`

`hsize := len(matrix)`

`lsize := len(matrix[``0``])`

`left := ``0`

`bottom := hsize - ``1`

`right := lsize - ``1`

`index := ``0`

`x, y := ``0``, ``0`

`sum := make([]``int``, hsize*lsize)`

`for` `bottom >= top && right >= left {`

`for` `x = left; x <= right; x++ {`

`sum[index] = matrix[top][x]`

`index++`

`}`

`for` `y = top + ``1``; y <= bottom; y++ {`

`sum[index] = matrix[y][right]`

`index++`

`}`

`if` `bottom > top && right > left {`

`for` `x = right - ``1``; x > left; x-- {`

`sum[index] = matrix[bottom][x]`

`index++`

`}`

`for` `y = bottom; y > top; y-- {`

`sum[index] = matrix[y][left]`

`index++`

`}`

`}`

`left++`

`right--`

`top++`

`bottom--`

`}`

`return` `sum`

`}`
Copy the code

conclusion

Spring Cloud and Docker microservices architecture practice more than 270 pages of information collection, Spring Boot learning notes more than 100 pages, and Spring family bucket (1187 pages PDF), 1000 tracks Internet big factory Java engineer interview question, concern public number: Kylin change bug.