search
HomeJavaJavaInterview questionsMeituan, see if you can answer it?
Meituan, see if you can answer it?Aug 24, 2023 pm 03:51 PM
java interview questions


Question

1. Introduce yourself. , briefly tell us about your project?

2. Have you ever encountered a memory leak? How did you solve it? I did encounter this once a while ago, and I was pretty lucky.

3. What are the basic types of java? Is String a basic type of Java? Why does String have to be of final type?

4. What is the underlying implementation of the reflection mechanism? What about dynamics? Dynamic implementation principle?

5. Do you understand HashMap? Tell me something related to HashMap? Is HashMap thread-safe? Why is it thread safe? ConcureentHashMap Do you understand? How does he achieve thread safety? Did you just say that 1.8 is based on CAS? How to solve the ABA problem of CAS?

6. Tell me about the threading model of JVM? What are these areas used for? JavaThreading model and JVMThreading model Pay attention to the distinction and summary. Many articles on the Internet are wrong.

7. Tell me about the working mechanism of java class loader? In which area is class loading performed?

8. Let’s talk about Java’s thread model? Do you understand violation? What is his rationale? Is violate thread safe? Why not?

9. What are the solutions to ensure thread safety? Let’s talk about read-write locks. What are the read-write locks? 10. What types of database indexes are there? Why use B-tree for indexing? What is the difference between a combined index and several individual indexes? Do you understand the optimization of large table queries in databases?

MVCC

Do you understand the mechanism? What's wrong with the MVCC mechanism? How to solve this problem? MySQLmysql Have you done any slow statement tuning? Tell me how you did it? 11. Do you understand

Redis

? Can you tell me how to use Redis to implement distributed locks? 12. Is the scope of the Bean in

Spring

and the controller of Spring MVC thread-safe? How to ensure thread safety? (The interview comes from a netizen: two years of work experience, Shanruyar)

After reading the above questions, how well do you think you can answer them? According to the 100 score system, how many points would you give yourself?

Problem Analysis

1. Please introduce yourself and briefly talk about your project?

Two questions, one is to introduce yourself, and the other is to introduce the project. The project introduction is the one you are most familiar with or the one you can best use, which may not necessarily be the project you are working on recently.

2. Have you ever encountered a memory leak? How did you solve it? I did encounter this once a while ago, and I was pretty lucky.

This problem is based on daily summary. If you have never encountered it before, you can simulate it yourself, and then use various commands and tools to troubleshoot. When asked during the interview, just briefly talk about the troubleshooting ideas and the commands and tools used in the troubleshooting process.

3. What are the basic types of Java? Is String a basic type in Java? Why does String have to be of final type?

The first two questions are based on the investigation. The third question requires you to reflect on your own. Why should it be set to a final type? You have to think about what characteristics the final modification class has? What role does it play here?

4. What is the underlying implementation of the reflection mechanism? What about dynamics? Dynamic implementation principle?

This can also be regarded as an examination of whether the basic knowledge is solid, focusing on dynamics and the relationship between dynamics and reflection.

5. Do you understand HashMap? Tell me something related to HashMap? Is HashMap thread-safe? Why is it thread safe? ConcurrentHashMapDo you understand? How does he achieve thread safety? Did you just say that 1.8 is based on CAS? How to solve the ABA problem of CAS?

These are a few questions,

HashMap

  • You have to tell me what HashMap is,
  • What data structure is used to implement the bottom layer?
  • It’s best to tell me about the put process
  • What is it like in each version of the JDK version?
  • Why is HashMap thread-unsafe?

ConcurrentHashMapQuestion

  • ConcurrentHashMapWhat is it?
  • ConcurrentHashMapWhat is the underlying data structure?
  • JDK Different versions, what are the differences in design of ConcurrentHashMap

CASQuestion

  • What is CAS?
  • CASWhat is the problem
  • ABAWhat is the problem
  • ABAHow to solve the problem

Don't even think about reading this question, many people are hung up on this question. Memorize the interview questions and have a little bit of understanding, and you can handle these problems.

6. Tell me about the threading model of JVM? What are these areas used for? Pay attention to the distinction between the java thread model and the jvm thread model. To summarize, many articles on the Internet are wrong.

