0% found this document useful (0 votes)
716 views16 pages

Chat GPT Questions

Uploaded by

zainabameen.2424
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
716 views16 pages

Chat GPT Questions

Uploaded by

zainabameen.2424
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 16

Programming Fundamentals (06%)

1. What is the purpose of a compiler in programming?


 a) To translate source code into machine code
 b) To execute program instructions
 c) To debug software applications
 d) To manage system resources
2. Which programming paradigm emphasizes the use of functions and procedures?
 a) Object-oriented programming
 b) Procedural programming
 c) Functional programming
 d) Event-driven programming
3. What does the "++" operator do in programming languages like C and C++?
 a) Adds 1 to the variable
 b) Subtracts 1 from the variable
 c) Multiplies the variable by 2
 d) Divides the variable by 2
4. In programming, what does the term "variable scope" refer to?
 a) The size of the variable in memory
 b) The range within which a variable can be accessed
 c) The data type of the variable
 d) The number of times a variable is used in the program
5. Which control structure is used to execute a block of code repeatedly as long as a condition is true?
 a) if-else
 b) switch
 c) for loop
 d) break statement

Object-Oriented Paradigm (05%)

6. What is polymorphism in object-oriented programming?


 a) The ability to define multiple methods with the same name but different parameters
 b) The ability to inherit properties and behavior from a parent class
 c) The ability to hide implementation details within a class
 d) The ability to create new objects from an existing class
7. Which OOP concept allows a class to inherit properties and behavior from another class?
 a) Encapsulation
 b) Inheritance
 c) Polymorphism
 d) Abstraction
8. What is the purpose of an interface in Java?
 a) To provide a blueprint for implementing classes
 b) To encapsulate data within a class
 c) To define constructors for classes
 d) To execute program instructions
9. What is encapsulation in object-oriented programming?
 a) Binding data and functions into a single unit
 b) Hiding implementation details within a class
 c) Inheriting properties and behavior from a parent class
 d) Accessing data and functions from outside the class
10. Which keyword is used to prevent a method from being overridden in a subclass in Java?
 a) override
 b) final
 c) static
 d) abstract

Data Structures and Algorithms (09%)

11. Which data structure is typically used to implement a Last-In-First-Out (LIFO) behavior?
 a) Queue
 b) Stack
 c) Tree
 d) Linked List
12. What is the time complexity of inserting an element at the beginning of an array?
 a) O(1)
 b) O(log n)
 c) O(n)
 d) O(n^2)
13. Which sorting algorithm has the best time complexity in the average case?
 a) Bubble Sort
 b) Selection Sort
 c) Merge Sort
 d) Quick Sort
14. What is the purpose of a hash function in data structures?
 a) To sort elements in ascending order
 b) To convert data into a fixed-size string of characters
 c) To map data to a fixed-size array index
 d) To delete elements from a data structure

Digital Logic and Computer Organization (06%)

16. Which logic gate produces a low output only when all inputs are low?
 a) AND gate
 b) OR gate
 c) NOR gate
 d) NAND gate
17. What is the binary representation of the decimal number 13?
 a) 1101
 b) 1001
 c) 1111
 d) 1011
18. Which of the following is a non-volatile memory type?
 a) RAM
 b) Cache memory
 c) ROM
 d) Register
19. What does the ALU stand for in computer architecture?
 a) Arithmetic and Logic Unit
 b) Access and Loading Unit
 c) Assembly and Loading Unit
 d) Algorithmic and Logical Unit
20. Which component is responsible for storing frequently accessed data for quick retrieval in a
computer system?
 a) Cache memory
 b) RAM
 c) Hard disk
 d) Optical drive

Operating Systems (06%)

21. What is the primary function of an operating system?


 a) To manage hardware resources
 b) To compile source code
 c) To design user interfaces
 d) To create databases
