PU CET Lahore (Engineering & CS) computer science IT Basics — Set 3

IT Basics MCQs set 3 for PU CET Lahore (Engineering & CS) computer science — 20 solved questions.

PU CET Lahore (Engineering & CS) computer science IT Basics — Set 3

  1. Question 1

    Q1. What is the time complexity of Linear Search?

    • A) O(1)
    • B) O(log n)
    • C) O(n)
    • D) O(n log n)

    Answer: O(n)

    Explanation: Linear Search checks each element sequentially, resulting in a time complexity of O(n) as the number of comparisons grows linearly with the size of the input.

  2. Question 2

    Q2. What is the purpose of a database index?

    • A) To improve data security
    • B) To improve query performance
    • C) To reduce data redundancy
    • D) To enforce data consistency

    Answer: To improve query performance

    Explanation: A database index improves query performance by providing a quick way to locate specific data, reducing the need for full table scans.

  3. Question 3

    Q3. What is the difference between HTTP and HTTPS?

    • A) HTTP is secure, while HTTPS is not
    • B) HTTP is used for data transfer, while HTTPS is used for file transfer
    • C) HTTP is used for file transfer, while HTTPS is used for data transfer
    • D) HTTP is not secure, while HTTPS is secure

    Answer: HTTP is not secure, while HTTPS is secure

    Explanation: HTTPS (Hypertext Transfer Protocol Secure) is an extension of HTTP, adding an extra layer of security by using encryption to protect data in transit.

  4. Question 4

    Q4. What is the purpose of a cookie?

    • A) To store user data on the client-side
    • B) To store user data on the server-side
    • C) To authenticate users
    • D) To authorize users

    Answer: To store user data on the client-side

    Explanation: Cookies store user data on the client-side, allowing websites to remember user preferences, session information, and other relevant data.

  5. Question 5

    Q5. What is the purpose of a cache?

    • A) To improve storage capacity
    • B) To reduce memory access time
    • C) To increase CPU speed
    • D) To optimize system performance

    Answer: To reduce memory access time

    Explanation: A cache is a small, fast memory that stores frequently accessed data, reducing memory access time and improving system performance.

  6. Question 6

    Q6. What is the purpose of a deadlock detection algorithm?

    • A) To prevent deadlocks
    • B) To detect deadlocks
    • C) To avoid deadlocks
    • D) To recover from deadlocks

    Answer: To detect deadlocks

    Explanation: A deadlock detection algorithm is used to detect deadlocks, which occur when two or more processes are blocked, waiting for each other to release resources.

  7. Question 7

    Q7. What is the purpose of a relational database?

    • A) To store data in a hierarchical structure
    • B) To store data in a relational structure
    • C) To store data in a network structure
    • D) To store data in a flat structure

    Answer: To store data in a relational structure

    Explanation: A relational database stores data in a relational structure, using tables, rows, and columns to organize and relate data.

  8. Question 8

    Q8. What is the purpose of a SQL query?

    • A) To create a database schema
    • B) To insert, update, or delete data
    • C) To retrieve specific data
    • D) To optimize database performance

    Answer: To retrieve specific data

    Explanation: A SQL query is used to retrieve specific data from a database, using commands such as SELECT, FROM, and WHERE to filter and manipulate data.

  9. Question 9

    Q9. What is the purpose of a network protocol?

    • A) To improve network speed
    • B) To reduce network latency
    • C) To enable communication between devices
    • D) To increase network range

    Answer: To enable communication between devices

    Explanation: A network protocol is a set of rules and standards that enables communication between devices, ensuring data is transmitted and received correctly.

  10. Question 10

    Q10. What is the purpose of a hash function in a hash table?

    • A) To encrypt data
    • B) To compress data
    • C) To map keys to indices
    • D) To sort data

    Answer: To map keys to indices

    Explanation: A hash function maps keys to indices of a backing array, allowing for fast lookups, insertions, and deletions in a hash table.

  11. Question 11

    Q11. Which type of software testing involves testing individual units of code?

    • A) Integration testing
    • B) System testing
    • C) Unit testing
    • D) Acceptance testing

    Answer: Unit testing

    Explanation: Unit testing involves testing individual units of code, such as functions or methods, to ensure they work as expected in isolation.

  12. Question 12

    Q12. Which data structure is suitable for implementing a priority queue?

    • A) Stack
    • B) Queue
    • C) Heap
    • D) Tree

    Answer: Heap

    Explanation: A heap is a suitable data structure for implementing a priority queue, as it allows for efficient insertion and removal of elements based on priority.

  13. Question 13

    Q13. What is the purpose of version control systems?

    • A) To manage different versions of code
    • B) To improve code quality
    • C) To automate testing
    • D) To manage project documentation

    Answer: To manage different versions of code

    Explanation: Version control systems, such as Git, manage different versions of code, allowing developers to track changes and collaborate on projects.

  14. Question 14

    Q14. What is the main advantage of using a linked list over an array?

    • A) Faster access time
    • B) Dynamic memory allocation
    • C) Less memory usage
    • D) Simplified data structure

    Answer: Dynamic memory allocation

    Explanation: Linked lists allow for efficient insertion and deletion of nodes without shifting elements, making them suitable for dynamic data.

  15. Question 15

    Q15. What is the concept of 'Big Data'?

    • A) A large dataset that is difficult to process
    • B) A new type of database
    • C) A data analysis technique
    • D) A data storage device

    Answer: A large dataset that is difficult to process

    Explanation: Big Data refers to large, complex datasets that require specialized tools and techniques to process and analyze.

  16. Question 16

    Q16. What is the role of a 'cookie' in web development?

    • A) To store user data on the server
    • B) To store user data on the client-side
    • C) To improve website security
    • D) To optimize website performance

    Answer: To store user data on the client-side

    Explanation: Cookies store user data, such as preferences and session information, on the client-side, allowing for personalized experiences.

  17. Question 17

    Q17. What is the 'starvation' problem in operating systems?

    • A) When a process is unable to access resources
    • B) When a process is given too many resources
    • C) When a process is terminated
    • D) When a process is created

    Answer: When a process is unable to access resources

    Explanation: Starvation occurs when a process is perpetually denied access to necessary resources, often due to other processes holding onto them for extended periods.

  18. Question 18

    Q18. What is the 'paging' technique in memory management?

    • A) Dividing memory into fixed-size blocks
    • B) Dividing memory into variable-size blocks
    • C) Using a single block of memory
    • D) Using a cache memory

    Answer: Dividing memory into fixed-size blocks

    Explanation: Paging divides memory into fixed-size blocks called pages, allowing for efficient use of memory and reducing fragmentation.

  19. Question 19

    Q19. What is the 'Round-Robin' scheduling algorithm?

    • A) A priority-based scheduling algorithm
    • B) A time-slicing scheduling algorithm
    • C) A First-Come-First-Served scheduling algorithm
    • D) A Shortest Job First scheduling algorithm

    Answer: A time-slicing scheduling algorithm

    Explanation: Round-Robin scheduling allocates a fixed time slice (or quantum) to each process, switching between them to achieve fairness and responsiveness.

  20. Question 20

    Q20. What is 'cloud computing'?

    • A) A type of database
    • B) A type of network
    • C) A model for on-demand access to computing resources
    • D) A type of security measure

    Answer: A model for on-demand access to computing resources

    Explanation: Cloud computing provides on-demand access to a shared pool of computing resources, such as servers, storage, and applications, over the internet.