0% found this document useful (0 votes)
3 views31 pages

Important Mcqs Cs

The document contains multiple-choice questions (MCQs) covering topics such as exception handling, file handling, stacks, queues, and sorting in Python. It includes questions about specific exceptions, file operations, data structure principles, and sorting algorithms. Each section tests knowledge on key concepts and functionalities related to Python programming.
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
3 views31 pages

Important Mcqs Cs

The document contains multiple-choice questions (MCQs) covering topics such as exception handling, file handling, stacks, queues, and sorting in Python. It includes questions about specific exceptions, file operations, data structure principles, and sorting algorithms. Each section tests knowledge on key concepts and functionalities related to Python programming.
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd

1

EXCEPTION HANDLING IN PYTHON

Multiple Choice Questions (MCQs)

1. What is an exception in Python?

A runtime error represented as an object

2. Which of the following is also known as a parsing error?

(b) Syntax Error

3. When does a ZeroDivisionError occur?

(c) When the denominator is zero

4. Which exception is raised when an index is out of range for a sequence?

(b) IndexError

5. What does the raise statement do?

(c) Forcefully triggers an exception

6. Assertion (A): The finally block in exception handling always executes.

Reason (R): The finally block is designed for cleanup activities that must occur
regardless of error states.

(a) Both A and R are true and R is the correct explanation of A.

7. Which block contains code that is executed only if no exception is raised in the try
block?

(b) else

8. What is displayed when a syntax error is encountered in shell mode?

(b) The error name and a suggestion

9. Which of the following is a built-in exception?

(a) FileNotFoundError

10. What happens if an exception is raised and no matching except block is found?

(d) The program terminates


2

11. The assert statement raises an exception when its expression evaluates to:

(b) False

12. Which clause can be used to catch any exception not caught by previous except
blocks?

(a) A generic except: with no specified exception

13. Assertion (A): Every syntax error is an exception.

Reason (R): SyntaxError is a built-in exception class in Python.

(a) Both A and R are true and R is the correct explanation of A.

14. Which exception is raised by int('abc')?

(b) ValueError

15. Where should the finally block be placed?

(c) After all except and else blocks

16. What does the runtime system do when an exception is raised?

(b) Searches for an exception handler in the call stack

20. The process of creating an exception object and handing it to the runtime system is
called:

Throwing exception

21. Which statement is used to test an expression and raise an AssertionError if it fails?

(c) assert

22. What is the primary purpose of exception handling?

(b) To prevent the program from crashing abruptly

23. An IndentationError is a subclass of:

(c) SyntaxError

24. In a try...except structure, control transfers to the except block when:


3

(b) An exception occurs in the try block

29. The code that is designed to execute when a specific exception is raised is called:

(a) Exception Handler

30. If an unhandled exception occurs and a finally block exists, what happens?

(b) The finally block executes, then the exception is re-raised.

32. Which exception is raised for incorrect indentation?

IndentationError

37. When a syntax error is found in a script file, how is it often indicated?

(b) A dialog box with error details appears

38. What does the call stack represent during exception handling?

(b) The hierarchy of function/method calls

43. Which keyword is used to define a block of code to test for errors?

(c) try

46. Which of these is a user action that can raise a KeyboardInterrupt?

(c) Pressing Ctrl+C during execution

47. The optional argument in a raise statement is typically a:

(c) String (message)

50. The process of executing an exception handler is known as:

(c) Catching an exception


4

FILE HANDLING IN PYTHON

Multiple Choice Questiuons MCQs

1. Which of the following is an example of a text file extension?

(a) .jpg (b) .mp3 (c) .exe (d) .csv

2. The special character that marks the end of a line in a text file is called:

(a) EOF (b) EOL (c) EOD (d) EOT

[Link] will likely happen if you open a binary file (like an image) using a text editor like
Notepad?

(c) It will show garbage/unreadable values

4. The function used to open a file in Python is: (a) create() (b) access() (c) open() (d)
handle()

5. What does the open() function return?

(b) A file object (file handle)

6. The default mode for opening a file using open() is:

(c) Read text mode (r or rt)

7. Which file mode opens a file for both reading and writing, and places the file object at
the beginning?

(a) a+ (b) r (c) w+ (d) r+

8. Which file mode opens a file for writing only, and overwrites the file if it already
exists?

(a) r (b) a (c) w (d) x