22. Which scheduling algorithm gives priority to the process with the highest priority level?
 a) First-Come, First-Served (FCFS)
 b) Shortest Job Next (SJN)
 c) Priority Scheduling
 d) Round Robin
23. What is the purpose of virtual memory in an operating system?
 a) To store temporary files
 b) To provide additional storage space
 c) To extend the available RAM
 d) To improve CPU performance
24. Which mechanism is used to prevent multiple processes from accessing shared resources
simultaneously?
 a) Mutual exclusion
 b) Deadlock avoidance
 c) Livelock detection
 d) Semaphore
25. What is a device driver in an operating system?
 a) A program that translates high-level instructions into machine code
 b) A program that controls hardware devices
 c) A program that manages memory allocation
 d) A program that monitors system performance

Database Systems (07%)

26. Which type of database model organizes data into tables with rows and columns?
 a) Hierarchical
 b) Network
 c) Relational
 d) Object-Oriented
27. What is the purpose of a primary key in a database table?
 a) To uniquely identify each row in the table
 b) To define constraints on the data types allowed in the table
 c) To establish relationships with other tables
 d) To sort the rows in ascending order
28. Which database operation is used to retrieve specific data from a table based on a given condition?
 a) INSERT
 b) UPDATE
 c) DELETE
 d) SELECT
29. What is the purpose of normalization in database design?
 a) To increase redundancy
 b) To reduce data integrity
 c) To eliminate duplicate data
 d) To simplify queries
30. Which type of join returns only the rows that have matching values in both tables being joined?
 a) Inner join
 b) Outer join
 c) Left join
 d) Right join

Software Engineering & Development (05%)

31. What is the purpose of version control systems in software development?


 a) To document code changes
 b) To track and manage changes to source code
 c) To compile and execute code
 d) To test software applications
32. Which software development model is known for its iterative and incremental approach?
 a) Waterfall model
 b) Spiral model
 c) Agile model
 d) V-model
33. What is the purpose of unit testing in software development?
 a) To test the entire system as a whole
 b) To test individual components or units of code
 c) To validate user requirements
 d) To optimize code performance
34. Which software development process involves breaking down requirements into smaller,
manageable tasks?
 a) Requirement analysis
 b) Design
 c) Implementation
 d) Task decomposition
35. What is the purpose of a software requirement specification (SRS) document?
 a) To design the user interface
 b) To define the functional and non-functional requirements of the software
 c) To develop test cases
 d) To document code changes

Computer Communication and Networks (06%)

36. Which layer of the OSI model is responsible for logical addressing and routing?
 a) Physical layer
 b) Data link layer
 c) Network layer
 d) Transport layer
37. What is the purpose of the TCP protocol in computer networks?
 a) To establish a connection between devices
 b) To guarantee the delivery of packets
 c) To resolve domain names to IP addresses
 d) To transmit data over the network
38. Which network topology connects all devices in a linear sequence?
 a) Bus
 b) Ring
 c) Star
 d) Mesh
39. What is the purpose of DNS in computer networks?
 a) To translate domain names to IP addresses
 b) To secure data transmission
 c) To establish a direct connection between devices
 d) To filter network traffic
40. Which protocol is used to send email messages over the internet?
 a) HTTP
 b) FTP
 c) SMTP
 d) TCP

Computer Architecture & Assembly Language (08%)


41. What is the purpose of the program counter (PC) in a CPU?
 a) To store intermediate results
 b) To fetch the next instruction to be executed
 c) To perform arithmetic operations
 d) To store data temporarily
42. Which instruction moves data from memory to a register in assembly language?
 a) MOV
 b) ADD
 c) JMP
 d) CALL
43. What is the purpose of the ALU in a CPU?
 a) To store data temporarily
 b) To perform arithmetic and logic operations
 c) To manage input/output devices
 d) To execute program instructions
44. Which addressing mode is used to access memory locations directly using a fixed address?
 a) Immediate
 b) Direct
 c) Indirect
 d) Indexed
