1. Which of the following is a type of non-volatile memory?
ANS : (c) ROM (Read-Only Memory) is a type of non-volatile memory that retains its contents even when the power is turned off, unlike RAM (Random Access Memory), which is volatile.
2. What does CPU stand for?
ANS : (a) CPU stands for Central Processing Unit, which is the primary component of a computer that performs most of the processing inside a computer.
3. Which of the following is a characteristic of object-oriented programming?
ANS : (d) Object-oriented programming is characterized by encapsulation, inheritance, and polymorphism.
4. What is the primary purpose of an operating system?
ANS : (d) An operating system manages hardware resources, provides a user interface, and executes applications.
5. Which of the following sorting algorithms has the best average-case time complexity?
ANS : (c) Quick Sort has an average-case time complexity of O(n log n), making it more efficient than the other sorting algorithms listed.
6. What is the time complexity of accessing an element in a hash table?
ANS : (c) Accessing an element in a hash table is done in constant time, O(1), on average, due to the use of hash functions.
7. Which of the following is not a type of database model?
ANS : (d) Linear is not a recognized database model; Hierarchical, Network, and Relational are.
8. In which layer of the OSI model does the TCP protocol operate?
ANS : (b) TCP operates at the Transport Layer of the OSI model, providing reliable communication.
9. Which of the following is a valid IPv4 address?
ANS : (a) 192.168.1.1 is a valid IPv4 address; the others exceed the maximum value for an octet.
10. What is the main purpose of a compiler?
ANS : (b) A compiler translates high-level programming languages into machine code.
11. Which data structure uses the FIFO (First In First Out) principle?
ANS : (b) A queue follows the FIFO principle, meaning the first element added is the first one to be removed.
12. What is the maximum depth of a binary tree with n nodes?
ANS : (d) The maximum depth of a binary tree can be n-1 when it is skewed.
13. Which of the following is a characteristic of a linked list?
ANS : (b) A linked list can grow and shrink in size dynamically.
14. What does SQL stand for?
ANS : (a) SQL stands for Structured Query Language, used for managing relational databases.
15. Which of the following is a type of malware?
ANS : (d) All listed options (Virus, Worm, Trojan Horse) are types of malware.
16. What is the primary function of a router?
ANS : (a) A router connects different networks and forwards data packets between them.
17. Which algorithm is used for finding the shortest path in a graph?
ANS : (b) Dijkstra's Algorithm is used to find the shortest path in a weighted graph.
18. What is the purpose of a firewall?
ANS : (b) A firewall protects a network by monitoring and controlling incoming and outgoing traffic.
19. Which of the following is a programming paradigm?
ANS : (d) All of the above are recognized programming paradigms.
20. What is the main advantage of using a linked list over an array?
ANS : (b) Linked lists can easily grow and shrink in size, while arrays have a fixed size.
21. What is the purpose of an HTML element's "id" attribute?
ANS : (b) The "id" attribute is used to uniquely identify an HTML element, which can be used in CSS and JavaScript.
22. What is the function of the "alt" attribute in an image tag?
ANS : (b) The "alt" attribute provides a description of the image, which is important for accessibility, especially for screen readers.
23. What is the purpose of CSS Flexbox?
ANS : (c) Flexbox is used to align and distribute space among items in a container, either horizontally or vertically.
24. What is the purpose of a responsive web design?
ANS : (a) Responsive web design ensures that websites are designed to look good on all devices, regardless of their screen size.
25. What is the use of the "position" property in CSS?
ANS : (b) The "position" property in CSS is used to position an element relative to its normal position or to its parent element.
26. What is the difference between the "display: none" and "visibility: hidden" CSS properties?
ANS : (a) "display: none" removes the element completely from the document flow, whereas "visibility: hidden" hides the element but still takes up space in the layout.
27. What is JavaScript used for in web development?
ANS : (b) JavaScript is primarily used to make websites interactive and dynamic by manipulating the HTML and CSS on the page.
28. What does "AJAX" stand for?
ANS : (a) AJAX stands for Asynchronous JavaScript and XML, which allows for the asynchronous loading of data without refreshing the page.
29. What is the difference between "let" and "const" in JavaScript?
ANS : (a) "let" allows reassignment of values, while "const" is used for values that cannot be reassigned after initialization.
30. What is the use of the "target='_blank'" attribute in a link?
ANS : (a) The "target='_blank'" attribute in a link ensures that the linked document opens in a new tab or window.
31. What is the purpose of the "box-sizing" property in CSS?
ANS : (a) The "box-sizing" property controls how the total width and height of an element is calculated, including padding and border.
32. What is the difference between "==" and "===" in JavaScript?
ANS : (a) "==" compares only the values of variables, while "===" compares both the value and the data type.
33. What is the purpose of the "z-index" property in CSS?
ANS : (b) The "z-index" property specifies the stack order of elements, allowing you to control which element appears on top of others.
34. What does "JSON" stand for?
ANS : (a) JSON stands for JavaScript Object Notation and is a lightweight data interchange format that is easy for humans to read and write.
35. What does "SQL" stand for?
ANS : (a) SQL stands for Structured Query Language, which is used for managing and manipulating relational databases.
36. What is the difference between "null" and "undefined" in JavaScript?
ANS : (a) "null" represents the intentional absence of any object value, while "undefined" means a variable has been declared but has not been assigned a value.
37. What is the purpose of the "overflow" property in CSS?
ANS : (a) The "overflow" property in CSS controls how content is displayed when it overflows the bounds of its container.
38. What does the "box-shadow" property in CSS do?
ANS : (a) The "box-shadow" property adds a shadow effect around an element's frame.
39. What does the "viewport" in responsive web design refer to?
ANS : (a) In responsive web design, the "viewport" refers to the visible area of a web page on the screen, adjusting for different screen sizes.
40. What does the "async" attribute do in a script tag?
ANS : (a) The "async" attribute allows a script to be executed asynchronously, enabling the page to load without waiting for the script.
41. What is the purpose of the "alt" attribute in an `
` tag?
ANS : (b) The "alt" attribute specifies alternative text to display when an image cannot be shown, improving accessibility.
42. What does the "flex" property do in CSS?
ANS : (a) The "flex" property in CSS allows elements to grow and shrink according to the available space in a flex container.
43. What is the purpose of the "event delegation" technique in JavaScript?
ANS : (a) Event delegation involves handling events on a parent element rather than individual child elements, improving performance and manageability.
44. What is the difference between "localStorage" and "sessionStorage" in JavaScript?
ANS : (a) "localStorage" persists data even after the browser is closed, while "sessionStorage" stores data for the duration of a single session.
45. What does the "async" attribute do when added to a "script" tag?
ANS : (a) The "async" attribute allows the script to load and execute asynchronously, without blocking the parsing of the HTML document.
46. What is the purpose of the "transition" property in CSS?
ANS : (a) The "transition" property in CSS allows for smooth transitions between changes in element properties over a specified duration.
47. What is a RESTful API?
ANS : (a) A RESTful API uses HTTP methods (GET, POST, PUT, DELETE) to perform CRUD operations on resources (data objects).
48. What does the "async/await" pattern do in JavaScript?
ANS : (a) The "async/await" pattern allows asynchronous code to be written in a synchronous style, making it easier to handle asynchronous operations.
49. What is the purpose of the "clear" property in CSS?
ANS : (c) The "clear" property in CSS prevents floating elements from overlapping by ensuring the cleared element is below floating content.
50. What is the purpose of the "box-sizing" property in CSS?
ANS : (a) The "box-sizing" property determines how the total width and height of an element are calculated, including padding and border.