0% found this document useful (0 votes)
38 views22 pages

2nd Round Exit Exam - Computer Science and Engineering

The document outlines the structure of a model exit examination for the Department of Computer Science and Engineering at Adama Science and Technology University. It includes various topics such as programming fundamentals, data structures, algorithms, object-oriented programming, database systems, software engineering, operating systems, and more. Each section contains multiple-choice questions designed to assess students' understanding of key concepts in computer science.

Uploaded by

Filmon Tsehaye
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)
38 views22 pages

2nd Round Exit Exam - Computer Science and Engineering

The document outlines the structure of a model exit examination for the Department of Computer Science and Engineering at Adama Science and Technology University. It includes various topics such as programming fundamentals, data structures, algorithms, object-oriented programming, database systems, software engineering, operating systems, and more. Each section contains multiple-choice questions designed to assess students' understanding of key concepts in computer science.

Uploaded by

Filmon Tsehaye
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
You are on page 1/ 22

ADAMA SCIENCE AND TECHNOLOGY UNIVERSITY

COLLAGE OF ELECTRICAL ENGINEERING AND COMPUTING

DEPARTMENT OF COMPUTER SCIENCE AND ENGINEERING

2nd ROUND MODEL EXIT EXAMINATION Time: 2hr

Part I: Fundamentals of Programming [1-9]

Part II: Data Structure and Algorithms [10-18]

Part III: Object Oriented Programming [19-26]

Part IV: Database Systems [27-37]

Part V: Fundamentals of Software Engineering [38-45]

Part VI: Operating System [46-54]

Part VII: Digital Logic Design [55-65]

Part VIII: Computer organization and architecture [66-73]

Part IX: Data Communication and Computer Networking [74-82]

Part X: Computer Systems Security [83-91]

Part XI: Introduction to Artificial Intelligence [92-100]


Choose the best answer from the given alternatives.

1. What is the difference between a structure and a class in C++?

A. There is no significant difference.


B. Structures cannot have member functions (methods), while classes can.
C. Structures are used for primitive data types, while classes are for complex data types.
D. Structures are faster than classes.

2. How do you access members (variables or functions) of a structure or class in C++?

A. Directly using the member name.


B. Using a special function to access them.
C. By creating an instance of the structure/class first, then using the dot (.) operator.
D. There is no way to access members directly.

3. What is the difference between passing an array by reference and passing a pointer to an
array in C++ functions?

A. Passing by reference can only be used for small arrays.


B. Passing by reference passes the entire array, while passing a pointer only passes the
memory address of the first element.
C. Passing by reference is more efficient, while passing a pointer is safer.
D. There is no difference, they achieve the same outcome.

4. Which of the following classes is used for writing data to a file in C++?

A. fstream
B. ifstream
C. ofstream
D. fileStream

5. What is the difference between a compiler and an interpreter?

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)

6. What is a function in programming?

A. A loop that repeats forever


B. A reusable block of code that performs a specific task.
C. A variable that stores data
D. A way to comment on your code

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.

8. What does the continue statement do within a loop in C++?

A. It terminates the entire loop and exits the loop body.


B. It skips the remaining code in the current iteration and jumps to the beginning of the next
iteration.
C. It repeats the current iteration of the loop.
D. It allows user input to be received within the loop.

9. While C++ program execution, an input for linker is________________.

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;

for (i = 0; i < N; i++)

a = a + rand();

for (j = 0; j < M; j++)

