Web Storage MCQ Questions and Answers
Web Storage MCQs : This section focuses on "Web Storage" in Html. These Multiple Choice Questions (MCQs) should be practiced to improve the Html skills required for various interviews (campus interview, walk-in interview, company interview), placement, entrance exam and other competitive examinations.
1. How many storages are there?
A. 2
B. 3
C. 4
D. 5
View Answer
Ans : A
Explanation: The two storages are session storage and local storage and they would be used to handle different situations.
2. Cookies are limited to about_______ of data
A. 1 KB
B. 2 KB
C. 4 KB
D. 8 KB
View Answer
Ans : C
Explanation: Cookies are limited to about 4 KB of data
3. Cookies are included with every HTTP request
A. TRUE
B. FALSE
C. Can be true or false
D. Can not say
View Answer
Ans : A
Explanation: Cookies are included with every HTTP request, thereby sending data unencrypted over the internet.
4. The ___________ is designed for scenarios where the user is carrying out a single transaction, but could be carrying out multiple transactions in different windows at the same time.
A. Local Storage
B. Session Storage
C. Both A and B
D. None of the above
View Answer
Ans : B
Explanation: The Session Storage is designed for scenarios where the user is carrying out a single transaction, but could be carrying out multiple transactions in different windows at the same time.
5. To clear a local storage setting you would need to call?
A. localStorage.clear() method
B. localStorage.remove() method
C. localStorage.remove('key') method
D. None of the above
View Answer
Ans : C
Explanation: To clear a local storage setting you would need to call localStorage.remove('key'); where 'key' is the key of the value you want to remove. If you want to clear all settings, you need to call localStorage.clear() method.
6. The Session Storage Data would be deleted by the browsers immediately ________ the session gets terminated.
A. before
B. after
C. after 5 mins
D. before 5 mins
View Answer
Ans : B
Explanation: The Session Storage Data would be deleted by the browsers immediately after the session gets terminated.
7. Before HTML5 where data had to be stored?
A. cookies
B. browser
C. only in Internet Explorer
D. only in Chrome
View Answer
Ans : A
Explanation: When HTML5 was not introduced application data had to store in cookies when server requested for it. Web storage was secure then as well as large data could be stored even it does not affect performance. After coming of HTML5 web applications can store data within the browser that the user is using.
8. What is the limit of character storage for chrome 23.0 in localStorage?
A. unlimited
B. 1021 k
C. 4.98 M
D. None of the above
View Answer
Ans : D
Explanation: We can’t store any character in localStorage in chrome 23.0, for chrome 18.0 it is unlimited i.e. can store any number of characters, for chrome 19.77 it is 1021 k, for chrome 22.0 it is 2.49 M, for chrome 24.0, 25.0, 27.0 it is 2.49 M, for chrome 28.0, 30.0, 31.0 and 31.1 it is 4.98 M.
9. Which of the following is not a web storage interface?
A. storage
B. window
C. storageEvent
D. privacy
View Answer
Ans : D
Explanation: There is only three web storage interface window, storage, and StorageEvent. Window object provides access to the local storage objects. Storage retrieves, set and remove data from the domain. Storage event is fired when the storage area on a document’s window changes.
10. The Local Storage is designed for storage that spans multiple windows, and lasts beyond the current session.
A. Yes
B. No
C. Can be true or false
D. Can not say
View Answer
Ans : A
Explanation: Yes, The Local Storage is designed for storage that spans multiple windows, and lasts beyond the current session.
Discussion