9. If you open an existing file in append mode (a), where is the file object initially
positioned?

(a) Beginning of the file (b) Middle of the file (c) End of the file (d) At the last modified
byte

10. The file_object.close() method is important because it:


5

(c) Frees system resources and ensures data is saved (d) Changes the file mode

11. What is the primary advantage of using the with clause to open a file?

(b) It automatically closes the file when the block is exited

12. If you open a new file in write mode (w) and write data, then open the same file again
in write mode (w) and write new data, what happens to the first data?

(c) It is overwritten/lost

13. The write() method returns: (c) The number of characters written (d) None

14. Before writing numeric data to a text file using write(), it must be:

(b) Converted to a string using str()

15. Which method is used to write multiple strings from an iterable (like a list) to a file?

(a) write() (b) writemany() (c) writelines() (d) dump()

16. What does writelines() return after execution?

(d) None (does not return a value)

17. The read(10) method will read:

(a) 10 lines (b) 10 words (c) 10 bytes/characters (d) The entire file if it's 10 bytes or less

18. If you call read() without any arguments, it will: (a) Read one line (b) Read one
character (c) Read the entire file content (d) Cause an error

19. The readline() method reads until

(c) A newline (\n) character is encountered

20. To read all lines of a file into a list where each element is a line (including newline),
you use:

(d) readlines()

21. The tell() method is used to:

b) Get the current byte position of the file object

22. The seek(15, 0) method will place the file object:


6

(d) 15 bytes from the beginning of the file

23. In seek(offset, reference_point), what does reference_point = 2 indicate?

(a) Beginning of file (0) (b) Current position(1) (c) End of file (2)

24. The process of converting a Python object into a byte stream for storage is called:

(b) Pickling or Serialization

25. Which module is required for pickling and unpickling in Python?

(c) pickle

26. To write (dump) a Python object to a binary file, you open the file in mode:

(a) wb (write binary)

27. To read (load) a Python object from a binary file, you use:

(c) [Link]()

28. When reading multiple objects from a binary file using [Link](), how is the end
of file typically handled?

(c) Using try...except EOFError block

29. Which attribute of a file object tells you if the file is closed?

(c) [Link]

30. If a file is opened in 'r' mode and the file does not exist, what happens?

(b) An error is raised (FileNotFoundError)

31. What is the purpose of the flush() method mentioned in the context of writing files?

(b) To clear the internal buffer and write data to the file immediately

32. In a text file, contents are commonly separated by all of the following EXCEPT:

(a) Whitespace (b) Comma (,) (c) Tab (\t) (d) Semicolon (;)

33. Which of the following is NOT a valid file access mode?

(a) x+ (b) r+ (c) ab+ (d) wb+


7

34. Which method is used to find the size of the binary file in bytes in Program 2-8?

(c) [Link]() after writing all data

35. The inverse of pickling is called: unpickling or De-serialization

STACK

1. A stack is a ________ data structure.

(c) Linear

2. In a stack, insertion and deletion takes place at ________.

(d) Same end

3. The principle followed by a stack is ________.

(b) LIFO

4. The end of the stack from where elements are added or removed is called ________.

(c) TOP

5. Which operation adds an element to the stack?

(b) PUSH

6. Which operation removes an element from the stack?

(c) POP

7. Trying to POP from an empty stack results in ________.

(b) Underflow

8. Trying to PUSH to a full stack results in ________.

(b) Overflow

9. In Python, a stack can be implemented using ________.

(c) List

10. Which list method is used to implement PUSH operation in a stack?


8

(c) append()

11. Which list method is used to implement POP operation in a stack?

(b) pop()

12. The notation in which operators are written between operands is called ________.
(c) Infix

13. The notation in which operators are written before operands is called ________.

(d) Prefix

14. The notation in which operators are written after operands is called ________.

(c) Postfix

15. Which notation does not require parentheses for evaluation?

(c) Both Prefix and Postfix

16. For conversion from infix to postfix, a stack is used to store ________.

(b) Operators

17. While evaluating a postfix expression, a stack is used to store ________.

(a) Operators

18. The 'Back' button in a browser uses ________ data structure.

(b) Stack

20. The 'Undo' operation in an editor uses ________ data structure.

(a) Stack

22. The function isEmpty() in stack implementation returns True if ________.

(c) Stack is empty

