At the end of the year, Sanmiankuaishou Java back-end post won the letter of intent and shared the experience without making things difficult.

For the last Java interview in 2020, I went to Kuaishou. Kuaishou’s interview is quite challenging, and also very interesting, I feel like I can ask anything. (The second interview was an interview 10 days ago. I almost forgot it.) Then it was the HR interview. I received the offer the day before yesterday.

I have forgotten the specifics on both sides, so I will briefly summarize

1 Basic

  • Why is there only value passing in Java?
  • int range? float range?
  • What is the relationship between hashCode and equals?
  • What is the difference between String StringBuffer and StringBuilder? Why is String immutable?
  • What if some fields do not want to be serialized in Java serialization?
  • Can Constructor be overridden?
  • Java exception system? The difference between RuntimeException Exception Error, for common examples
  • What is the difference between character constants and string constants?
  • Before calling the subclass construction method, the parent class construction method without parameters will be called first. What is the purpose?

2 collection

Assemble this piece and pay attention to the implementation of 1.8. Compared with 1.7, it has changed a lot.

  • The difference between ArrayList and linkedList?
  • How is the heap stored and where are the inserts?
  • The difference between HashMap and HashTable? Talk about the principle of hashMap. Can hashMap be read concurrently? What are the problems with concurrent writing?
  • The collection class is stored in the Java.util package. How many interfaces are there?
  • What is the difference between Array and ArrayList? Briefly introduce how to implement ArrayList, add operations, value operations, and when to expand?
  • Talk about ConcurrentHashMap? Head insertion or tail insertion? How to do expansion?
  • What happens when data is inserted or deleted during the iteration of the collection?

3 Concurrency

  • What is the difference between notify() and notifyAll()?
  • What is volatile? Can order be guaranteed?
  • Why wait, notify and notifyAll are not in the thread class?
  • What is the difference between SynchronizedMap and ConcurrentHashMap?
  • What is thread safety? Is Vector a thread safe class?
  • The difference between thread process and thread? The difference between parallel and concurrency? Do you understand coroutines? How to communicate between processes: What if process A wants to read the main memory of process B? Communication between threads? What are the states of the life cycle of a thread? How to convert? What is the difference between wait and sleep? Under what circumstances will sleep be used? How to stop the thread? How to control multiple threads to execute sequentially?
  • Tell me how you use the synchronized keyword. Have you used it in your project? The three main ways to use the synchronized keyword
  • Why use join() method?
  • What is context switching in multithreading?
  • The difference between deadlock and livelock, the difference between deadlock and starvation?
  • What is the thread scheduling algorithm used in Java?
  • What is an atomic operation? What are the atomic classes in the Java Concurrency API?
  • What is a blocking queue? What is the realization principle of blocking queue? How to use blocking queues to implement producer-consumer
  • model?
  • Does AQS understand AQS? Talk about the underlying realization principle What are the realizations of AQS? Talk about the underlying implementation of AtomicInteger
  • Why do we execute the run() method when we call the start() method, why can’t we call the run() directly
  • law?
  • How do you wake up a blocked thread in Java?
  • What is a thread group, and why is it not recommended in Java?

4 I.

I’m not familiar with IO, so I didn’t talk much

  • Do you know NIO? Talk about
  • What is the difference between NIO and BIO?
  • Do you understand the principle of Netty?

JVM

1 Memory and GC

  • What is GC? Why is there a GC?
  • Jvm memory area distribution? Where does gc occur?
  • Can you guarantee GC execution?
  • How to get the memory used by the Java program? What percentage of the heap is used?
  • Introduce the garbage collection process.
  • Understanding of garbage collection algorithms. What recycling algorithm is in use now?
  • When will FullGC be triggered
  • What garbage collector is in use now? Know what? Talk about G1
  • What is the relationship between container memory and jvm memory? How to configure the parameters?

2 Exceptions and tuning

  • Are there any jvm parameter adjustments online?
  • oom troubleshooting ideas
  • Online troubleshooting, suddenly did not respond for a long time, how to troubleshoot, oom
  • The cpu usage rate is very high, how to troubleshoot? General method? Location code? The reason for the high cpu?
  • Reasons for frequent GC? When is FGC triggered?
  • How to get dump file? How to analyze?

