Explore topic-wise InterviewSolutions in .

This section includes InterviewSolutions, each offering curated multiple-choice questions to sharpen your knowledge and support exam preparation. Choose a topic below to get started.

1.

What Happens To The Data Stored In Memcached When Server Accidently Gets Shut Down?

Answer»

In MEMCACHED, DATA is not permanently stored. It is not a DURABLE data so, if the server is SHUT down or RESTARTED then all the data stored in Memcached will be deleted.

In Memcached, data is not permanently stored. It is not a durable data so, if the server is shut down or restarted then all the data stored in Memcached will be deleted.

2.

What Is Dogpile Effect? How Can You Prevent This Effect?

Answer»

If the CACHE expires, and WEBSITES are hit by multiple requests made by the client at the same TIME, this EFFECT is known as Dogpile effect.

This effect can be PREVENTED by using semaphore lock. In this system when value expires, first process acquires the lock and starts generating new value.

If the cache expires, and websites are hit by multiple requests made by the client at the same time, this effect is known as Dogpile effect.

This effect can be prevented by using semaphore lock. In this system when value expires, first process acquires the lock and starts generating new value.

3.

How Would You Update Memcached When Data Changes?

Answer»

There are two methods to update Memchached when data changes:

By clearing the cache PROACTIVELY: You can update Memcached by clearing the cache while insertion or updation is made.

By resetting the cache: It is slightly similar to the FIRST method but it doesn't delete the keys and WAIT for the NEXT request for the data to refresh the cache, it resets the values after the insert or update.

There are two methods to update Memchached when data changes:

By clearing the cache proactively: You can update Memcached by clearing the cache while insertion or updation is made.

By resetting the cache: It is slightly similar to the first method but it doesn't delete the keys and wait for the next request for the data to refresh the cache, it resets the values after the insert or update.

4.

How To Close The Connection?

Answer»

By USING this COMMAND:

QUIT

By using this command:

Quit

5.

How To Get The Versions?

Answer»

By USING this COMMAND:

VERSION

By using this command:

Version

6.

How To Show The Stats?

Answer»

By USING this COMMAND:

STATS

By using this command:

stats

7.

How To Delete The Key?

Answer»

By USING this COMMANDDELETE KEY

By using this command: delete key

8.

How To Prepend Value Of Key?

Answer»

By using this FORMAT:

PREPEND[KEY][flags][exptim][BYTES][noreply]

By using this format:

prepend[key][flags][exptim][bytes][noreply]

9.

How To Append The Value Of Key?

Answer»

By using this format:

APPEND[key][FLAGS][exptim][bytes][noreply]

By using this format:

append[key][flags][exptim][bytes][noreply]

10.

How To Replace The Value Of Key?

Answer»

By using this FORMAT:

REPLACE[KEY][FLAGS][exptim][bytes][noreply]

By using this format:

replace[key][flags][exptim][bytes][noreply]

11.

How To Add Value In Key?

Answer»

By USING this format:

ADD[key][flags][exptim][BYTES][noreply]

By using this format:

add[key][flags][exptim][bytes][noreply]

12.

How To Set The Value Of Key?

Answer»

By using this FORMAT:

SET[KEY][FLAGS][exptim][BYTES][noreply]

By using this format:

set[key][flags][exptim][bytes][noreply]

13.

How To Get The Value Of Key?

Answer»

By USING this COMMAND: GET KEY

By using this command: get key

14.

How To Connect Memcached Server With Telnet Command?

Answer»

By USING this MEMCACHED COMMAND:

TELNET ostname portNumber

By using this memcached command:

telnet ostname portNumber

15.

What Is The Difference Between Sap Hana And Memcached?

Answer»

SAP HANA is an in-memory RDBMS and MOSTLY used for accelerating SAP applications while MEMCACHED is a key/value caching system and used for ACCESSING both RDBMS and NOSQL databases.

SAP HANA is an in-memory RDBMS and mostly used for accelerating SAP applications while Memcached is a key/value caching system and used for accessing both RDBMS and NOSQL databases.

16.

If Server Gets Shut Down Then Data Stored In Memcached Is Still Available?

Answer»

In Memcached, data is not permanently stored. This data is not DURABLE so if the SERVER is shut down or restarted then all the data stored in Memcached is DELETED.

In Memcached, data is not permanently stored. This data is not durable so if the server is shut down or restarted then all the data stored in Memcached is deleted.

17.

What Is Dogpile Effect? How To Prevent This Effect?

Answer»

Dogpile effect is a situation when CACHE expires, and websites are HIT by MULTIPLE REQUESTS made by the client at the same time.

You can prevent this effect by using semaphore lock. In this system when value expires, first process acquires the lock and starts generating NEW value.

Dogpile effect is a situation when cache expires, and websites are hit by multiple requests made by the client at the same time.

You can prevent this effect by using semaphore lock. In this system when value expires, first process acquires the lock and starts generating new value.

18.

How Can You Update Memcached When Data Changes?

Answer»

There are two ways to update Memcached when data changes:

By clearing the cache proactively: You can update memcached by clearing the cache when an insert or update is made.

By RESETTING the cache: It is slightly SIMILAR to the FIRST method but rather than just deleting the keys and waiting for the NEXT request for the data to REFRESH the cache, it resets the values after the insert or update.

There are two ways to update Memcached when data changes:

By clearing the cache proactively: You can update memcached by clearing the cache when an insert or update is made.

By resetting the cache: It is slightly similar to the first method but rather than just deleting the keys and waiting for the next request for the data to refresh the cache, it resets the values after the insert or update.