23. The function top() in stack implementation returns ________.

(c) The last inserted element


9

24. The function size() in stack implementation uses ________.

(b) len()

31. A stack is said to be in underflow condition when ________.

(b) It is empty and we try to POP

32. A stack is said to be in overflow condition when ________.

(a) It is full and we try to PUSH

33. In Python, the stack size ________.

(b) Is dynamic

34. The time complexity of PUSH and POP operations in a stack implemented using list
is ________.

(b) O(1)

37. In a stack, the element that is inserted first will be removed ________.

(b) Last

38. In a stack, the element that is inserted last will be removed ________.

(a) First

51. Assertion (A): Stack follows LIFO rule.

Reason (R): Insertion and deletion takes place at same end.

(a) A is true and R is correct reason

52. Assertion (A): Trying to POP from an empty stack causes underflow.

Reason (R): Underflow is a condition when stack is empty and we try to delete.

(a) A is true and R is correct reason

53. Assertion (A): In Python, list is used to implement stack.

Reason (R): List provides append() and pop() methods which work at the same end.

(a) A is true and R is correct reason


10

54. Assertion (A): Postfix notation does not require parentheses.

Reason (R): Operators are placed after operands in postfix notation.

(a) A is true and R is correct reason

55. Assertion (A): Stack is used for converting infix to postfix.

Reason (R): Stack stores operators during conversion based on precedence.

(a) A is true and R is correct reason

QUEUE

1. Which principle does a Queue data structure follow?

(b) First-In-First-Out (FIFO)

2. In a queue, where does the insertion of a new element take place?

(b) At the Rear

3. What is the other name for the 'Front' end of a queue?

(b) Head

4. Which operation in a queue is used to remove an element?

(d) DEQUEUE

5. Trying to delete an element from an empty queue results in:

(b) Underflow

6. The peek() operation in a queue:

(c) Views the front element without removing it

7. In Python, which list method is typically used to implement the enqueue operation?

(c) append(element)

8. In Python, which list method is typically used to implement the dequeue operation?

(b) pop(0)
11

9. Which data structure allows insertion and deletion from both ends?

(b) Queue

10. If insertion and deletion in a Deque are performed from the same end, it behaves like
a:

(b) Stack

11. If insertion and deletion in a Deque are performed from opposite ends, it behaves like
a:

(a) Queue

15. In a deque, the operation to add an element at the front is called:

(c) insertFront

17. The 'Rear' of a queue is also known as:

(c) Tail

18. What is the time complexity of the dequeue operation using pop(0) on a Python list of
size n?

(c) O(n)

20. In the algorithm to check for palindrome using a deque, characters are initially
inserted:

(b) At the rear

21. Assertion (A): A queue follows the First-In-First-Out (FIFO) principle.

Reason (R): In a queue, insertion happens at the rear and deletion happens at the front.

(a) Both A and R are true and R is the correct explanation of A.

22. Assertion (A): A Deque can be used to implement a Stack.

Reason (R): A Stack requires insertion and deletion at the same end.

(a) Both A and R are true and R is the correct explanation of A.

24. For the queue operations: enqueue(A), enqueue(B), dequeue(), enqueue(C), dequeue().
What is the sequence of elements removed?
12

(b) A, B

26. In Python, to read the last element of a list myDeque without removing it, you would
use:

d) [Link]()

29. Which method adds an element to the front of a deque in the provided Python
implementation?

(c) insert(0, element)

31. What will be the output of peek() after: enqueue(10), enqueue(20), dequeue()?

(b) 20

34. When implementing a queue with a Python list, why might we not need an isFull()
function?

(b) Because Python lists are dynamic and don't have a fixed size

35. For a deque containing elements [1, 2, 3] (Front=1, Rear=3), what does getRear()
return?

(c) 3

36. Which operation is common to both Queue and Deque?

(c) enqueue / insertRear

37. If you use only insertRear and deletionFront operations on a deque, it functions as a:

(b) Queue

39. In the palindrome checking algorithm using a deque, when do you stop and declare
the string as a palindrome?

(b) When the deque becomes empty or has one character left

41. Elements 'P', 'Q', 'R' are enqueued in that order. After one dequeue, what is at the
front?

(b) Q
13

44. Which Python function, when used on a list-based queue, corresponds to the
deletionRear() operation on a deque?