3 types of loaders

  • How to implement your own class loader?
  • Class loading process?
  • Initialization sequence?

Spring

  • What are the main features of different versions of Spring Framework?
  • Talk about ioc, aop
  • How does ioc prevent circular dependency
  • The realization principle of aop, dynamic agent process
  • Distinguish between BeanFactory and ApplicationContext?
  • What is the life cycle of the spring bean container?
  • What is the use of @Autowired annotation?
  • What are the ways to access Hibernate using Spring?
  • How does Spring handle the request?

Redis

  • Why use redis / why use cache (high performance, high concurrency)
  • Redis common data structure and usage scenario analysis (String, Hash, List, Set, Sorted Set)
  • Redis common exceptions and solutions (cache penetration, cache avalanche, cache warm-up, cache degradation)
  • Common application scenarios in distributed environments (distributed locks, distributed self-incrementing ID)
  • What should the Redis cluster solution do? What are the options?
  • What is the master-slave replication model of Redis cluster?
  • Redis persistence mechanism (how to ensure that the data can be restored after redis hangs and restarts)
  • How to solve the key problem of concurrent competition in Redis?
  • How to ensure data consistency between the cache and the database when it is double-written?
  • What is the usage scenario of redis zset? The underlying implementation? Why use a skip meter?

MySQL

  • Concurrency of transactions? Transaction isolation level, what problems each level will cause, which level is MySQL by default?
  • MySQL's MyISAM and InnoDB storage engines, transaction and lock levels, and their respective applicable scenarios?
  • What are the locks (optimistic locks, pessimistic locks), and how to add exclusive locks when selecting?
  • The SQL query statement determines which type of index to create? How to optimize the query?
  • What is a temporary table and when will it be deleted?
  • mysql dirty page?
  • What are the strategies for sub-database sub-table? How to ensure unique id?
  • What are the differences between non-relational databases and relational databases, and what are the advantages?
  • 7 problems of database read-write separation, master-slave replication, master-slave replication analysis?
  • What kind of locks does MySQL have, the principle of deadlock determination and specific scenarios, and how to solve the deadlock?
  • Transaction recovery mechanism (REDO log and UNDO log) when the database crashes?
  • Understanding of uuid? What GUID and Random algorithms do you know?
  • Choose random id, uuid or auto-increment id for primary key? why? How does the order and disorder of the primary key affect the database?
  • The process of master-slave replication? Copy principle? How to ensure strong consistency?

Kafka

  • What are the command lines for producers and consumers?
  • How does Kafka guarantee data reliability?
  • Talk about Kafka's method of maintaining consumption status tracking
  • Why do I need a message system, can mysql not meet the demand?
  • What are the two conditions for Kafka to judge whether a node is still alive?
  • Are there three key differences between Kafka and traditional MQ messaging systems?
  • In the case of Kafka distributed (not stand-alone), how to ensure the sequential consumption of messages?
  • How does Kafka not consume duplicate data? For example, deductions, we can’t repeat deductions

The internet

  • What mechanisms does tcptcp have to ensure reliability? How to achieve congestion control? How to deal with too much close_wait? Why does this happen?
  • Talk about three handshake, four wave hands?
  • What is the use of keepalive? Https principle? Know which http status codes are there? What are the request methods for http? What is the difference between put and post implementation?
  • What is the difference between front and back end separation and no separation? What are the advantages and disadvantages of each?
  • What are the common web attacks? Do you understand csrf attacks?
  • What should I do if nginx reaches the upper limit? How to load balance nginx? dns?
  • What algorithms does nginx load balancing have? What are the advantages and disadvantages of each?
  • What is the role of restful? What are the advantages and disadvantages?
  • What is cdn? What are the cached fields in the header? Cookie session introduce the html page, how to interact with the backend? What is the process? What components are involved? http protocol, message format?

Design Patterns

  • What is a design pattern? Have you used it in your code?
  • What is the singleton design pattern in Java? Please write a thread-safe singleton pattern in Java
  • What is the observer design pattern in Java?
  • Give a decorator design pattern implemented in Java? Does it act on the object level or the class level?
  • Singleton For singleton, what implementation methods do you know? Why do you need double verification to implement a lazy load singleton double verification lock?
  • What are the main benefits of using the factory model? Where is it used?

