Cache, cache algorithm, cache framework: Part 1

Source: Internet
Author: User

 

This article is very interesting.ProgramThe interview started with an interesting introduction to cache-related topics. This series of articles is very interesting. I happen to have a plan to learn cache this month, so I am going to translate this series of articles. It is a translation, but it is only translated according to your own understanding. If it is inaccurate, please forgive me. If you are also interested, you can check the original article.

Introduction

We have heard of cache. When you ask them what cache is, they will give you a perfect answer, but they do not know how the cache is built, or do not tell you which criteria should be used to select the cache framework. In this article, we will discuss cache and CacheAlgorithm, The cache framework and which cache framework will be better.

Interview

"Cache is a temporary place for storing data (frequently used data). Because it is too costly to retrieve the original data, I can get it faster ."

This is the answer of programmer one (programmer one is an interviewer) during the interview (a month ago, he submitted his resume to the company and wanted to apply for a request in cache, cache framework, java Development jobs with rich experience in large-scale data operations ).

Programmer one implements his own cache through hashtable, but all he knows is that his cache and his hashtable that stores 150 records, this is what he thinks is massive data (Cache = hashtable, you just need to find it in hashtable). So let's take a look at the interview process.

Interviewer: What standards are the cache schemes you choose based on?
Programmer one: Uh, (thought for five minutes) Um, based on, based on data (Cough ......)
Interviewer: Excese me! Can I repeat it?
Programmer one: Data ?!
Interviewer: Okay. Several caching algorithms and their functions
Programmer one(Staring at the interviewer, with a strange look on his face, no one knows that humans can make this look .)
)

Interviewer: Okay, let me change my mind. What will happen when the cache reaches the capacity?
Programmer one: Capacity? Well (thinking ...... There is no limit on hashtable capacity. I can add any entry and it will automatically expand the capacity) (this is the idea of programmer one, but he didn't say it)

The interviewer thanked programmer one (the interview lasted for 10 minutes). Then a lady came over and said, Thank you for your time. We will call you and wish you a good mood. This is the worst interview for programmer one (he didn't see any background requirements for recruitment for a job seeker with rich caching experience. In fact, he only saw great rewards
).

To achieve

After programmer one leaves, he wants to know the questions and answers that the subject has said, so he goes online to check that programmer one knows nothing about the cache, except: When I need to cache, I will use hashtable.

After using his favorite search engine, he found a good article about cache and started to read ......

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.