45. What is the purpose of the stack pointer (SP) register in a CPU?
 a) To store the address of the next instruction to be executed
 b) To store the address of the top of the stack
 c) To store intermediate results during arithmetic operations
 d) To store data temporarily

Theory of Automata and Formal Languages (10%)

46. Which of the following is not a valid component of a finite automaton?


 a) Alphabet
 b) States
 c) Transitions
 d) Variables
47. What is the purpose of regular expressions in formal language theory?
 a) To define context-free languages
 b) To describe patterns of strings
 c) To generate Turing machines
 d) To prove theorems about automata
48. Which type of automaton can recognize context-free languages?
 a) Finite automaton
 b) Pushdown automaton
 c) Turing machine
 d) Deterministic automaton
49. What is the difference between a deterministic finite automaton (DFA) and a nondeterministic finite
automaton (NFA)?
 a) DFA has fewer states than NFA
 b) DFA can recognize more languages than NFA
 c) DFA has deterministic transitions, while NFA has nondeterministic transitions
 d) DFA can recognize context-free languages, while NFA cannot
50. Which operation is used to concatenate two regular languages?
 a) Union
 b) Intersection
 c) Concatenation
 d) Kleene star

Analysis of Algorithms (10%)

51. What is the time complexity of linear search in an unsorted array?


 a) O(1)
 b) O(log n)
 c) O(n)
 d) O(n^2)
52. Which of the following is not a valid complexity class?
 a) P
 b) NP
 c) NP-hard
 d) PSPACE
53. What is the time complexity of the bubble sort algorithm in the worst-case scenario?
 a) O(1)
 b) O(log n)
 c) O(n)
 d) O(n^2)
54. Which algorithm is used to find the shortest path in an unweighted graph?
 a) Dijkstra's algorithm
 b) Bellman-Ford algorithm
 c) Floyd-Warshall algorithm
 d) Breadth-First Search (BFS)
55. What is the purpose of big O notation in the analysis of algorithms?
 a) To represent the best-case time complexity of an algorithm
 b) To represent the average-case time complexity of an algorithm
 c) To represent the worst-case time complexity of an algorithm
 d) To represent the space complexity of an algorithm

Artificial Intelligence (07%)

56. What is the time complexity of linear search in a sorted array?


 a) O(1)
 b) O(log n)
 c) O(n)
 d) O(n^2)
57. Which complexity class represents the set of decision problems solvable by a deterministic Turing
machine using polynomial time?
 a) P
 b) NP
 c) NP-hard
 d) PSPACE
58. What is the time complexity of the selection sort algorithm in the worst-case scenario?
 a) O(1)
 b) O(log n)
 c) O(n)
 d) O(n^2)
59. Which algorithm is used to find the minimum spanning tree in a graph?
 a) Dijkstra's algorithm
 b) Bellman-Ford algorithm
 c) Prim's algorithm
 d) Depth-First Search (DFS)
60. What is the purpose of big O notation in the analysis of algorithms?
 a) To represent the best-case time complexity of an algorithm
 b) To represent the average-case time complexity of an algorithm
 c) To represent the worst-case time complexity of an algorithm
 d) To represent the space complexity of an algorithm

System Programming (05%)

61. What is the purpose of an assembler in system programming?


 a) To translate assembly language code into machine code
 b) To manage system resources
 c) To provide input/output capabilities
 d) To debug software applications
62. Which of the following is not a valid system call in operating systems?
 a) fork()
 b) exec()
 c) read()
 d) print()
63. What is the purpose of a linker in system programming?
 a) To translate source code into machine code
 b) To combine object files into a single executable file
 c) To manage memory allocation
 d) To optimize code performance
64. Which system programming language is known for its low-level access to hardware resources?
 a) Python
 b) Java
 c) C
 d) Ruby