(c) pop()

46. The append() method in a list always adds the element at the:

(c) End

52. Assertion (A): The enqueue operation in a queue is always performed at the Rear end.

Reason (R): The Rear end of a queue is also called the Tail.

(a) Both A and R are true and R is the correct explanation of A.

53. Assertion (A): A Deque can function as both a Stack and a Queue.

Reason (R): A Deque allows insertion and deletion of elements at both its ends.

(a) Both A and R are true and R is the correct explanation of A.

SORTING

1. What is sorting?

(b) Arranging elements in a particular order

2. Which of the following is a real-world example of sorting?

(b) Arranging words in a dictionary alphabetically

3. In Bubble Sort, each full iteration through the list is called a ______.

(b) pass

4. For a list of n elements, how many passes does Bubble Sort make in the worst case?

(b) n-1
14

5. In Bubble Sort, after each pass, the largest element moves to the ______.

(c) end

6. What is the time complexity of Bubble Sort, Selection Sort and Insertion Sort?

(c) O(n²)

8. In Selection Sort, the left part contains ______ elements.

(b) sorted

9. How many passes does Selection Sort make for n elements?

(b) n-1

10. In Selection Sort, the smallest element is swapped with the ______ element of the
unsorted list.

(c) leftmost

16. An algorithm with no loops has a time complexity of ______.

(a) O(1)

17. An algorithm with a single loop has a time complexity of ______.

(a) O(n)

18. An algorithm with nested loops has a time complexity of ______.

(b) O(n2)

20. Which sorting technique selects the smallest element and swaps it?

(c) Selection Sort

21. Which sorting technique inserts an element into its correct position by shifting?

(c) Insertion Sort

24. In Bubble Sort, if no swapping occurs in a pass, it means ______.

(b) list is sorted


15

26. Which sorting method is efficient for nearly sorted lists?

27. In Selection Sort, after each pass, the size of the unsorted list ______.

(b) decreases

30. The number of swaps in Bubble Sort is ______ compared to Selection Sort.

(b) more

DATABASE CONCEPTS

Multiple Choice Questions (MCQs)

1. What is a file in the context of a computer system?

(b) A container to store data

4. What does data redundancy in a file system lead to?

(b) Excess Storage Use and Data Inconsistency

5. When the same data maintained in different files do not match, it is called?

(c) Data Inconsistency

6. The difficulty in writing new application programs to retrieve data from multiple
isolated files of different formats is due to?

(d) Data Isolation

7. If the structure of a data file is changed, all application programs accessing it need to
be changed. This is known as?

(b) Data Dependence

8. Which software is used to create and manage databases?

(b) Database Management System (DBMS)

9. MySQL, Oracle, and PostgreSQL are examples of?

(c) Database Management Systems

10. The design of a database, representing its structure, is called?


16

(b) Database Schema

11. Restrictions on the type of data that can be inserted into a table column are called?

(b) Data Constraints

12. Data about the data, such as schema and constraints stored by the DBMS, is called?

(b) Meta-data

13. The state or snapshot of the database with actual data at a particular time is called?

(b) Database Instance

14. A request to a database for information retrieval is called a?

(c) Query

15. Insertion, Deletion, and Update are types of?

(b) Data Manipulation Operations

16. The underlying component used by a DBMS to create a database and handle queries
is the?

(b) Database Engine

17. The most commonly used data model is?

(c) Relational Data Model

18. In the relational model, a table is referred to as a?

(c) Relation

19. What is each column in a relation called?

(c) Cardinality

22. The number of attributes in a relation is its?

(b) Degree
17

23. The number of tuples in a relation is its?

(b) Cardinality

24. Which property of a relation states that each attribute must have a unique name?

(b) Property related to Attributes

25. Which property of a relation states that the sequence of tuples is immaterial?

(a) Property related to Tuples

26. The value used to represent unknown or non-applicable data in an attribute is?

(c) NULL

27. An attribute (or set) that can uniquely identify tuples in a relation is a?

(b) Candidate Key

29. The candidate keys not chosen as the primary key are called?

(b) Alternate Keys

30. A primary key made up of more than one attribute is a?

(d) Composite Primary Key

31. An attribute in one relation whose value is derived from the primary key of another
relation is a?

(c) Foreign Key

32. The relation that contains the foreign key is called the?

(c) Foreign Relation