{
b = b + rand();

A. O(N * M) time, O(1) space

B. O(N + M) time, O(N + M) space

C. O(N + M) time, O(1) space

D. O(N * M) time, O(N + M) space

11. The Worst case occurs in linear search algorithm when


A. Item is somewhere in the middle of the array

B. Item is not in the array at all

C. Item is the last element in the array

D. Item is the last element in the array or is not there at all

12. A stack data structure cannot be used for


A. Implementation of Recursive Function
B. Allocation of Resources and Schedule
C. Reversing a string
D. Evaluation of string in postfix form
13. A full binary tree with n leaves contains
A. n nodes
B. log2 n nodes
C. 2n+1 nodes
D. 2n
14. Which is the best data structure for round robin algorithm for CPU scheduling?
A. Stack implemented using queues

B. Doubly linked list

C. Circular queue
D. Queue implemented using stacks

15. The prefix form of A-B/ (C * D ^ E) is?


A. -A/B*C^DE
B. -A/BC*^DE
C. -ABCD*^DE
D. -/*^ACBDE
16. When determining the efficiency of algorithm, the space factor is measured by

A. Counting the maximum memory needed by the algorithm


B. Counting the minimum memory needed by the algorithm
C. Counting the average memory needed by the algorithm
D. Counting the maximum disk space needed by the algorithm
17. Which of the following is not the application of stack?
A. Data Transfer between two asynchronous process
B. Compiler Syntax Analyzer
C. Tracking of local variables at run time
D. A parentheses balancing program
18. Which of the following points is/are not true about Linked List data structure when it is
compared with an array?
A. Random access is not allowed in a typical implementation of Linked Lists
B. Access of elements in linked list takes less time than compared to arrays
C. Arrays have better cache locality that can make them better in terms of performance
D. It is easy to insert and delete elements in Linked List
19. Which of the following statements about constructors is true?
A. A class can have multiple constructors with the same signature
B. Constructors are inherited from the superclass
C. Constructors can be marked as final
D. Constructors can be overloaded with different parameter lists
20. What happens if you omit this keyword when referring to an instance variable with the
same name as a method parameter?
A. The program will not compile.
B. The method parameter will be shadowed.
C. The instance variable will be set to its default value.
D. The instance variable will be set to null
21. Which OOP concept allows a class to inherit properties and behaviours from multiple
super classes?
A. Encapsulation
B. Polymorphism
C. Multiple inheritance
D. Method overloading
22. What should be the execution order, if a class has a method, static block, instance block,
and constructor, as shown below?

public class First_C {


public void myMethod() {
System.out.println("Method");
}
{
System.out.println("Instance Block");
}

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?

public class Base


{
public void methodOne()
{
System.out.print("A");
methodTwo();
}

public void methodTwo()


{
System.out.print("B");
}
}

public class Derived extends Base


{
public void methodOne()
{
super.methodOne();
System.out.print("C");
}

public void methodTwo()


{
super.methodTwo();
System.out.print("D");
}
}

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. To uniquely identify each row

B. To store large text data

C. To perform aggregate functions

D. To define relationships between tables

28. Which of the following is not a valid data type in SQL?

A. VARCHAR

B. BOOLEAN

C. FLOAT

D. ARRAY

29. What is the purpose of the GROUP BY clause in SQL?

A. To specify the conditions for joining tables

B. To sort the result set in ascending order

C. To filter rows based on a specified condition

D. To group rows with the same values into summary rows

30. What is a foreign key in a relational database?

A. A key used to uniquely identify each row in a table

B. A key that references another table's primary key

C. A key used to encrypt sensitive data

D. A key that is indexed for faster retrieval

31. What does ACID stand for in the context of database transactions?

A. Atomicity, Consistency, Isolation, Durability

B. Aggregate, Control, Inheritance, Distribution

C. Access, Control, Integrity, Data

D. Association, Communication, Identification, Deployment


32. Why is concurrency control needed in a database system?

A. To perform aggregate summary functions

B. To handle system errors and computer failures

C. To manage exception conditions detected by transactions

D. To mitigate physical problems and catastrophes

33. What is normalization in the context of database design?

A. The process of reducing redundancy and dependency by organizing data into tables

B. The process of adding redundancy to improve performance

C. The process of converting text data into numeric data

D. The process of optimizing database queries

34. Which of the following is a disadvantage of using NoSQL databases?

A. Lack of scalability

B. Lack of support for unstructured data

C. Limited query capabilities

D. Lack of ACID compliance

35. What is a stored procedure in a database?

A. A function that returns a single value

B. A set of SQL statements that perform a specific task

C. A database index for faster retrieval of data

D. A rule that enforces data integrity constraints

36. Which of the following is correct about Non-Serial schedules

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

37. What is the purpose of the WHERE clause in SQL?

A. To specify the columns to be returned in the result set

B. To join multiple tables together

C. To filter rows based on a specified condition

D. To sort the result set in ascending order

38. What is the goal of software verification?


A. Building the system
B. Building the right system
C. Building the system right
D. Testing the system
39. Which of the following is an example of a quantifiable requirement?
A. The system should be user-friendly.
B. The system should process transactions quickly.
C. The system should have an intuitive interface.
D. The system should be visually appealing.
40. What is the primary goal of requirements elicitation?
A. To document requirements after implementation.
B. To prioritize requirements based on stakeholder preferences.
C. To discover, understand, and define the needs of stakeholders.
D. To validate requirements through testing.
41. What does the system context class diagram define?
A. The entity classes in the system
B. How the system interfaces to other systems
C. The boundary between the system and the external environment
D. The context classes in the system
42. Which UML diagram provides the structural view of the system?
A. Use-case diagram
B. Class diagram
C. Sequence Diagram
D. Collaboration Diagram
43. Which of the following is not performance-related?
A. System response time
B. System throughput
C. System availability
D. System capacity
44. During the architectural design phase, what does the term "scalability" refer to?
A. The ability of the system to handle a growing amount of work
B. The size of each subsystem in the system
C. The cost-effectiveness of the architectural design
D. The speed at which the system can be deployed
45. Which of the following does not apply to Agile software process model?
A. Uses incremental product delivery strategy
B. Only essential work products are produced
C. Able to respond quickly to changing requirements without excessive rework
D. Eliminate the use of project planning and testing
46. Consider a process P running on a CPU. Which one or more of the following events will
always trigger a context switch by the OS that results in process P moving to a non-
running state (e.g., ready, blocked)?
A. P makes a blocking system call to read a block of data from the disk

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

D. A timer interrupt is raised by the hardware

47. What is the swap space in the disk used for?

A. Saving temporary html pages

B. Saving process data

C. Storing the super-block

D. Storing device drivers


48. Consider three CPU-intensive processes, which require 10, 20 and 30 time units and
arrive at times 0, 2 and 6, respectively. How many context switches are needed if the
operating system implements the shortest remaining time first scheduling algorithm? Do
not count the context switches at time zero and at the end.

A. 1

B. 2

C. 3

D. 4

49. The essential content(s) in each entry of a page table is/are

A. Virtual page number

B. Both virtual page number and page frame number

C. Page frame number

D. Access right information

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. This algorithm is equivalent to the first-come-first-serve algorithm.

B. This algorithm is equivalent to the shortest-remaining-time-first algorithm.

C. This algorithm is equivalent to the shortest-job-first algorithm.

D. This algorithm is equivalent to the Round-Robin algorithm.

51. Semaphores provide a solution for

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

C. First come first server

D. Nearest cylinder next

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

B. Executing arithmetic operations

C. Interpreting memory addresses

D. Interpreting the opcode and operands of an instruction

68. In which addressing mode is the operand value itself specified within the instruction?
A. Absolute
B. Immediate

C. Indirect

D. Indexed

69. What is the purpose of the opcode in an instruction format?


A. To specify the memory address

B. To indicate the type of operation to be performed

C. To store the result of the operation

D. To specify the size of the instruction

70. What is a hazard in instruction pipelining?

A. A condition that slows down the pipeline

B. A situation where the pipeline stalls or produces incorrect results

C. A mechanism to increase clock speed

D. A type of cache memory

71. What is the primary goal of instruction pipelining?


A. To increase clock speed

B. To improve CPU efficiency

C. To reduce power consumption

D. To increase cache size

72. Which of the following is NOT a characteristic of a Von Neumann architecture?


A. Stored-program concept

B. ALU capable of conducting operation in binary

C. Sequential execution of instructions

D. Parallel processing of instructions

73. Which of the following is NOT a characteristic of a multiprocessor system?


A. Increased throughput

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

79. What is the purpose of the OSI model?


A. To specify the physical components of a network
B. To define how data is transmitted over a network
C. To standardize network communication protocols
D. To provide a framework for understanding network functions and protocols
80. Which network topology provides the highest level of fault tolerance?
A. Star
B. Bus
C. Mesh
D. Ring
81. What is the primary purpose of VLANs (Virtual Local Area Networks)?
A. To encrypt data transmitted over a network
B. To segment a single physical network into multiple logical networks
C. To translate domain names to IP addresses
D. To connect devices within a single physical location
82. Which action implements physical access control as part of the security program of an
organization?
A. Setting up SSO (Single Sign On) password for the organization services
B. Backing up syslogs at a remote location
C. Configuring enable passwords on network devices
D. Configuring a password for the console port

83. SQL authorization mechanism grants privileges on


A. Entire relation
B. Specified attributes
C. Both entire relation and specified attributes
D. Specified tuples

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

You might also like