65. What is the purpose of a library in system programming?
 a) To provide reusable code modules
 b) To manage system processes
 c) To control input/output devices
 d) To execute system commands

Numerical Computing (05%)

66. Which of the following is not a valid numerical computing library in Python?
 a) NumPy
 b) SciPy
 c) Pandas
 d) Matplotlib
67. What is the purpose of linear interpolation in numerical computing?
 a) To approximate values between known data points
 b) To solve systems of linear equations
 c) To calculate the derivative of a function
 d) To perform matrix multiplication
68. Which numerical method is used to find the roots of a nonlinear equation?
 a) Newton-Raphson method
 b) Euler's method
 c) Gaussian elimination
 d) Simpson's rule
69. What is the purpose of numerical integration in numerical computing?
 a) To approximate the area under a curve
 b) To solve differential equations
 c) To optimize functions
 d) To interpolate data points
70. Which numerical technique is used to approximate the solution to a differential equation?
 a) Finite difference method
 b) Gradient descent
 c) Singular value decomposition
 d) LU decomposition

Programming Fundamentals (06%)

71. What is the output of the following code snippet in Python?


pythonCopy code
x = 5 y = 2 print (x ** y)
 a) 10
 b) 7
 c) 25
 d) 32
72. Which of the following is not a valid data type in Python?
 a) int
 b) float
 c) char
 d) str
73. What will be the value of result after the following code execution in Python?
pythonCopy code
x = 10 y = 5 result = x / y
 a) 2
 b) 2.0
 c) "2"
 d) Error

Object Oriented Paradigm (05%)

74. What is the output of the following Python code?


pythonCopy code
class MyClass : def __init__ ( self, value ): self.value = value def display ( self ): print (self.value) obj =
MyClass( 10 ) obj.display()
 a) 10
 b) MyClass object at memory location
 c) Error
 d) None
75. In Python, what does the self keyword represent in a class method?
 a) It refers to the current class object
 b) It refers to the parent class object
 c) It refers to the derived class object
 d) It refers to the calling object

Discrete Structures (05%)

76. Which of the following is an example of a valid propositional logic statement?


 a) p ∧ q ∨ ~r
 b) p ∨ q ∧ ~r
 c) p ↔ q ⊕ r
 d) p ⊕ q → r
77. What is the negation of the statement "All humans are immortal"?
 a) All humans are mortal
 b) No humans are immortal
 c) Some humans are immortal
 d) No humans are mortal

Digital Logic and Computer Organization (06%)

78. Which logic gate produces a high output only when all inputs are high?
 a) AND gate
 b) OR gate
 c) NOR gate
 d) NAND gate
79. What is the binary representation of the decimal number 10?
 a) 1010
 b) 1100
 c) 1110
 d) 1001

Operating Systems (06%)

80. What is the purpose of an operating system?


 a) To manage hardware resources
 b) To compile source code
 c) To design user interfaces
 d) To create databases
81. Which scheduling algorithm gives priority to the process with the shortest expected run time?
 a) First-Come, First-Served (FCFS)
 b) Shortest Job Next (SJN)
 c) Priority Scheduling
 d) Round Robin

Database Systems (07%)

82. What is the purpose of a foreign key in a database table?


 a) To uniquely identify each row in the table
 b) To define constraints on the data types allowed in the table
 c) To establish relationships with other tables
 d) To sort the rows in ascending order
83. Which SQL keyword is used to retrieve data from a database table?
 a) INSERT
 b) UPDATE
 c) DELETE
 d) SELECT

Software Engineering & Development (05%)

84. What is the purpose of version control systems in software development?


 a) To document code changes
 b) To track and manage changes to source code
 c) To compile and execute code
 d) To test software applications
85. Which software development model is known for its iterative and incremental approach?
 a) Waterfall model
 b) Spiral model
 c) Agile model
 d) V-model
Computer Communication and Networks (06%)