42. What is used to ensure accuracy and reliability of data in a database?

(c) Constraints

46. Which of the following best describes a Database Management System (DBMS)?

(b) A software to create and manage interrelated data

47. In the relational data model, a table is also known as a?


18

(c) Relation

50. Centralized storage in a DBMS can increase the risk of data loss from a single point
of failure. This is a limitation related to?

FILL IN THE BLANKS

1. A file is a container to store data in a computer.

2. The same data duplicated in different places is called data Redundancy

3. When the same data in different files do not match, it results in data data
inconsistency

4. The lack of links between related files in a file system leads to data isolation

5. If changing a file's structure requires changing all accessing programs, it exhibits data
dependency

6 DBMS is a software to create and manage databases.

7. The design of a database is called its Database Schema

8. Restrictions on the data to be inserted into a table are called Constraints

9. Data about the data stored in the database catalog is called Metadata

10. The snapshot of a database with actual data at any time is a database Instance

11. A request to a database for information is called a Query

12. Insertion, deletion, and update are DML operations.

13. The most commonly used data model is the Relational data model.

14. In column is identified by distinct header called Attribute/column

15. Single Entry in a table is a row/record/ tuple

DATA COMMUNICATION

1. What is data communication?(c) Exchange of data between networked devices

2. In data communication, the path through which the message travels is called:
19

(c) Communication media

3. The capacity of a communication channel is measured in terms of:

(a) Bandwidth and Data Transfer Rate

4. Bandwidth is measured in:

(b) Hertz

5. Which communication mode allows data to flow in one direction only?

(a) Simplex

6. Walkie-talkie is an example of:

(b) Half-duplex communication

7. In which communication mode can both devices send and receive data simultaneously?

(c) Full-duplex

8. Which switching technique establishes a dedicated path before communication?

(a) Circuit Switching

9. In packet switching, messages are broken into:

(b) Packets

10. Which transmission media uses light to carry signals?

(c) Fiber Optic Cable

11. UTP and STP are types of:

(c) Twisted Pair Cable

12. Which wireless transmission wave is omni-directional?

(a) Radio Waves

13. Bluetooth operates in which frequency band?

(b) 2.4 GHz

14. A personal area network formed by Bluetooth devices is called:


20

(c) Piconet

15. IEEE 802.11 refers to:

(b) Wi-Fi

16. Which generation of mobile networks introduced digital voice calls?

(b) 2G

17. VoLTE stands for:

(a) Voice over Long-Term Evolution

18. Which protocol is used to access the World Wide Web?

(b) HTTP

19. FTP is used for:

(b) Transferring files

20. PPP is used to establish:

(b) Direct dedicated connection

21. SMTP is associated with:

(b) Email services

22. TCP/IP is responsible for:

(a) Assigning IP addresses (b) Breaking messages into packets

(c) Ensuring packet delivery (d) All of the above

23. The range of frequencies available for transmission is called:

(b) Bandwidth

24. Which device is used to create a wireless LAN?

(c) Access Point

25. Which mobile generation supports interactive multimedia and high-speed Internet?

(c) 4G
21

26. In a network, sender and receiver are known as:

(b) Nodes

27. Which protocol ensures flow control between sender and receiver?

(c) TCP

28. Which wireless technology is used for short-distance device connectivity like mouse
and keyboard?

(b) Bluetooth

29. Coaxial cable carries signals in the form of:

(b) Electric signals

28. Which switching technique does not require a dedicated path?

(b) Packet Switching

29. The protocol used for email delivery is:

(c) SMTP

30. Which electromagnetic wave is used for remote controls?

(c) Infrared Waves

31. WiMax is typically used for:

(c) Metropolitan Area Network

32. Which protocol is responsible for breaking messages into IP packets?

(b) TCP

33. The outer conductor in coaxial cable is usually made of: (a) Copper mesh

34. Which protocol defines how two devices authenticate each other for a direct link?

(c) PPP

35. Which component of data communication is also called the transmission media?

(d) Channel
22

COMPUTER NETWORK

3. A computer network is an interconnection among:

(a) Two or more computers

4. Which term refers to any device that can receive, create, store, or send data in a
network?

(b) Node

5. For transmission, data in a network is divided into smaller chunks called:

(c) Packets

6. The research project commissioned by the U.S. Department of Defence that led to the
development of the Internet was:

(c) ARPANET (ADVANCED RESEARCH PROJECT AGENCY NETWORK )

7. Who developed network messaging or Email and introduced the use of the '@' symbol?

(c) Roy Tomlinson

8. The standard protocol introduced on ARPANET in 1982 was:

(c) TCP/IP

9. The birth of the World Wide Web (WWW) is attributed to the development of HTML
and URL by:

(b) Tim Berners-Lee

10. A network that connects personal devices within an approximate range of 10 metres
is called a:

(d) PAN

11. Which type of network can be formed by connecting two smartphones via Bluetooth?

(b) Wireless PAN (WPAN)

12. A network covering a single room, office floor, or university campus is typically a:
23

(b) LAN

13. Which set of rules decides how computers connect via cables in a LAN?

(c) Ethernet

15. An extended form of LAN that covers a city or town is a:

(c) MAN

16. Which of the following is an example of a Metropolitan Area Network (MAN)?

(b) Cable TV network

17. The largest Wide Area Network (WAN) that connects billions of devices globally is
the:

(c) Internet

18. A device used for conversion between analog signals and digital bits is called a:

(b) Modem

19. Which device acts as an interface between a computer and a wired network and has a
unique MAC address?

(b) Ethernet Card (NIC)

20. The unique hardware address associated with a Network Interface Card is the:

(c) MAC Address

21. An eight-pin connector used exclusively with Ethernet cables is:

(d) RJ45

22. Which analog device regenerates weakened signals on a cable to extend transmission
distance?

(c) Repeater

23. A network device that broadcasts data received on any port to all other ports is a:

(c) Hub
24

25. Which device extracts the destination address from a data packet and forwards it
selectively to the intended device?

(c) Switch

26. A device that connects a local area network to the internet and can analyze/repackage
data is a:

(c) Router

27. The entry and exit point of a network, through which all data must pass, is the:

(c) Gateway

28. For simple home internet connectivity, the gateway is usually the:

(c) Internet Service Provider (ISP)

29. The arrangement of computers and peripherals in a network is called its:

(b) Topology

30. In which topology is each device connected to every other device?

(d) Mesh

31. Which topology is known for being highly reliable because the failure of one node
does not break communication between others?

(d) Mesh

32. In a Ring topology, data transmission is:

(c) Unidirectional

33. Which topology uses a single backbone cable shared by all nodes?

(c) Bus

35. In Star topology, each device is connected to a:

(c) Central node (Hub/Switch)

37. A hierarchical topology with multiple branches, each containing basic topologies, is
called:
25

(b) Tree/Hybrid Topology

38. Which address is permanently engraved on a NIC during manufacturing?

(c) MAC Address

39. The first six hexadecimal digits of a MAC address represent the:

(c) Manufacturer's ID (OUI)

40. Which address can change if a node is moved from one network to another?

(d) IP Address

44. The collection of interlinked web pages and resources accessible over the Internet is
the:

(c) World Wide Web (WWW)

46. The more secure version of the protocol used to retrieve web pages is:

(c) HTTPS

47. The process of converting a domain name to its corresponding IP address is called:

(c) Domain Name Resolution

48. The server that performs domain name resolution is the:

(c) DNS Server

49. How many root DNS servers are there at the top level of the hierarchy?

(c) 13

50. The organization that maintains the list of DNS root servers is:

(c) IANA
26

SECURITY ASPECTS

1. What does malware stand for?

(b) Malicious software

2. Which malware type replicates without needing a host program?

(b) Worm

3. What is the primary intent of ransomware?

(c) Block access to data and demand ransom

4. How does a Trojan typically spread?

(c) User interaction (e.g., email attachments)

5. Which malware spies on user activity without consent?

(b) Spyware

6. What is a common revenue model for adware?

(b) Pay per click

7. What is a key feature of an online virtual keyboard that enhances security?

9. Which antivirus method executes a file in a virtual environment to observe behavior?

(b) Sandbox detection

11. What is the primary function of a firewall?

(b) Protect against unauthorized network access

12. What type of cookie is deleted after a session ends?

(b) Session cookie

13. Who is an ethical hacker?

(b) White hat

14. What is a DDoS attack?

(b) Attack from multiple distributed sources


27

15. Which intrusion method floods the network to overwhelm detection systems?

(c) Traffic Flooding

