Sunday, January 5, 2014

17. What are cookies and cache?

Interviewer: While doing online shopping, I selected a T-Shirt to buy. Before selecting the payment option, I opened another instance of same browser and deleted cookies. After that I tried to select the Payment option. Should I be able to make payment and buy the selected T-Shirt?

Before answering to this question, we should understand what actually cookies and cache are. 

Cookies are simply bits of software placed on your computer when you browse websites. Not all websites have these, but many do, especially the large well-known websites. Websites use cookies so they can track what you are viewing, and although they won't necessarily know you by name (lets hope it never gets to that point), the website will recognize your computer when you come back to visit again. 


Cookies have some beneficial things. For example, when you log on to certain sites, did you ever notice that when you return again you do not have to sign on the next time? That's because it stored your password and id on your machine in a cookie. The same holds true when you purchase goods online, you can return later and your goods are still in your shopping cart (in a cookie!). Cookies are also very beneficial to websites trying to market to you. (Some consider this bad for the consumer as many do not want websites tracking what you like to view online!). For example, if you go to one of the major search engines, like yahoo.com, google.com, search.aol.com, etc. and search for "web cookies", the next time you come back to the website to search again, you may see a large picture or cookie advertisement at the top of your screen. This is NOT what everyone sees, only you! They know you like this a lot because you searched for it last time you were there, so they now show you advertisements because it may be something targeted towards your buying habits. 

Cache files help your browser go faster since it caches the files to be used. These are also left behind on your pc and includes everything, including pictures, sound files, video files, and text that you have browsed. If you share your pc in any way, you probably want to keep these cleaned when you get done browsing.


Cache is just a temporary folder used to load things faster. For example, you visit a website w/ content and images, well, all that is saved in the cache so it won't have to download all the information from the website again. Instead, it get's it from the cache, as a consequence, it loads faster and is not strenuous to the website you visit.


Hope, you have understood this concept now. Here's the answer to above mentioned question:  One would not be able to make the payment and buy the selected T-Shirt as the cookies have been deleted so it would show 'there are no items in the cart'. 


5 comments:

  1. Replies
    1. Software Testing Interview Questions: 17. What Are Cookies And Cache? >>>>> Download Now

      >>>>> Download Full

      Software Testing Interview Questions: 17. What Are Cookies And Cache? >>>>> Download LINK

      >>>>> Download Now

      Software Testing Interview Questions: 17. What Are Cookies And Cache? >>>>> Download Full

      >>>>> Download LINK 91

      Delete
  2. Nicely explained.. Do you have a post or if you can write one on different types of cookies. I came to know recently in one of the interview there are some third parties cookies also.

    Another question:- Suppose there is change in a website logo, and we don't want data to be picked up from cache. What can be done from server side to avoid picking data from cache.

    ReplyDelete
  3. This comment has been removed by a blog administrator.

    ReplyDelete
  4. Software Testing Interview Questions: 17. What Are Cookies And Cache? >>>>> Download Now

    >>>>> Download Full

    Software Testing Interview Questions: 17. What Are Cookies And Cache? >>>>> Download LINK

    >>>>> Download Now

    Software Testing Interview Questions: 17. What Are Cookies And Cache? >>>>> Download Full

    >>>>> Download LINK Z8

    ReplyDelete