86. What is the purpose of the TCP protocol in computer networks?


 a) To establish a connection between devices
 b) To guarantee the delivery of packets
 c) To resolve domain names to IP addresses
 d) To transmit data over the network
87. Which network topology connects all devices in a circular sequence?
 a) Bus
 b) Ring
 c) Star
 d) Mesh

Programming Fundamentals (06%)

1. What is the purpose of a compiler in programming?


 Answer: a) To translate source code into machine code
2. Which programming paradigm emphasizes the use of functions and procedures?
 Answer: b) Procedural programming
3. What does the "++" operator do in programming languages like C and C++?
 Answer: a) Adds 1 to the variable
4. In programming, what does the term "variable scope" refer to?
 Answer: b) The range within which a variable can be accessed
5. Which control structure is used to execute a block of code repeatedly as long as a condition is true?
 Answer: c) for loop

Object-Oriented Paradigm (05%)

6. What is polymorphism in object-oriented programming?


 Answer: a) The ability to define multiple methods with the same name but different
parameters
7. Which OOP concept allows a class to inherit properties and behavior from another class?
 Answer: b) Inheritance
8. What is the purpose of an interface in Java?
 Answer: a) To provide a blueprint for implementing classes
9. What is encapsulation in object-oriented programming?
 Answer: a) Binding data and functions into a single unit
10. Which keyword is used to prevent a method from being overridden in a subclass in Java?
 Answer: b) final

Discrete Structures (05%)

11. Which of the following is a valid logical connective?


 Answer: c) NOR
12. What is the negation of the statement "Some birds can fly"?
 Answer: b) No birds can fly
13. In set theory, what does the union of two sets contain?
 Answer: d) All elements from both sets without repetition
14. What is the cardinality of the set {1, 2, 3, 4, 5}?
 Answer: c) 5
15. Which of the following is a valid quantifier in predicate logic?
 Answer: a) There exists (∃)

Digital Logic and Computer Organization (06%)

16. Which logic gate produces a low output only when all inputs are low?
 Answer: c) NOR gate
17. What is the binary representation of the decimal number 13?
 Answer: a) 1101
18. Which of the following is a non-volatile memory type?
 Answer: c) ROM
19. What does the ALU stand for in computer architecture?
 Answer: a) Arithmetic and Logic Unit
20. Which component is responsible for storing frequently accessed data for quick retrieval in a
computer system?
 Answer: a) Cache memory

Operating Systems (06%)

21. What is the primary function of an operating system?


 Answer: a) To manage hardware resources
22. Which scheduling algorithm gives priority to the process with the highest priority level?
 Answer: c) Priority Scheduling
23. What is the purpose of virtual memory in an operating system?
 Answer: c) To extend the available RAM
24. Which mechanism is used to prevent multiple processes from accessing shared resources
simultaneously?
 Answer: a) Mutual exclusion
25. What is a device driver in an operating system?
 Answer: b) A program that controls hardware devices

Database Systems (07%)

26. Which type of database model organizes data into tables with rows and columns?
 Answer: c) Relational
27. What is the purpose of a primary key in a database table?
 Answer: a) To uniquely identify each row in the table
28. Which database operation is used to retrieve specific data from a table based on a given condition?
 Answer: d) SELECT
29. What is the purpose of normalization in database design?
 Answer: c) To eliminate duplicate data
30. Which type of join returns only the rows that have matching values in both tables being joined?
 Answer: a) Inner join

Software Engineering & Development (05%)

31. What is the purpose of version control systems in software development?


 Answer: b) To track and manage changes to source code
32. Which software development model is known for its iterative and incremental approach?
 Answer: c) Agile model
33. What is the purpose of unit testing in software development?
 Answer: b) To test individual components or units of code
34. Which software development process involves breaking down requirements into smaller,
manageable tasks?
 Answer: d) Task decomposition
35. What is the purpose of a software requirement specification (SRS) document?
 Answer: b) To define the functional and non-functional requirements of the software