16. What is the real-time interception of private communication called?

(b) Eavesdropping

20. Which malware is named after a deceptive gift from Greek history?

(c) Trojan

21. What type of hacker hacks for fun or challenge without malicious intent?

(c) Grey hat

22. Which malware can be both software and hardware?

(b) Keylogger

23. What is a common sign of malware infection?

(c) Frequent pop-up windows

24. Which protocol is secure for online transactions?

(c) HTTPS

25. What does a firewall monitor?

(c) Both incoming and outgoing traffic

26. Which cookie type recreates itself after deletion?

(c) Zombie cookie

27. What is a hacktivist?

(b) Hacker for political/social change

28. What is the main goal of a DoS attack?

(b) Overload a resource to deny service

29. Which attack overwrites memory with malicious code?

30. What is another term for snooping?


28

(b) Sniffing

31. Which malware displays unwanted advertisements?

(b) Adware

32. What is the key difference between a virus and a worm?

(a) Virus needs a host, worm does not

33. Which antivirus method uses a database of known malware signatures?

(c) Signature-based

34. What should you look for in a URL when entering sensitive information?

(b) https://

35. What is a host-based firewall?

(b) Firewall on an individual computer

36. Which hacker type is employed to find and fix security flaws?

(c) White hat

37. What is a Botnet used for?

(a) Sending spam (b) DDoS attacks

(c) Both a and b

38. Which network threat involves capturing traffic for later analysis?

(b) Snooping

39. What is a preventive measure against malware?

(c) Regular software updates

40. Which malware demands payment to restore data access?

(c) Ransomware

41. What is the purpose of a sandbox in antivirus software?

(b) To execute files in isolation


29

43. What type of cookie helps in auto-filling online forms?

(b) Persistent cookie

44. Who is a cracker?

(b) Malicious hacker (Black hat)

45. What is the main challenge in mitigating a DDoS attack?

(b) Distributed sources

46. Which intrusion method uses multiple paths to avoid detection?

(b) Asymmetric Routing

49. Which malware type is often bundled with legitimate software?

(c) Trojan

50. What is the full form of VDF in antivirus context?

(b) Virus Definition File

SQL

1. The describe command is used to:

View the structure of a table

2. Which data type is used to store a fixed-length character string of 10 characters.

Char(10)

3. Which constraints ensures that a column cannot have missing value?

NOT NULL

4. The ALTER command can be used to

Change the data type of an exi

5. Which statement permanently removes a table and all its data from the database?

DROP TABLE

6. If the WHERE clause is not present in update statement, what happens?


30

All records in the table are updated.

7. Which DML command is used to add new rows of data to a table.

INSERT INTO

8. When inserting data, text and date values should be enclosed in:

Single quotes(‘ ‘ )

9. The purpose of SELECT statement in SQL is to :

Retrieve data from a table

10. Which clause is used to filter rows based on a specified condition?

WHERE

11. The IN operator is used to :

Check if a value matches any value in a list

12. Which operator is used to check for NULL values in a column?

IS NULL

13. The LIKE operator uses % to represent:

Zero or more characters

14. The pattern ‘_a%’ in a LIKE clause matches strings where:

The second character is ‘a’

15. Which single row function rounds a number of nearest integer?

ROUND(N)

16. Which function returns the current system date and time?

NOW( )

17. The GROUP BY clause is used to :

Group rows that have the same values in specified column


31

18. Which relational algebra operation returns all possible combinations of rows from
two tables?

Cartesian product

19. The DELETE statement without a WHERE clause will:

Delete all rows from the table.

20. The MINUS operation(set difference) A-B returns:

Rows present in A not in B

FILL IN THE BLANKS:

[ primary key, Unique, date, ; , SQL, foreign key]

1. ______ is the most popular query language used by major relational DBMS.

2. In SQL , statements must always ends with a ______

3. The ___data type is used to store date values ‘YYYY-MM-DD’ format.

4. The _____constraint ensures that all values in a column are different

5. A column which can uniquely identify each row in a table is called a _______.

[create databases, insert , drop , alter, show databases

1. The ______ statement is used to create a new database in SQL.

2. To view the list of all databases, we use the statement __

3. The _____statement is used to change the structure of an existing table.

4. To remove a table permanently from the database, we use the _____statement.

5. The _____statement is part of DML and is used to add new records to a table.

You might also like