What we examine is the JVM memory model, and usually also the JVM runtime data area. Note that you must not bring in the Java memory model here. The Java memory model is called JMM.

When it comes to the JVM runtime data area, thread private and thread sharing will be mentioned.

Especially the Java virtual machine stack, heap, and method area. These three must be explained clearly.

What is the relationship between stack and thread? What is stored in the stack? Why SOF?

The heap is related to object memory allocation, so we will definitely talk about the life cycle of the object. Then will talk about how classes are loaded into the JVM? How to determine if an object is dead? We will also talk about what are the garbage collection algorithms? What are the garbage collectors? What is the latest garbage collector? What are the features?

What JVM tuning parameters are you familiar with?

A lot of people will fail this question. I have also conducted online mock interviews with many people. When it comes to JVM, 90% of them will fail.

7. Tell me about the working mechanism of the Java class loader? In which area is class loading performed?

As mentioned in the above question, this class loading related question will definitely ask, indicating that you know how a class goes from the .class file to the Class object, then go to the actual example process to see how familiar you are

These questions can also be fed back from the side, how do you run each line of your code, and what problems will there be? Know something.

8. Let’s talk about Java’s threading model? Do you understand volatile? What is his rationale? Is violate thread safe? Why not?

You need to be familiar with the Java thread model, and you also need to understand volatile. What are its characteristics, such as visibility, anti-rearrangement, and atomicity. You also need to understand these.

This question is relatively theoretical, and you can basically solve it by memorizing the interview questions.

9. What are the solutions to ensure thread safety? Let’s talk about read-write locks. The read

of read-write locks are all theoretical. You can solve them by memorizing the interview questions. You don’t have to have used them before. Just go down and prepare yourself

10. What kinds of indexes are there in the database? Why use B-tree for indexing? What is the difference between a combined index and several individual indexes? Do you understand the optimization of large table queries in databases? MVCC Do you understand the mechanism? MVCCWhat’s wrong with the mechanism? How to solve this problem? MySQL Have you done any slow statement tuning? Tell me how you did it?

This is equivalent to 8 consecutive questions of the MySQL database. How many of the 8 consecutive questions can you answer? Basically, I usually read more interview experience and memorize the interview questions to cope with it.

11. Do you understand Redis? Can you tell me how to use Redis to implement distributed locks?

This question actually seems simple, but the answer is not that simple.

There are many social things here, not just a simple setnx, LUA script can be solved, involving Redis cluster mode, involving business timeout and other issues. The interviewer has arranged it for you. This requires some real materials. Memorizing the interview questions can only cope with the more superficial interviewers. If you meet the more serious interviewer, you have to use your own real materials to answer the questions. .

12. The scope of Bean in Spring and the controller of Spring MVC are thread-safe. ? How to ensure thread safety?

There is no to about this question, because major public accounts and my public account have posted similar articles before, so I have time. Don’t underestimate the importance of public accounts. It’s just about accumulation. When you are resting in the car, on the subway, or at your work station, you can use some trivial time to read some technical official articles and accumulate your own knowledge.

Summary

To be honest, we can pass 90% of the above questions Memorize the interview questions to solve. There may be some questions that you need to really experience before you can solve them.

But I always believe that:With less than five years of work experience, interviews can basically be solved by memorizing interview questions.

The above is the detailed content of Meituan, see if you can answer it?. For more information, please follow other related articles on the PHP Chinese website!

Statement
This article is reproduced at:Java后端技术全栈. If there is any infringement, please contact admin@php.cn delete
面试官:Spring Aop 常见注解和执行顺序面试官:Spring Aop 常见注解和执行顺序Aug 15, 2023 pm 04:32 PM

你肯定知道 Spring , 那说说 Aop 的去全部通知顺序, Spring Boot 或者 Spring Boot 2 对 aop 的执行顺序影响?说说你在 AOP 中遇到的那些坑?

某团面试:如果线上遇到了OOM,你该如何排查?如何解决?哪些方案?某团面试:如果线上遇到了OOM,你该如何排查?如何解决?哪些方案?Aug 23, 2023 pm 02:34 PM

OOM 意味着程序存在着漏洞,可能是代码或者 JVM 参数配置引起的。这篇文章和读者聊聊,Java 进程触发了 OOM 后如何排查。

