More excellent articles.

“Microservices are not all, just a subset of a specific domain”

Selection and process should be careful, otherwise it will be out of control.

Out of all the monitoring components, there’s always one for you

The Most Common Set of “Vim” Techniques for Linux Production

What are we Developing with Netty?

Linux five-piece or something.

“Linux” Cast Away (1) Preparation”

Linux: Cast Away (2) CPU

Linux cast Away (3) Memory

Linux cast Away (4) I/O

Linux cast Away (5) Network Chapter

Ha ha, life needs fun, fun to learn! Pull egg text, come from reality, if have the same, pure and intentional. Pay more attention to the wechat official account xjjdog, which is not just bullshit.

All roads lead to Rome, and Rome is TreeMap.

I strolled over from the assembly

Interviewer 1: What are the Java collection classes?

A. list, set, map b. list, map

Interviewer 1: What is the internal structure of a HashMap?

A: Answer array linked list red black tree bala bala.

Interviewer 1: Can hashMaps be sorted?

A: Good, because it’s called hash.

Interviewer 1: What are the sortable maps in Java?

A: I don’t know.

Interviewer 1: I get to know you. You can go home.

I run from the fragrance of redis

Interviewer 1: Has Redis used it?

A: sure

Interviewer 1: What data structures does Redis have?

A: Five basic ones and four less common ones.

Interviewer 1: Wait, what do you mean “zset”?

A: Ordered set, can do leaderboard with what.

Interviewer 1: What is its underlying structure?

A: Let’s just say the most common one is a skip watch.

Interviewer 1: Is there a similar Set in Java?

A: I’m not sure.

Interviewer 1: I get to know you. You can go home.

Just want to talk about the Map

Interviewer 1: What do you use LinkedHashMap for?

A: I did a simple LRU with it.

Interviewer 1: Can it sort by Key?

Answer: can of, did LRU.

Interviewer 1: You don’t get what I mean. I mean, can you sort by the rules?

A: I don’t think so.

Interviewer 1: Is there any sort of Map?

A: I put all the keys in the list first, then sort the list, then iterate over the list output.

Interviewer 1: I’m asking if there’s an API out there.

A: I don’t know.

Interviewer 1: I get to know you. You can go home.

I came from the configuration file

Interviewer 1: What do you know about Properties?

A: Yes, it inherits Hashtable and is thread-safe.

Interviewer 1: I asked about the configuration file. Do you know how to translate it into YML?

A: Iterate through the parsing and then store it in a multi-tiered HashMap.

Interviewer 1: Is there a more elegant way? Let’s say it’s in a tree.

A: I don’t understand. Do you mean binary trees or red-black trees?

Interviewer 1: I think you were talking about red black trees. Is there any implementation in Java?

A: A HashMap list that is longer than 8 looks like a red-black tree.

Interviewer 1: Are there any other places?

A: I don’t know.

Interviewer 1: I get to know you. You can go home.

I came from Multithreading

Interviewer 1: Know about thread-safe maps?

A: Hashtable, but ConcurrentHashMap is recommended.

Interviewer 1: Thread-safe, sortable maps?

A: ConcurrentSkipListMap.

Interviewer 1: Well, is there any other way?

A: I don’t think so.

First interviewer: you wouldn’t use the Collections. SynchronizedMap TreeMap ah

A:…

Interviewer 1: I get to know you. You can go home.

I forced it from distributed storage

Interviewer 1: How can I quickly tell if a key exists in distributed storage?

A: The Bloom filter?

Interviewer 1: That’s great. How do you sort these keys quickly?

A: Using an index is the fastest. For example, b+tree.

Interviewer 1: What if I’m a coordinate node and I don’t have a specific store?

A: Then sort it in memory.

Interviewer 1: Is there such a collection in Java that can be sorted?

A: ArrayList is ok.

Interviewer 1: Do you need to take the key data again? Can’t you put it in a Map? Is there a sortable Map? It’s a lot easier when you have one.

A: I see what you mean. No.

Interviewer 1: I get to know you. You can go home.

I just wanted to ask

Interviewer 1: Does TreeMap understand?

A: I understand. Tree Map.

Interviewer 1: What is the underlying structure?

A: Trees and hashes.

Interviewer 1: What tree? What Hash? Make it clear.

A: TreeMap Tree, HashMap Hash.

Interviewer 1: Do you know TreeMap at all?

A: I know. It’s a tree Map.

Interviewer 1: If you have no other questions, just a moment.

Afraid afraid of

Interviewer 1: In what situations is TreeMap used?

A: I know that, but I design most of the company’s technical architecture and haven’t touched the code in a long time.

Interviewer 1: Tell me briefly what the basic sets are.

A: Yes, I use TreeMap a lot. A few colleagues fell into several traps when they used it, and I helped point it out. Do you have any other project management questions?

Interviewer 1: Wait, wait, wait. I’m very curious about your trap question. Can you give me a brief introduction?

A: This is also easy to understand, and some scenarios that are not suitable for TreeMap should be avoided. For these scenarios, we have code plug-ins for IDEA and tools like Solar to scan the code and find that it is also very simple. By the way, are you familiar with vscode? I can tell you about plug-in development.

Interviewer 1:… I just want to know what you know about TreeMap.

A: As I said earlier, TreeMap is one of the basic sets with many common pitfalls. However, it can be avoided in project management, which is the rational application of methodology.

Interviewer 1: If you have no other questions, just a moment.

You are lucky

Interviewer 1: Know what sort of maps are available in Java?

A: the TreeMap. In terms of its internal structure, a TreeMap is essentially a red-black tree, and each Entry of a TreeMap is a node of the red-black tree.

Interviewer 1: You can start work tomorrow.

End

TreeMap is a red black tree. I am the number one TreeMap interviewer in China, and this is the story of my past.