19.

How Can You Minimize The Memcached Server Outages?

Answer»

Following are the methods to minimize the Memcached server outage:

When one instance fails, several of them goes down, this will put larger load on the database server when the client reloaded the lost data. To avoid this, you should write your code to minimize cache stampedes, it will leave a COMPARATIVELY less impact.

You can bring up an instance of Memcached on a new machine using the lost machines IP address.

Code is ANOTHER option to minimize server outages as it gives you the liberty to change the Memcached server list with minimal work.

Setting timeout VALUE is another option that some Memcached clients implement for Memcached server outage. When your Memcached server goes down, the client will keep trying to send a request till the time-out limit is REACHED.

Following are the methods to minimize the Memcached server outage:

When one instance fails, several of them goes down, this will put larger load on the database server when the client reloaded the lost data. To avoid this, you should write your code to minimize cache stampedes, it will leave a comparatively less impact.

You can bring up an instance of Memcached on a new machine using the lost machines IP address.

Code is another option to minimize server outages as it gives you the liberty to change the Memcached server list with minimal work.

Setting timeout value is another option that some Memcached clients implement for Memcached server outage. When your Memcached server goes down, the client will keep trying to send a request till the time-out limit is reached.

20.

If You Have Multiple Memcache Servers And One Of The Memcache Server Fails Which Has Your Data, Will It Ever Try To Get Key Data From That One Failed Server?

Answer»

The data in the failed server won't GET removed, but there is a PROVISION for auto-failure, which can be CONFIGURED for multiple NODES. Fail-over can be triggered during any kind of socket or Memcached server level errors and not during normal client errors like adding an existing key, etc.

The data in the failed server won't get removed, but there is a provision for auto-failure, which can be configured for multiple nodes. Fail-over can be triggered during any kind of socket or Memcached server level errors and not during normal client errors like adding an existing key, etc.

21.

Is It Possible To Share A Single Instance Of Memcache Between Multiple Projects?

Answer»

Yes, it is POSSIBLE to share a single instance of Memcache between multiple projects because Memcache is a MEMORY store space and it can be run on one or more SERVERS. You can also run two DIFFERENT Memcache processes on the same host and yet they are COMPLETELY independent.

Yes, it is possible to share a single instance of Memcache between multiple projects because Memcache is a memory store space and it can be run on one or more servers. You can also run two different Memcache processes on the same host and yet they are completely independent.

22.

In Which Conditions Cache Cannot Retain The Stored Information?

Answer»

CACHE cannot retain the STORED information in following conditions:

  • When memory allocated for the cache is EXHAUSTED.
  • When ITEM form cache is DELETED.
  • When individual item in the cache is expired.

Cache cannot retain the stored information in following conditions:

23.

What Are The Drawbacks/ Limitations Of Memcached?

Answer»

A list of limitations or drawbacks of Memcached:

A list of limitations or drawbacks of Memcached:

24.

What Is The Best Usage Of Memcached?

Answer»

Best usage of Memcached:

  1. It is EASY to install in Windows as well as in UNIX OPERATING system.
  2. It provides API integration for all the major languages like JAVA, PHP, C/C++, Python, RUBY, Perl etc.
  3. It enhances the performance of web application by caching.
  4. It reduces the burden of DATABASE server.
  5. It facilitates you to delete one or more values.
  6. It facilitates you to update the values of keys.

Best usage of Memcached:

25.

In Which Websites And Services Memcached Is Generally Used?

Answer»

Memcached can be USED for:

  • Social networking SITES for PROFILE CACHING
  • For content aggregation i.e. HTML/Page caching
  • In E-commerce websites for Session and HTML caching
  • In location based services for database query scaling
  • In gaming and entertainment services for session caching
  • It can also be used to track cookie/ profile for ad targeting.

Memcached can be used for:

26.

When The Initial Version Of Memcached First Launched?

Answer»

The FIRST VERSION of Memcached is LAUNCHED on May, 22, 2003.

The first version of Memcached is launched on May, 22, 2003.

27.

How Memcached Works?

Answer»

See the following steps to understand how Memcached works:

  1. Memcached first try to get the detail of user, Browser send the request to APPLICATION.
  2. Application calls the Memcached for particular user.
  3. If Result FOUND in Memcached, Return the result from Memcached.
  4. If Result Not found in Memcached, Application sends the request to DATABASE and save the result in memcached.
  5. Each Memcached have one unique key.
  6. Get/Set the data works on the behalf of key.
  7. you can also delete one or more KEYS.
  8. You can also assign tags to one/more keys.

See the following steps to understand how Memcached works:

28.

In Which Language Memcached Is Written And Who Is The Author?

Answer»

MEMCACHED is WRITTEN in "C LANGUAGE" and it is written by Danga INTERACTIVE.

Memcached is written in "C language" and it is written by Danga Interactive.

29.

What Is Memcached?

Answer»

Memcached is a general purpose free and open source, high performance, DISTRIBUTED memory object caching system. It is used to speed up database-driven websites by caching data and objects in RAM.

In SIMPLE words you can say that, Memcached is a component which stores data temporally for 1hour/ 6 HOUR/ 12 hours/ 1 day etc. and you can integrate this component with your APPLICATIONS to increase their performance.

Memcached is a general purpose free and open source, high performance, distributed memory object caching system. It is used to speed up database-driven websites by caching data and objects in RAM.

In simple words you can say that, Memcached is a component which stores data temporally for 1hour/ 6 hour/ 12 hours/ 1 day etc. and you can integrate this component with your applications to increase their performance.