饿了么笔试题,看似简单,难倒一批人饿了么笔试题,看似简单,难倒一批人Aug 24, 2023 pm 03:29 PM

在很多公司的笔试题中,千万别小看,都是有坑的,一不小心自己就掉进去了。遇到这种关于循环的笔试题,建议,自己冷静思考,一步一步来。

小白也能与BAT面试官对线:CAS小白也能与BAT面试官对线:CASAug 24, 2023 pm 03:09 PM

Java并发编程系列番外篇C A S(Compare and swap),文章风格依然是图文并茂,通俗易懂,让读者们也能与面试官疯狂对线。

上周,XX保险面试,凉了!!!上周,XX保险面试,凉了!!!Aug 25, 2023 pm 03:44 PM

上周,一位群里的朋友去平安保险面试了,结果有些遗憾,蛮可惜的,但希望你不要气馁,正如你所说的,面试中遇到的问题,基本上都是可以通过背面试题解决的,所以请加油!

5道String面试题,能全答对的人不到10%!(附答案)5道String面试题,能全答对的人不到10%!(附答案)Aug 23, 2023 pm 02:49 PM

​这篇来看看关于 Java String类的 5 道面试题,这五道题,我自己在面试过程中亲身经历过几道题目,本篇就带你了解这些题的答案为什么是这样。

美团一面,看看你能否回答上来?美团一面,看看你能否回答上来?Aug 24, 2023 pm 03:51 PM

美团一面,看看你能否回答上来?

美团面试:请手写一个快排,被我怼了!美团面试:请手写一个快排,被我怼了!Aug 24, 2023 pm 03:20 PM

快速排序由C. A. R. Hoare在1962年提出。它的基本思想是:通过一趟排序将要排序的数据分割成独立的两部分,其中一部分的所有数据都比另外一部分的所有数据都要小,然后再按此方法对这两部分数据分别进行快速排序,整个排序过程可以[递归]进行,以此达到整个数据变成有序序列。

See all articles

Hot AI Tools

Undresser.AI Undress

Undresser.AI Undress

AI-powered app for creating realistic nude photos

AI Clothes Remover

AI Clothes Remover

Online AI tool for removing clothes from photos.

Undress AI Tool

Undress AI Tool

Undress images for free

Clothoff.io

Clothoff.io

AI clothes remover

AI Hentai Generator

AI Hentai Generator

Generate AI Hentai for free.

Hot Article

R.E.P.O. Energy Crystals Explained and What They Do (Yellow Crystal)
2 weeks agoBy尊渡假赌尊渡假赌尊渡假赌
Repo: How To Revive Teammates
1 months agoBy尊渡假赌尊渡假赌尊渡假赌
Hello Kitty Island Adventure: How To Get Giant Seeds
4 weeks agoBy尊渡假赌尊渡假赌尊渡假赌

Hot Tools

SAP NetWeaver Server Adapter for Eclipse

SAP NetWeaver Server Adapter for Eclipse

Integrate Eclipse with SAP NetWeaver application server.

MinGW - Minimalist GNU for Windows

MinGW - Minimalist GNU for Windows

This project is in the process of being migrated to osdn.net/projects/mingw, you can continue to follow us there. MinGW: A native Windows port of the GNU Compiler Collection (GCC), freely distributable import libraries and header files for building native Windows applications; includes extensions to the MSVC runtime to support C99 functionality. All MinGW software can run on 64-bit Windows platforms.

VSCode Windows 64-bit Download

VSCode Windows 64-bit Download

A free and powerful IDE editor launched by Microsoft

MantisBT

MantisBT

Mantis is an easy-to-deploy web-based defect tracking tool designed to aid in product defect tracking. It requires PHP, MySQL and a web server. Check out our demo and hosting services.

mPDF

mPDF

mPDF is a PHP library that can generate PDF files from UTF-8 encoded HTML. The original author, Ian Back, wrote mPDF to output PDF files "on the fly" from his website and handle different languages. It is slower than original scripts like HTML2FPDF and produces larger files when using Unicode fonts, but supports CSS styles etc. and has a lot of enhancements. Supports almost all languages, including RTL (Arabic and Hebrew) and CJK (Chinese, Japanese and Korean). Supports nested block-level elements (such as P, DIV),