Computer Communication and Networks (06%)

36. Which layer of the OSI model is responsible for logical addressing and routing?
 Answer: c) Network layer
37. What is the purpose of the TCP protocol in computer networks?
 Answer: b) To guarantee the delivery of packets
38. Which network topology connects all devices in a linear sequence?
 Answer: b) Ring
39. What is the purpose of DNS in computer networks?
 Answer: a) To translate domain names to IP addresses
40. Which protocol is used to send email messages over the internet?
 Answer: c) SMTP

Computer Architecture & Assembly Language (08%)

41. What is the purpose of the program counter (PC) in a CPU?


 Answer: b) To fetch the next instruction to be executed
42. Which instruction moves data from memory to a register in assembly language?
 Answer: a) MOV
43. What is the purpose of the ALU in a CPU?
 Answer: b) To perform arithmetic and logic operations
44. Which addressing mode is used to access memory locations directly using a fixed address?
 Answer: b) Direct
45. What is the purpose of the stack pointer (SP) register in a CPU?
 Answer: b) To store the address of the top of the stack

Theory of Automata and Formal Languages (10%)

46. Which of the following is not a valid component of a finite automaton?


 Answer: d) Variables
47. What is the purpose of regular expressions in formal language theory?
 Answer: b) To describe patterns of strings
48. Which type of automaton can recognize context-free languages?
 Answer: b) Pushdown automaton
49. What is the difference between a deterministic finite automaton (DFA) and a nondeterministic finite
automaton (NFA)?
 Answer: c) DFA has deterministic transitions, while NFA has nondeterministic
transitions
50. Which operation is used to concatenate two regular languages?
 Answer: c) Concatenation

Analysis of Algorithms (10%)

51. What is the time complexity of linear search in an unsorted array?


 Answer: c) O(n)
52. Which of the following is not a valid complexity class?
 Answer: d) PSPACE
53. What is the time complexity of the bubble sort algorithm in the worst-case scenario?
 Answer: d) O(n^2)
54. Which algorithm is used to find the shortest path in an unweighted graph?
 Answer: d) Breadth-First Search (BFS)
55. What is the purpose of big O notation in the analysis of algorithms?
 Answer: c) To represent the worst-case time complexity of an algorithm

Artificial Intelligence (07%)

56. What is the time complexity of linear search in a sorted array?


 Answer: c) O(n)
57. Which complexity class represents the set of decision problems solvable by a
deterministic Turing machine using polynomial time?
 Answer: a) P
58. What is the time complexity of the selection sort algorithm in the worst-case scenario?
 Answer: d) O(n^2)
59. Which algorithm is used to find the minimum spanning tree in a graph?
 Answer: c) Prim's algorithm
60. What is the purpose of big O notation in the analysis of algorithms?
 Answer: c) To represent the worst-case time complexity of an algorithm

System Programming (05%)

61. What is the purpose of an assembler in system programming?


 Answer: a) To translate assembly language code into machine code
62. Which of the following is not a valid system call in operating systems?
 Answer: d) print()
63. What is the purpose of a linker in system programming?
 Answer: b) To combine object files into a single executable file
64. Which system programming language is known for its low-level access to hardware
resources?
 Answer: c) C
65. What is the purpose of a library in system programming?
 Answer: a) To provide reusable code modules

Numerical Computing (05%)

66. Which of the following is not a valid numerical computing library in Python?
 Answer: c) Pandas
67. What is the purpose of linear interpolation in numerical computing?
 Answer: a) To approximate values between known data points
68. Which numerical method is used to find the roots of a nonlinear equation?
 Answer: a) Newton-Raphson method
69. What is the purpose of numerical integration in numerical computing?
 Answer: a) To approximate the area under a curve
70. Which numerical technique is used to approximate the solution to a differential
equation?
 Answer: a) Finite difference method

You might also like