distributed

  • Which distributed components are you most familiar with, let’s talk briefly.
  • What does cap mean? Which caps does mysql satisfy?
  • What are the ways to implement distributed locks? What are the advantages and disadvantages of each?
  • What is a consistent hash? What data structure will be used to implement a consistent hash by yourself?

Microservice

  • What are the advantages of microservice architecture?
  • Monolithic, what is the difference between SOA and microservice architecture?
  • What is RPC? How to achieve idempotence?
  • What is REST / RESTful and what is its purpose?
  • What are the options in the configuration center? Apollo's architecture? How to update the loaded data without feeling?
  • Tell me about the concept of fusing? Fuse principle? Token bucket? Fuse the relationship between the three states?
  • Will fusing affect performance? Have you ever encountered a circuit breaker? What happens if you don't add it?

Algorithm question

Basically ask about time complexity

  • What are the commonly used sorting algorithms?
  • What is the time complexity of handwriting fast sorting?
  • Is the fast sorting algorithm stable? What is stability?
  • Given a string of letters, find the length of the longest substring that does not contain repeated characters.
  • Among the 9 coins, there is a bad coin. How many times is it worst?
  • Depth first, breadth first
  • Bracket matching, time complexity, space complexity
  • Merge Sort of Singly Linked List
  • 1g file, each line in it is a maximum of 16k words, the memory limit is 1m, and the 100 words with the most word frequency are counted
  • Subtraction of handwritten 100 large numbers with decimals

What do you want to ask? +Offer choice?

  • Department positioning? Job Responsibilities? What business are you currently doing? Salary and benefits introduction?
  • What is the current offer at hand? What are your own tendencies in these companies? What is the most important factor? What kind of team do you want to join?
  • What is your expected salary? Current salary situation?
  • What is your performance in the last year?

 

To add to my offer in the second half of 2020, I actually got a letter of intent such as Meituan Architecture, Kuaishou Main App, Ape Coaching Zebra, and Tencent csig. And I think the "handsmanship" before the interview is very important. Like my "naked face" in the early stage, I wasted the interview opportunities of Ali, Ant, Byte, Shopee, etc. abruptly. Therefore, my advice to the big guys here is to be adequately prepared, otherwise it will delay the interviewer and yourself time, and will be at a loss during the interview, after all, there is no goods in the stomach!

Finally, after thinking twice, I chose Kuaishou, and I am ready to join the company next Monday! Come on, everyone, job-hopping interviews are always there. If you are not ready, I suggest you wait for the Spring Recruitment after the end of the year to approve in advance, but you can't waste this free time, take it!

Speaking of which, let's finally release a wave of welfare! Hope it can help everyone!

Below I will share all the resources that I have collected in 2020-Java learning, interviews, documents, video notes and other resources, which are of great help to friends who need more in-depth study and job interviews. Let’s put benefits, please everyone Forward it for support, then add VX: mxj94670 to reply and share!

Thousands of things must remember: write more questions! ! More questions! !

The algorithm was my fault before, and it took a long time to make up for it. The algorithm is the soul of the programmer! ! ! !

Space is limited, the following screenshots can only share some of the resources! !

(1) Multithreading (here is represented by multithreading, in fact, I compiled a collection of notes on the JAVA core architecture)

 

(2) Brushed algorithm questions (and Zuoshen's algorithm notes)

 

(3) Face sutra + real question analysis + corresponding relevant notes (very comprehensive)

 

(4) Video learning (partial)

ps: Video is a good choice when you feel that you cannot learn or are tired

In fact, all the things I have shared above can be found on the Internet (PS: there are a lot of them that I have compiled by myself, but there are none), but it will be a bit troublesome to organize them. If necessary, I can share them here for free Everyone, but please remember to get the method to scan the below to immediately reply to your free download method! !

Here, the last sentence: I wish you all the offers! !

Guess you like

Origin blog.csdn.net/m0_46757769/article/details/112688827