2nd Round Exit Exam - Computer Science and Engineering
2nd Round Exit Exam - Computer Science and Engineering
3. What is the difference between passing an array by reference and passing a pointer to an
array in C++ functions?
4. Which of the following classes is used for writing data to a file in C++?
A. fstream
B. ifstream
C. ofstream
D. fileStream
A. A compiler translates the entire program into machine code before execution, while an
interpreter executes the program line by line.
B. There is no difference, they are the same thing.
C. A compiler is used for high-level languages, while an interpreter is used for low-level
languages.
D. Compilers are faster, while interpreters are slower. (Not always true)
7. What is the difference between a console application and a graphical user interface (GUI)
application in C++?
A. Console applications use C++, while GUI applications use a different language.
B. Console applications are faster, while GUI applications are slower.
C. There is no difference; they are the same type of application.
D. Console applications interact with the user through text input/output, while GUI
applications use graphical elements.
A. Algorithm
B. Source code
C. Object code
D. Executable code
10. What is the time, and space complexity of the following code:
int a = 0, b = 0;
a = a + rand();
{
b = b + rand();
C. Circular queue
D. Queue implemented using stacks
public First_C() {
System.out.println("Constructor");
}
static {
System.out.println("Static block");
}
public static void main(String[] args) {
First_C c = new First_C();
c.myMethod();
}
A. Instance block, method, static block, and constructor
B. Method, constructor, instance block, and static block
C. Static block, method, instance block, and constructor
D. Static block, instance block, constructor, and method
23. In Java, which type of exceptions must be caught or declared by the method using the
"throws" keyword?
A. Checked exceptions
B. Unchecked exceptions
C. Runtime Exceptions
D. Error exceptions
24. What is the output of this fragment of code?
A. ABDC
B. AB
C. ABCD
D. ABC
25. Which of the following is the correct way of importing an entire package ‘pkg’?
A. import pkg.
B. Import pkg.
C. import pkg.*
D. Import pkg.*
26. What is the output of this fragment of code?
class array_output
{
public static void main(String args[])
{
int array_variable [] = new int[10];
for (int i = 0; i < 10; ++i)
{
array_variable[i] = i;
System.out.print(array_variable[i] + " ");
i++;
}
}
}
A. 0 2 4 6 8
B. 1 3 5 7 9
C. 0 1 2 3 4 5 6 7 8 9
D. 1 2 3 4 5 6 7 8 9 10
27. What is the primary key used for in a database table?
A. VARCHAR
B. BOOLEAN
C. FLOAT
D. ARRAY
31. What does ACID stand for in the context of database transactions?
A. The process of reducing redundancy and dependency by organizing data into tables
A. Lack of scalability
A. only one transaction read the item that are written by committed transaction
B. Neither read nor write on an item until the last transaction wrote committed/ aborted
C. For every transaction participated in the schedule all the operation are executed
consecutively
D. Serial schedule
B. P tries to access a page that is in the RAM space, Without triggering a page fault
C. An interrupt is raised by the disk to deliver data requested by some other process
A. 1
B. 2
C. 3
D. 4
50. A scheduling algorithm assigns priority proportional to the waiting time of a process.
Every process starts with priority zero (the lowest priority). The scheduler re-evaluates
the process priorities every T time units and decides the next process to schedule. Which
one of the following is TRUE if the processes have no I/O operations and all arrive at
time zero?
A. Mutual exclusion
B. Process synchronization
C. Circular wait
D. Performance improvement
52. Which of the following disk-scheduling strategies is likely to give the best throughput?
A. Farthest cylinder next
B. Elevator algorithm
53. If 32-bit addressing is used for pages whose maximum size is 512 KB, what is the
maximum number of pages that can be addressed?
A. 4096
B. 2048
C. 8192
D. 16384
54. To avoid race conditions, the number of processes using the critical sections is/are:
A. More than 3
B. 2
C. 4
D. 1
55. How many bits are needed to encode 26 capital letters, 26 small letters 10 symbols, and
all numerals?
A. 5 B. 6 C.7 D. 8
56. Which of the following pair of logic gates is a combination of three basic Logic
gates?_______.
A. XOR/XNOR B. NAND/NOR C. AND/NAND D. OR/NOR
57. In the expression A + BC, which of the following has the correct combination?
A. and ∑ C. and ∑
B. and ∑ D. and ∑
58. Which of the following is not correct for Digital Circuits?
A. Less susceptible to noise or degradation in quality
B. Use transistors to create logic gates to perform Boolean logic
C. Easier to perform error detection and correction with digital signal
D. Less versatile and precision
59. Synchronous counters eliminate the delay problems encountered with asynchronous
(ripple) counters because the:
A. Input clock pulses are applied only to the first and last stages
B. Input clock pulses are applied only to the last stage
C. Input clock pulses are not used to activate any of the counter stages
D. Input clock pulses are applied simultaneously to each stage
60. Which of the following is correct for a gated D-type flip-flop?
A. The Q output is either SET or RESET as soon as the D input goes HIGH or LOW
B. The output complement follows the input when enabled
C. Only one of the inputs can be HIGH at a time
D. The output toggles if one of the inputs is held HIGH
61. One major difference between a NAND based - latch & a NOR based S-R latch is __
A. The inputs of NOR latch are 0 but 1 for NAND latch
B. The inputs of NOR latch are 1 but 0 for NAND latch
C. The output of NAND latch becomes set if =0 & =1 and vice versa for NOR latch
D. The output of NOR latch is 1 but 0 for NAND latch
62. Consider a 4-bit Johnson counter with an initial value of 0000. The counting sequence of
this counter is
A. 0, 1, 3, 7, 15, 14, 12, 8, 0
B. 0, 1, 3, 5, 7, 9, 11, 13, 15, 0
C. 0, 2, 4, 6, 8, 10, 12, 14, 0
D. 0, 8, 12, 14, 15, 7, 3, 1, 0
63. Consider a sequential digital circuit consisting of T flip-flops and D flip-flops as shown
in the figure. CLKIN is the clock input to the circuit. At the beginning, Q1, Q2 and Q3
have values 0, 1 and 1, respectively.
Which one of the given values of (Q1, Q2, Q3) can NEVER be obtained with this digital
circuit?
A. (0, 0, 1)
B. (1, 0, 0)
C. (1, 0, 1)
D. (1, 1, 1)
64. The flip-flops which has not any invalid states are _____________
A. The S-R, J-K, D
B. S-R, J-K, T
C. J-K, D, S-R
D. J-K, D, T
65. Which of the following digital logic circuits can be used to add more than 1 – bit
simultaneously?
A. Full – adder
B. Ripple – carry adder
C. Half – adder
D. Serial adder
66. Which of the following is NOT a characteristic of hardwired implementation of a control
unit?
A. Faster execution
B. Fixed behavior
C. Flexible design
D. Limited scalability
67. What does the decode phase of the instruction cycle involve?
A. Translating instructions into machine code
68. In which addressing mode is the operand value itself specified within the instruction?
A. Absolute
B. Immediate
C. Indirect
D. Indexed
B. Scalability
C. Decreased complexity
D. Improved fault tolerance
74. The university ICT office tries to monitor all networking devices found in the university
ICT infrastructure to troubleshoot the network as quick as possible. What kind of
application layer protocol is used by the ICT staffs assigned to this service?
A. MIME
B. SMTP
C. SNMP
D. SIP
75. Which of the following is a responsibility of the network layer in the OSI model?
A. Providing reliable end-to-end communication between applications.
B. Providing error detection and correction.
C. Providing physical addressing of devices on the network.
D. Providing unreliable end-to-end communication between source and destination
hosts.
76. What is the broadcast address of a given network when the network address is 189.24.0.0
and its subnet mask is 255.255.192.0?
A. 189.24.63.255
B. 189.24.0.255
C. 189.30.63.255
D. 189.24.31.255
77. Suppose you are working in Gada Industry Complex as a junior Network Administrator,
the senior system administrator orders you to come up with a solution to allow seven
servers (i.e., Web, Application, TFTP, DNS and Database) in the company will be on in a
single subnet with a limited number of unused IP-addresses. Which network address and
subnet mask meets the company requirement?
A. 172.65.24.128 255.255.255.252
B. 172.65.24.128 255.255.255.240
C. 172.65.24.128 255.255.255.224
D. 172.65.24.128 255.255.255.248
78. Which one of the following is the best shorthand notation for the IPv6 address
B514:82C3: 0000:0000:0029:EC7A:0000:EC72?
A. B514 : 82C3 : 29 : EC7A : EC72
B. B514 : 82C3 :: 29 : EC7A :: EC72
C. B514 : 82C3 :: 29 : EC7A : 0000 : EC72
D. B514 : 82C3 :: 29 : EC7A : 0 : EC72
84. Which advanced database security technique utilizes row-level access control to grant
granular access to specific data elements within a record?
A. Role-Based Access Control (RBAC)
B. Attribute-Based Access Control (ABAC)
C. Mandatory Access Control (MAC)
D. Discretionary Access Control (DAC)
85. What is theft of service?
A. This type of violation involves unauthorized reading of data
B. This violation involves unauthorized modification of data
C. This violation involves unauthorized destruction of data
D. This violation involves unauthorized use of resources
86. What is the purpose of a security patch for an operating system?
A. To personalize the user interface
B. To improve system compatibility with older hardware
C. To add new features and functionalities
D. To fix vulnerabilities and security holes
87. Which Design Principles of Security states that unless the subject is given explicit access
to the object it should be denied access to that object?
A. Principles of least privileges
B. Principles of fail safe defaults
C. Principles of separation of privileges
D. Principles of least common mechanism
88. Which of the following best describes the concept of encryption in network security?
A. Increasing the size of data packets for faster transmission
B. Granting everyone access to data with varying permission levels
C. Hiding data by scrambling it with a secret key
D. Sharing data publicly but controlling who can access it
89. A multi-layered approach to network security is best because _____.
A. It uses less resources in your datacenter.
B. It costs less the other approaches.
C. Some brands are better than others.
D. Different types of network security systems focus on different threats and
vulnerabilities
90. What is the purpose of using a proxy server for a hacker?
A. Create a ghost server on the network
B. Create a stronger connection with the target
C. For obtaining remote access connection
D. Hiding malicious activity on the network
91. What is used to protect the network from outside internet access?
A. A trusted antivirus
B. 24-hour scanning for virus
C. Firewall to separate trusted and untrusted network
D. Deny users access to websites that can potentially cause a security leak
92. Which algorithm would be most suitable for a real-time game AI that needs to make
decisions very quickly?
A. A*
B. Breadth-first search
C. Depth-first search
D. Iterative deepening depth-first search
93. In uninformed search algorithms, how are nodes expanded from the frontier?
A. Nodes are expanded based on their heuristic values.
B. Nodes are expanded randomly.
C. Nodes are expanded in a specific order, such as FIFO or LIFO.
D. Nodes are expanded based on their depth in the search tree.
94. What distinguishes a heuristic search algorithm from an uninformed search algorithm?
A. Heuristic search algorithms can return more than one solution.
B. Heuristic search algorithms use additional knowledge to estimate the shortest path to
the goal.
C. Uninformed search algorithms are faster.
D. Uninformed search algorithms use a problem-specific knowledge base.
95. Which agent deals with the happy and unhappy state?
A. Utility-based agent
B. Model-based agent
C. Goal-based Agent
D. Learning Agent
96. What is the primary purpose of first-order predicate logic in artificial intelligence?
A. To represent complex relationships between objects and entities
B. To perform arithmetic operations efficiently
C. To optimize search algorithms
D. To visualize data in higher dimensions
97. Which of the following is the existential quantification of "All dogs are friendly"?
A. There exists a dog that is friendly.
B. There exists a dog that is not friendly.
C. For some dog x, x is friendly.
D. All friendly things are dogs.
98. Which search algorithm is guaranteed to find the shallowest goal node in the search tree
first?
A. Depth-first search
B. Breadth-first search
C. A* search
D. Hill climbing
99. What is the negation of the statement "∀x (Student(x) → TakesMath(x))"? (Everyone
who is a student takes math)
A. There exists a student who does not take math.
B. ∃x (Student(x) ∧ ¬TakesMath(x))
C. No student takes math.
D. All students who don't take math are not students.
100. Among the given options, which search algorithm requires less memory?
A. Optimal Search
B. Depth First Search
C. Breadth-First Search
D. Linear Search