Sbi (So) It MCQ Course
Sbi (So) It MCQ Course
Features
2|P ag e
1. Software Development:
Data-Structures and Algorithms: o Questions based on Arrays, Linked List,
Stacks, Queues, Binary Tree, Binary Search Tree, Heaps, Hashing and Recursion. o
Searching and Sorting Algorithms along with their Space-Time Complexities -
Object Oriented Programming Concepts: Abstraction, Association, Encapsulation,
Composition, Polymorphism, Aggregation, Inheritance, Message Passing..
A) O(1)
B) O(n)
C) O(log n)
D) O(n log n)
Answer: C
Explanation: Insertion in a binary heap involves placing the element at the bottom and
then "bubbling up," which takes O(log n) time.
A) Queue
B) Stack
C) Heap
D) Linked List
Answer: B
Explanation: Recursion uses a stack for storing the return address and local variables
during the function call.
3. Which sorting algorithm has the best average-case time complexity when
sorting an array with uniformly distributed elements?
A) Merge Sort
B) Quick Sort
C) Heap Sort
D) Counting Sort
Answer: D
Explanation: Counting Sort has an average-case time complexity of O(n + k) for
uniformly distributed data, where k is the range of input.
3|P ag e
4. What is the best case time complexity for searching an element in a balanced
binary search tree (BST)?
A) O(1)
B) O(log n)
C) O(n)
D) O(n log n)
Answer: B
Explanation: The best case for searching in a balanced BST is O(log n), achieved when
the element is near the root.
A) Stack
B) Queue and Hash Map
C) Binary Search Tree and Linked List
D) Heap and Linked List
Answer: B
Explanation: LRU cache is implemented using a combination of a doubly linked list (for
storing the order) and a hash map (for O(1) lookups).
6. Which of the following is true for a circular queue implemented using an array
of size n?
Answer: C
Explanation: A circular queue implemented using an array can hold only n-1 elements
due to the need for a condition to distinguish between full and empty states.
4|P ag e
Answer: B
Explanation: Linear Probing uses no extra space for linked lists but instead reuses the
array, making it more space-efficient than chaining.
A) Merge Sort
B) Bubble Sort
C) Quick Sort
D) Insertion Sort
Answer: C
Explanation: Quick Sort is not a stable sorting algorithm as it can change the relative
order of elements with equal keys.
A) O(1)
B) O(log n)
C) O(n)
D) O(n log n)
Answer: C
Explanation: Merge sort requires additional O(n) space for the temporary arrays used in
merging.
10. What is the time complexity of deleting an element from a min-heap of size n?
A) O(1)
B) O(log n)
C) O(n)
D) O(n log n)
Answer: B
Explanation: Deletion from a min-heap involves removing the root and heapifying the
remaining elements, which takes O(log n) time.
11. In a doubly linked list, what is the time complexity for searching an element?
A) O(1)
B) O(n)
C) O(log n)
D) O(n^2)
5|P ag e
Answer: B
Explanation: Searching in a doubly linked list takes O(n) in the worst case since you
may need to traverse the entire list.
12. Which of the following trees allows efficient searching, insertion, and
deletion, but does not ensure balance?
A) AVL Tree
B) Red-Black Tree
C) Binary Search Tree
D) Splay Tree
Answer: C
Explanation: A Binary Search Tree allows these operations efficiently, but it may
become unbalanced and degenerate into a linked list.
13. What is the time complexity of a breadth-first search (BFS) on a graph with
V vertices and E edges using an adjacency list?
A) O(V + E)
B) O(V^2)
C) O(E log V)
D) O(V log E)
Answer: A
Explanation: BFS traverses all vertices and edges in a graph, resulting in a time
complexity of O(V + E) using an adjacency list.
A) Quick Sort
B) Merge Sort
C) Bubble Sort
D) Insertion Sort
Answer: B
Explanation: Merge Sort performs a fixed number of comparisons for each pair of
elements, making it independent of the input distribution.
6|P ag e
15. Which of the following techniques is used to break a problem into smaller
subproblems and then combine their solutions?
A) Dynamic Programming
B) Divide and Conquer
C) Greedy Algorithm
D) Backtracking
Answer: B
Explanation: Divide and Conquer breaks a problem into smaller subproblems, solves
them independently, and combines their results.
16. Which data structure supports both FIFO (First In First Out) and LIFO
(Last In First Out) operations?
A) Stack
B) Deque
C) Queue
D) Priority Queue
Answer: B
Explanation: A deque (double-ended queue) supports both FIFO and LIFO operations
by allowing insertion and deletion at both ends.
A) O(n log n)
B) O(n)
C) O(n^2)
D) O(log n)
Answer: C
Explanation: The worst-case time complexity of Quick Sort occurs when the pivot is
consistently the smallest or largest element, resulting in O(n^2) time.
A) Merge Sort
B) Quick Sort
C) Radix Sort
D) Counting Sort
7|P ag e
Answer: B
Explanation: Quick Sort is an in-place sorting algorithm as it does not require extra
storage, while Merge Sort requires additional space for merging.
19. In an AVL tree, what is the maximum difference in heights between the left
and right subtrees of a node?
A) 1
B) 2
C) n
D) 0
Answer: A
Explanation: In an AVL tree, the difference in heights between the left and right
subtrees of any node is at most 1 to maintain balance.
20. What is the time complexity of deleting a node from a binary search tree
(BST) in the worst case?
A) O(log n)
B) O(n)
C) O(n log n)
D) O(1)
Answer: B
Explanation: The worst-case time complexity of deletion in a BST is O(n), which
happens when the tree is skewed (essentially behaving like a linked list).
21. What is the minimum height of a binary search tree with n nodes?
A) O(n)
B) O(log n)
C) O(n log n)
D) O(1)
Answer: B
Explanation: The minimum height of a binary search tree with n nodes is O(log n),
achieved when the tree is balanced.
22. Which data structure is best suited for implementing an undo operation in
text editors?
A) Queue
B) Stack
C) Linked List
8|P ag e
D) Hash Table
Answer: B
Explanation: Stack is used for the undo operation, as it follows the LIFO (Last In First
Out) principle, allowing the most recent operation to be reversed first.
23. What is the main advantage of using a doubly linked list over a singly linked
list?
Answer: C
Explanation: The primary advantage of a doubly linked list is the ability to traverse the
list in both forward and backward directions, as each node points to both its previous and
next nodes.
24. Which of the following is true for a hash function used in hashing?
A) It must be non-injective
B) It should map distinct keys to the same index
C) It should minimize collisions
D) It must be a bijective function
Answer: C
Explanation: A good hash function should minimize collisions, i.e., the number of
instances where two different keys map to the same index.
25. In the context of binary heaps, what is the parent of the node at index 'i'?
A) 2i
B) i/2
C) (i-1)/2
D) (i+1)/2
Answer: C
Explanation: In a binary heap, the parent of the node at index 'i' can be found at the
index (i-1)/2.
26. What is the time complexity of inserting an element into a hash table with
chaining in the best case?
A) O(1)
B) O(n)
9|P ag e
C) O(log n)
D) O(n^2)
Answer: A
Explanation: In the best case, where there are no collisions, inserting an element into a
hash table with chaining takes O(1) time.
27. What is the time complexity of accessing an element in a hash table in the
worst case?
A) O(1)
B) O(log n)
C) O(n)
D) O(n log n)
Answer: C
Explanation: In the worst case, where all keys hash to the same index, a hash table
degrades to a linked list, leading to O(n) access time.
28. Which of the following traversal strategies guarantees visiting nodes level by
level in a tree?
A) Pre-order Traversal
B) Post-order Traversal
C) Depth First Search
D) Breadth First Search
Answer: D
Explanation: Breadth First Search (BFS) guarantees level-by-level traversal of nodes in
a tree or graph.
29. In a priority queue implemented using a binary heap, what is the time
complexity of extracting the maximum element?
A) O(1)
B) O(log n)
C) O(n)
D) O(n log n)
Answer: B
Explanation: Extracting the maximum element from a binary heap takes O(log n) time
due to the need to re-heapify the structure after removal.
30. What is the time complexity of finding the median in a sorted array?
10 | P a g e
A) O(1)
B) O(log n)
C) O(n)
D) O(n log n)
Answer: A
Explanation: The median can be found in O(1) time in a sorted array, as it is located at
the middle index.
31. What is the advantage of using a self-balancing binary search tree (e.g., AVL
Tree) over a normal binary search tree?
Answer: A
Explanation: Self-balancing binary search trees like AVL Trees provide faster search in
the worst case (O(log n)) as they maintain balance, preventing degeneration into a linked
list.
32. Which of the following algorithms is used to find the shortest path in a graph
with negative edge weights?
A) Dijkstra's Algorithm
B) Prim's Algorithm
C) Bellman-Ford Algorithm
D) Kruskal's Algorithm
Answer: C
Explanation: The Bellman-Ford Algorithm is used to find the shortest path in graphs
with negative edge weights, unlike Dijkstra's, which fails with negative edges.
33. Which sorting algorithm is the most efficient when the input array is nearly
sorted?
A) Merge Sort
B) Quick Sort
C) Insertion Sort
D) Bubble Sort
Answer: C
Explanation: Insertion Sort works very efficiently when the input array is nearly sorted,
with a time complexity of O(n) in this case.
11 | P a g e
34. What is the advantage of using an adjacency list over an adjacency matrix for
graph representation?
Answer: B
Explanation: An adjacency list is more space-efficient than an adjacency matrix for
sparse graphs, where the number of edges is much smaller than the number of vertices.
35. Which tree traversal algorithm can be used to serialize a binary tree
uniquely?
A) Pre-order Traversal
B) In-order Traversal
C) Post-order Traversal
D) Level-order Traversal
Answer: A
Explanation: Pre-order traversal is commonly used to serialize a binary tree, as it
captures the structure of the tree uniquely, including the null markers.
Answer: A
Explanation: Recursive algorithms can lead to stack overflow and inefficient memory
usage for large inputs due to the overhead of recursive function calls.
37. Which data structure is used to implement Prim's algorithm for Minimum
Spanning Tree efficiently?
A) Stack
B) Queue
C) Priority Queue (Min-Heap)
D) Linked List
12 | P a g e
Answer: C
Explanation: Prim's algorithm uses a priority queue (typically implemented as a min-
heap) to efficiently find the minimum weight edge to add to the growing spanning tree.
38. In a graph represented using an adjacency list, what is the time complexity of
finding all neighbors of a given node?
A) O(1)
B) O(V)
C) O(E)
D) O(degree of the node)
Answer: D
Explanation: In an adjacency list, the time complexity to find all neighbors of a node is
proportional to the degree of that node.
Answer: A
Explanation: DFS is used to detect cycles in a directed graph by marking nodes and
checking for back edges during traversal.
A) Red-Black Tree
B) Binary Heap
C) B-tree
D) Trie
Answer: A
Explanation: A Red-Black Tree is a self-balancing binary search tree, ensuring O(log n)
time complexity for insertion, deletion, and search operations.
41. What is the time complexity of the best-case scenario of the Heap Sort
algorithm?
A) O(n log n)
B) O(n)
C) O(log n)
D) O(n^2)
13 | P a g e
Answer: A
Explanation: The best-case time complexity of Heap Sort is O(n log n), similar to its
average and worst-case time complexities.
A) Merge Sort
B) Heap Sort
C) Quick Sort
D) Radix Sort
Answer: D
Explanation: Radix Sort is not a comparison-based sorting algorithm; it sorts numbers
by processing individual digits.
43. In a binary search tree, which traversal method will give the nodes in
increasing order?
A) Pre-order Traversal
B) Post-order Traversal
C) In-order Traversal
D) Level-order Traversal
Answer: C
Explanation: In-order traversal of a binary search tree (BST) visits the nodes in
increasing order.
A) 2 log(n+1)
B) log n
C) 2 log n
D) log(n) + 1
Answer: A
Explanation: The maximum height of a red-black tree is 2 log(n+1), where n is the
number of nodes. Red-black trees are balanced, with a height that ensures efficient search
operations.
45. Which data structure would you use to represent a set of non-overlapping
intervals?
A) Segment Tree
B) Binary Search Tree
C) Red-Black Tree
D) AVL Tree
14 | P a g e
Answer: A
Explanation: A segment tree is used to represent intervals efficiently, allowing for fast
querying of overlapping intervals.
46. What is the time complexity of inserting an element into a binary search tree
in the worst case?
A) O(n)
B) O(log n)
C) O(1)
D) O(n log n)
Answer: A
Explanation: In the worst case, a binary search tree can degenerate into a linked list,
resulting in O(n) insertion time.
Answer: C
Explanation: Dynamic programming typically improves time complexity by avoiding
recalculation of overlapping subproblems, but it often comes at the cost of increased
space complexity (due to memoization).
48. What is the time complexity of searching for an element in a skip list with n
elements?
A) O(log n)
B) O(n)
C) O(1)
D) O(n log n)
Answer: A
Explanation: The time complexity of searching in a skip list is O(log n) on average, as
the skip list allows for faster traversal compared to a linked list.
A) Floyd-Warshall Algorithm
15 | P a g e
B) Kahn's Algorithm
C) Kosaraju’s Algorithm
D) Bellman-Ford Algorithm
Answer: C
Explanation: Kosaraju’s Algorithm is used to find all strongly connected components in
a directed graph efficiently.
A) Chaining
B) Open Addressing
C) Double Hashing
D) Quadratic Probing
Answer: B
Explanation: Open Addressing resolves collisions by moving the collided element to
another available slot in the hash table.
A) Dijkstra's Algorithm
B) Prim's Algorithm
C) Bellman-Ford Algorithm
D) Kruskal's Algorithm
Answer: C
Explanation: The Bellman-Ford algorithm can detect negative weight cycles by relaxing
edges n-1 times and checking for further improvements.
52. Which data structure is most suitable for implementing a circular buffer?
A) Queue
B) Stack
C) Array
D) Circular Queue
Answer: D
Explanation: A circular queue is the most suitable data structure for implementing a
circular buffer, as it efficiently manages the buffer's finite size.
53. What is the minimum number of edges in a connected graph with n vertices
and no cycles?
A) n-1
16 | P a g e
B) n
C) n+1
D) 2n-1
Answer: A
Explanation: A connected graph with no cycles is a tree, and a tree with n vertices has n-
1 edges.
A) O(1)
B) O(log n)
C) O(n)
D) O(n log n)
Answer: A
Explanation: In an AVL tree, both left and right rotations are O(1) operations, as they
involve only a constant amount of pointer manipulation.
55. Which of the following algorithms solves the single-source shortest path
problem in a graph with non-negative edge weights?
A) Bellman-Ford Algorithm
B) Floyd-Warshall Algorithm
C) Dijkstra's Algorithm
D) Kruskal's Algorithm
Answer: C
Explanation: Dijkstra's Algorithm solves the single-source shortest path problem
efficiently when all edge weights are non-negative.
56. What is the best-case time complexity for a Breadth-First Search (BFS)
traversal in a graph?
A) O(V)
B) O(V+E)
C) O(E log V)
D) O(V log V)
Answer: B
Explanation: The best-case time complexity for BFS is O(V + E), where V is the
number of vertices and E is the number of edges in the graph.
A) Abstraction
B) Encapsulation
C) Inheritance
D) Compilation
Answer: D
Explanation: Compilation is related to how code is converted from a high-level language
into machine code, whereas Object-Oriented Programming (OOP) concepts include
abstraction, encapsulation, and inheritance.
Answer: B
Explanation: Encapsulation is the process of wrapping the data (attributes) and code
(methods) into a single unit, or class, and restricting direct access to some of the object's
components, thereby hiding the internal implementation.
A) Abstraction
B) Encapsulation
C) Polymorphism
D) Inheritance
Answer: C
Explanation: Polymorphism allows a subclass to override or implement a method that is
already defined in its superclass, providing specific behavior while maintaining a
consistent interface.
18 | P a g e
4. Which OOP principle promotes the idea that "child classes can inherit
properties and behaviors of parent classes"?
A) Inheritance
B) Polymorphism
C) Abstraction
D) Encapsulation
Answer: A
Explanation: Inheritance allows a child class to inherit fields and methods from a parent
class, enabling code reuse and hierarchical relationships.
Answer: A
Explanation: Polymorphism allows objects of different classes to be treated as objects of
a common superclass, enabling flexibility and the ability to use one interface for different
underlying data types.
A) Abstraction
B) Encapsulation
C) Inheritance
D) Polymorphism
Answer: B
Explanation: Encapsulation involves restricting access to certain details of an object, and
the private keyword is used to hide data from outside access.
19 | P a g e
A) Using the final keyword
B) By having multiple methods with the same name but different parameter lists
C) By subclassing and overriding methods
D) By using interfaces
Answer: B
Explanation: Method overloading in Java occurs when multiple methods share the same
name but have different parameter lists. This is a form of compile-time polymorphism.
Answer: B
Explanation: Method overloading occurs when methods with the same name have
different parameters. Method overriding is when a subclass provides a specific
implementation of a method that is already defined in its parent class.
A) Method overloading
B) Operator overloading
C) Method overriding
D) Function templates
Answer: C
Explanation: Dynamic polymorphism occurs during runtime, and method overriding is a
classic example where the method call is determined dynamically based on the object
type.
10. In OOP, which of the following concepts restricts access to certain data and
methods within a class?
A) Polymorphism
B) Inheritance
20 | P a g e
C) Abstraction
D) Encapsulation
Answer: D
Explanation: Encapsulation restricts access to certain details within a class by using
access modifiers like private, protected, and public.
Answer: A
Explanation: Abstraction involves exposing only the essential characteristics of an
object and hiding the unnecessary details.
12. In OOP, the concept where objects communicate with each other by passing
messages is called:
A) Message Passing
B) Inheritance
C) Polymorphism
D) Composition
Answer: A
Explanation: Message passing in OOP refers to the process where objects interact by
invoking each other's methods, or "sending messages."
A) Improving performance
B) Code reusability
C) Better memory management
D) Faster execution of code
Answer: B
Explanation: Inheritance allows a class to reuse code from its parent class, promoting
code reuse and minimizing duplication.
21 | P a g e
14. What is "composition" in OOP?
Answer: A
Explanation: Composition is a design principle where objects are composed of other
objects, enabling code reuse without inheritance.
A) Single Inheritance
B) Multiple Inheritance
C) Hierarchical Inheritance
D) Multilevel Inheritance
Answer: B
Explanation: Multiple inheritance occurs when a class has more than one base class,
inheriting from all of them.
Answer: C
Explanation: Polymorphism allows objects of different types to be treated uniformly as
objects of a common superclass, promoting flexibility in design.
17. What is the difference between an abstract class and an interface in Java?
22 | P a g e
D) Abstract classes must implement all methods of an interface.
Answer: A
Explanation: Abstract classes can have constructors and may contain concrete methods,
while interfaces cannot have constructors and typically contain only abstract methods.
Answer: B
Explanation: The this keyword refers to the current instance of the class, and it is
commonly used to access instance variables and methods.
19. Which design principle is represented by "a class should have only one
reason to change"?
Answer: C
Explanation: The Single Responsibility Principle (SRP) states that a class should have
only one reason to change, meaning it should have only one responsibility or task.
20. Which type of relationship does the "is-a" relationship describe in OOP?
A) Inheritance
B) Encapsulation
C) Polymorphism
D) Composition
Answer: A
Explanation: The "is-a" relationship is a type of inheritance where a subclass is a
specialized version of the superclass, indicating a hierarchical relationship.
23 | P a g e
21. In C++, when is the copy constructor called?
Answer: B
Explanation: The copy constructor is called when an object is passed by value, returned
from a function by value, or initialized with another object of the same type.
Answer: C
Explanation: Abstract classes cannot be instantiated directly. They can have constructors
and static methods, and they can include final methods.
Answer: C
Explanation: Polymorphism can be achieved not only through inheritance but also
through interfaces. Dynamic binding happens when a method is called at runtime.
24. Which of the following keywords is used to restrict a class from being
inherited in Java?
A) abstract
B) final
24 | P a g e
C) static
D) private
Answer: B
Explanation: The final keyword is used to prevent a class from being inherited. A
final class cannot be subclassed.
A) "is-a"
B) "part-of"
C) "has-a"
D) "uses-a"
Answer: C
Explanation: Aggregation represents a "has-a" relationship, where one class contains a
reference to another class. It differs from composition because the contained object can
exist independently.
A) Constructor
B) Destructor
C) Copy constructor
D) Assignment operator
Answer: B
Explanation: The destructor method is automatically invoked when an object is
destroyed to release resources or perform cleanup operations.
Answer: C
Explanation: If a class has a private constructor, it cannot be instantiated from outside
the class. This is often used for implementing singleton patterns.
25 | P a g e
28. Which of the following principles suggests that a subclass should not override
the behavior of its base class in unexpected ways?
A) Open/Closed Principle
B) Liskov Substitution Principle
C) Dependency Inversion Principle
D) Interface Segregation Principle
Answer: B
Explanation: The Liskov Substitution Principle (LSP) states that objects of a superclass
should be replaceable with objects of a subclass without altering the correctness of the
program.
Answer: C
Explanation: Aggregation implies ownership, but the lifecycle of the owned object is
independent of the owner. Association is a more general term that simply indicates a
relationship between two objects.
Answer: B
Explanation: Composition represents a strong "has-a" relationship, where the lifecycle
of the composed object depends on the owner. If the owner is destroyed, the composed
object is also destroyed.
31. Which of the following statements is true about multiple inheritance in C++?
26 | P a g e
A) It is not allowed.
B) It is allowed, but creates ambiguity in function calls.
C) It is allowed, but virtual functions cannot be used.
D) It is allowed, but destructors cannot be used.
Answer: B
Explanation: Multiple inheritance is allowed in C++, but it can lead to ambiguity if the
same function is inherited from multiple base classes. This ambiguity is often resolved
using the virtual keyword.
32. Which of the following mechanisms is used to bind method calls at runtime in
Java?
A) Early binding
B) Static binding
C) Late binding
D) Compile-time binding
Answer: C
Explanation: Late binding, also known as dynamic binding, occurs when method calls
are resolved at runtime, allowing for polymorphism in Java.
33. Which design pattern ensures that a class has only one instance and provides
a global point of access to that instance?
A) Factory pattern
B) Adapter pattern
C) Singleton pattern
D) Observer pattern
Answer: C
Explanation: The Singleton pattern ensures that a class has only one instance and
provides a global point of access to that instance.
34. Which of the following concepts refers to combining data and behavior into a
single unit in OOP?
A) Inheritance
B) Encapsulation
C) Abstraction
27 | P a g e
D) Polymorphism
Answer: B
Explanation: Encapsulation is the concept of combining data (attributes) and behavior
(methods) into a single unit, typically a class, and restricting access to certain parts of the
object.
35. In C++, if a class has a virtual destructor, which of the following is true?
Answer: C
Explanation: If a base class destructor is virtual, the destructor of the derived class is
called first, followed by the base class destructor. This ensures proper cleanup when
using polymorphism.
Answer: B
Explanation: The super keyword in Java refers to the parent class and is often used to
access methods and constructors of the superclass.
37. Which of the following statements about virtual functions in C++ is true?
Answer: D
Explanation: Virtual functions allow a function in the base class to be overridden in
derived classes, and they enable dynamic polymorphism.
28 | P a g e
38. In Java, what is the primary difference between an abstract class and an
interface?
Answer: B
Explanation: An interface in Java cannot have method implementations (before Java 8),
while abstract classes can provide some method implementations.
Answer: A
Explanation: Virtual destructors are crucial in preventing memory leaks in polymorphic
inheritance by ensuring that destructors for derived classes are called correctly.
A) Code reusability
B) Runtime polymorphism
C) Compile-time error handling
D) Hierarchical representation
Answer: C
Explanation: Inheritance promotes code reusability, runtime polymorphism, and allows
41. In C++, if a class has a pure virtual function, which of the following is true?
29 | P a g e
Answer: A
Explanation: A class with a pure virtual function is considered an abstract class and
cannot be instantiated directly.
Answer: A
Explanation: Java does not support multiple inheritance through classes, but it allows
multiple inheritance via interfaces.
Answer: C
Explanation: Non-virtual functions can be overridden, but they will not exhibit
polymorphic behavior because dynamic binding occurs only with virtual functions.
Answer: C
Explanation: Association represents a relationship between two objects, but it does not
imply ownership as aggregation or composition does.
30 | P a g e
45. What is the role of the final keyword in method overriding in Java?
Answer: A
Explanation: The final keyword prevents a method from being overridden in derived
classes.
A) Open/Closed Principle
B) Dependency Inversion Principle
C) Liskov Substitution Principle
D) Interface Segregation Principle
Answer: C
Explanation: The Liskov Substitution Principle states that subclasses should be able to
replace their base classes without affecting the program’s correctness. Relying on internal
details violates this principle.
Answer: D
Explanation: Interfaces cannot contain instance variables. They can only have constants
(implicitly public static final).
48. Which of the following design patterns restricts the instantiation of a class to
one object?
A) Singleton Pattern
31 | P a g e
B) Factory Pattern
C) Observer Pattern
D) Strategy Pattern
Answer: A
Explanation: The Singleton Pattern ensures that only one instance of a class exists and
provides a global point of access to that instance.
A) __new__()
B) __del__()
C) __init__()
D) __call__()
Answer: C
Explanation: The __init__() method in Python is used to initialize the state of an
object when the object is created.
Answer: A
Explanation: In composition, the composed objects cannot exist independently of the
container object, while in aggregation, the contained object can exist independently.
32 | P a g e
Answer: A
Explanation: A private constructor prevents instantiation of the class from outside the
class. This is often used in Singleton Pattern implementations.
A) Defining multiple methods in a class with the same name but different parameter lists.
B) Defining multiple methods in a class with different names but identical parameter
lists.
C) Defining multiple methods in a class that perform similar tasks.
D) Redefining a method in a subclass with the same name as in the superclass.
Answer: A
Explanation: Method overloading allows multiple methods in a class to have the same
name, provided they differ in their parameter lists.
Answer: B
Explanation: The super() function is used to call a method from the parent class in
Python, allowing access to inherited methods.
54. What is the result of calling the clone() method on an object in Java?
Answer: A
Explanation: The clone() method creates a shallow copy of the object. It copies field
values directly, but does not copy objects that are referred to by those fields.
33 | P a g e
55. In C++, what is the primary advantage of using virtual inheritance?
Answer: B
Explanation: Virtual inheritance is used in C++ to prevent the diamond problem by
ensuring that only one instance of a base class is shared when multiple paths of
inheritance are used.
56. Which of the following concepts does the this pointer refer to in C++?
Answer: C
Explanation: The this pointer in C++ refers to the current instance of the object within
its member functions.
57. In Java, what is the primary reason to use an interface instead of an abstract
class?
Answer: A
Explanation: Interfaces in Java allow a form of multiple inheritance, since a class can
implement multiple interfaces.
58. What is the outcome of calling a virtual method in the base class but
implemented only in the derived class in C++?
A) Compile-time error
34 | P a g e
B) The base class method will be executed.
C) The derived class method will be executed at runtime.
D) The method cannot be called at all.
Answer: C
Explanation: If the method is marked as virtual in the base class, the derived class
method will be executed due to dynamic binding at runtime.
Answer: C
Explanation: The @staticmethod decorator is used to define methods that don’t depend
on instance or class-level data and can be called directly on the class.
Answer: B
Explanation: The Open/Closed Principle states that software entities should be open for
extension but closed for modification. Modifying a class to add new functionality violates
this principle.
35 | P a g e
Answer: A
Explanation: Composition refers to a "has-a" relationship, where one class contains
another and their lifetimes are tied.
Answer: B
Explanation: Inheritance is used to share common attributes and behaviors between
related classes, promoting code reuse.
A) Method Overloading
B) Method Overriding
C) Operator Overloading
D) Composition
Answer: D
Explanation: Composition is a design principle for object relationships, not an example
of polymorphism.
Answer: B
Explanation: Encapsulation is the practice of hiding an object’s internal state and
ensuring it is accessed only through well-defined methods.
65. In which of the following scenarios would you prefer composition over
inheritance?
A) When the derived class needs to inherit all behaviors from the base class.
B) When you want to create a flexible system that can be easily modified.
C) When the relationship between the classes is hierarchical.
D) When you need to enforce a strict "is-a" relationship.
36 | P a g e
Answer: B
Explanation: Composition is preferred when you want to create flexible systems that can
be modified or extended without affecting the existing code, as it favors "has-a"
relationships.
66. Which of the following design principles does the Adapter Pattern violate if
not used correctly?
Answer: B
Explanation: If the Adapter Pattern is not implemented correctly, it may lead to a
situation where a subclass does not properly substitute the base class, violating the Liskov
Substitution Principle.
67. In C++, which of the following can be a reason to use a friend class?
37 | P a g e
69. Which of the following describes the term "Encapsulation"?
Answer: B
Explanation: An interface in C# can inherit from another interface, allowing for a
hierarchy of interfaces. However, it cannot contain fields, constructors, or static methods.
Answer: A
Explanation: Abstract classes cannot be instantiated, which enforces a specific design
structure and allows the definition of methods that must be implemented by derived
classes.
72. Which principle is primarily violated if a class has too many responsibilities?
A) Open/Closed Principle
B) Interface Segregation Principle
C) Single Responsibility Principle
D) Liskov Substitution Principle
38 | P a g e
Answer: C
Explanation: The Single Responsibility Principle states that a class should have only one
reason to change, meaning it should only have one responsibility. Violating this leads to
classes that are harder to maintain.
73. In C++, what is the difference between public inheritance and protected
inheritance?
A) Public inheritance allows derived classes to access base class members; protected
inheritance does not.
B) Protected inheritance restricts the visibility of base class members to the derived class
only.
C) Public inheritance exposes base class members to all classes, while protected
inheritance exposes them only to derived classes.
D) There is no difference; both serve the same purpose.
Answer: C
Explanation: Public inheritance allows base class members to be accessible by all
classes, while protected inheritance restricts access to derived classes only.
74. In which situation would you utilize the Factory Method design pattern?
A) When you need to create instances of a class with varying configuration settings.
B) When a class should be able to change its behavior at runtime.
C) When you need to restrict the instantiation of a class.
D) When you want to enforce a strict inheritance hierarchy.
Answer: A
Explanation: The Factory Method pattern is used when a class cannot anticipate the
class of objects it must create and relies on subclasses to handle the instantiation process,
allowing for varying configurations.
Web/Application Development:
o HTML5/CSS and Javascript o HTTP/HTTPS, AJAX and REST APIs (get, post,
put, delete).
o Cookies o Version control systems like Git for source code management.
39 | P a g e
1. Which of the following is NOT a valid HTML5 element for handling
multimedia?
A) <audio>
B) <video>
C) <track>
D) <sound>
Answer: D
Explanation: The <sound> tag is not a valid HTML5 tag. HTML5 uses <audio> and
<video> to embed multimedia content.
A) display
B) position
C) z-index
D) float
Answer: C
Explanation: The z-index property controls the vertical stacking order of elements that
overlap due to relative or absolute positioning.
Answer: C
Explanation: box-sizing: border-box ensures that the padding and border are
included within the element’s specified width and height.
40 | P a g e
C) $.post('api/delete', {type: 'DELETE'})
D) $.put('api/delete')
Answer: A
Explanation: The $.ajax() method with type: 'DELETE' is the correct way to make a
DELETE request using jQuery.
A) POST
B) GET
C) PUT
D) DELETE
Answer: B
Explanation: The GET method is used to retrieve data from the server without making
any changes to the resource or causing side effects.
Answer: A
Explanation: HTTPS uses SSL/TLS to encrypt data transmitted between the client and
the server, while HTTP transmits data in plaintext.
41 | P a g e
Answer: C
Explanation: REST is an architectural style for designing networked applications,
focusing on stateless communication, typically over HTTP.
A) POST
B) PUT
C) DELETE
D) Both B and C
Answer: D
Explanation: Both PUT and DELETE are idempotent methods because they can be called
multiple times without changing the result beyond the initial application.
A) 200 OK
B) 201 Created
C) 403 Forbidden
D) 599 Invalid Request
Answer: D
Explanation: There is no HTTP status code 599. Common status codes include 200, 201,
and 403, but 599 is not part of the standard.
Answer: B
Explanation: CORS allows a server to specify which external domains are allowed to
make cross-origin requests to resources on the server.
42 | P a g e
11. What is the main difference between PUT and POST methods in REST
APIs?
Answer: B
Explanation: PUT is idempotent (calling it multiple times will not change the result
beyond the initial request), while POST is not.
A) Promises
B) Callbacks
C) Async/Await
D) All of the above
Answer: D
Explanation: Promises, callbacks, and async/await are all mechanisms in JavaScript that
allow for asynchronous code execution without blocking the main thread.
A) document.setCookie = "name=value";
B) document.cookie = "name=value;";
C) document.cookie("name", "value");
D) cookie.create("name", "value");
Answer: B
Explanation: In JavaScript, cookies are set by assigning a string to document.cookie in
the format "name=value".
43 | P a g e
14. What is the purpose of the SameSite attribute in HTTP cookies?
Answer: B
Explanation: The SameSite attribute controls whether the cookie can be sent with cross-
site requests, providing protection against CSRF attacks.
15. Which of the following Git commands is used to retrieve changes from a
remote repository without merging?
A) git fetch
B) git pull
C) git clone
D) git push
Answer: A
Explanation: git fetch retrieves changes from a remote repository without merging
them into the local branch. You can merge them manually afterward.
16. In Git, what does the command git reset --hard do?
A) Reverts the working directory to a previous commit but keeps changes in the staging
area.
B) Moves the current branch to a specific commit and discards all working directory
changes.
C) Deletes the local repository.
D) Updates the remote repository with local changes.
Answer: B
Explanation: git reset --hard moves the branch to a specific commit and removes
all changes in the working directory and staging area.
44 | P a g e
17. Which of the following is NOT a valid status for a Git file?
A) Untracked
B) Modified
C) Deleted
D) Excluded
Answer: D
Explanation: Git tracks file statuses such as untracked, modified, and deleted, but
"excluded" is not a valid Git status.
18. In RESTful services, which response code is used to indicate that a request
has succeeded, but no content is returned?
A) 204 No Content
B) 200 OK
C) 202 Accepted
D) 201 Created
Answer: A
Explanation: A 204 No Content status is returned when the request is successful, but
there is no data to return in the response.
A) Secure flag
B) HttpOnly flag
C) SameSite attribute
D) __Secure prefix
Answer: D
Explanation: The __Secure- prefix is used to ensure that the cookie is sent only over
secure (HTTPS) connections, enhancing security.
45 | P a g e
20. Which of the following CSS techniques is used to center an element
horizontally inside a parent container?
A) position: absolute;
B) margin-left: auto; margin-right: auto;
C) display: inline-block;
D) float: center;
Answer: B
Explanation: margin-left: auto; margin-right: auto; is the standard CSS
technique to center block elements horizontally inside a parent container.
21. Which of the following HTML5 APIs is used to handle user media, such as
camera or microphone?
A) WebRTC API
B) MediaStream API
C) Canvas API
D) WebSockets API
Answer: B
Explanation: The MediaStream API allows web applications to access and manipulate
media streams, such as video or audio from the user's camera or microphone.
22. Which of the following is TRUE about the async attribute in HTML5 <script>
tags?
A) It ensures that the script is executed only after the page is fully loaded.
B) It ensures the script is loaded asynchronously with the rest of the page.
C) It blocks HTML parsing until the script is loaded and executed.
D) It forces the script to load synchronously with other external resources.
Answer: B
Explanation: The async attribute allows the script to load asynchronously while the
HTML continues to parse, and it gets executed as soon as it is ready.
23. In CSS, how would you apply styles to an element with an attribute data-
role="admin"?
A) data-role[admin] { ... }
B) [data-role="admin"] { ... }
46 | P a g e
C) .data-role.admin { ... }
D) #data-role.admin { ... }
Answer: B
Explanation: The correct CSS syntax to target an element based on an attribute value is
[attribute="value"], hence [data-role="admin"].
24. Which of the following best describes the concept of "event delegation" in
JavaScript?
Answer: B
Explanation: Event delegation refers to attaching a single event listener to a parent
element to handle events triggered by child elements, improving performance.
25. Which of the following HTTP headers is used to control caching in modern
web browsers?
A) Authorization
B) Cache-Control
C) Access-Control-Allow-Origin
D) Content-Type
Answer: B
Explanation: The Cache-Control header is used to define caching policies, such as no-
store, no-cache, private, and public.
26. In the context of RESTful web services, what does the term "stateless" mean?
A) The server does not store any information about the client’s request between calls.
B) The client must provide credentials on each request to maintain state.
C) The server keeps a record of the client’s session.
D) The client sends encrypted tokens to maintain a session state.
47 | P a g e
Answer: A
Explanation: Statelessness in REST means that each request from a client to the server
must contain all the information necessary to understand and complete the request,
without relying on stored information on the server.
27. Which of the following is an advantage of using GET over POST in an AJAX
request?
Answer: A
Explanation: GET requests are idempotent, meaning that multiple identical requests have
the same effect as a single request, whereas POST requests are not.
28. In a RESTful API, which of the following HTTP status codes represents a
successful PATCH operation?
A) 200 OK
B) 204 No Content
C) 202 Accepted
D) 201 Created
Answer: A
Explanation: The 200 OK status code indicates that the PATCH request was successful,
and the resource was modified.
A) JSON.encode()
B) JSON.stringify()
C) JSON.parse()
D) Object.serialize()
48 | P a g e
Answer: B
Explanation: JSON.stringify() converts a JavaScript object or value into a JSON
string, while JSON.parse() converts a JSON string into a JavaScript object.
30. Which of the following Git commands is used to discard changes in the
working directory?
A) git stash
B) git reset
C) git clean
D) git checkout -- .
Answer: D
Explanation: The command git checkout -- . discards all changes in the working
directory, reverting to the last committed state.
A) HttpOnly
B) SameSite
C) Domain
D) SecureSocket
Answer: D
Explanation: SecureSocket is not a valid property for HTTP cookies. Valid properties
include HttpOnly, SameSite, Domain, Path, Secure, and Max-Age.
32. Which of the following best describes AJAX (Asynchronous JavaScript and
XML)?
Answer: B
Explanation: AJAX enables web pages to send and receive data asynchronously (in the
background) without reloading the entire webpage.
49 | P a g e
33. In JavaScript, what is the primary difference between synchronous and
asynchronous code execution?
Answer: A
Explanation: Synchronous code is executed sequentially, while asynchronous code (like
promises or async/await) runs after the current call stack is cleared.
Answer: B
Explanation: The HEAD method retrieves the headers of a resource (metadata) without
the response body, making it useful for checking response information before
downloading.
35. Which of the following Git commands is used to combine multiple commits
into one?
A) git merge
B) git rebase
C) git cherry-pick
D) git squash
Answer: B
Explanation: git rebase can be used to combine multiple commits into one during the
interactive rebase process, while git merge integrates changes from different branches.
50 | P a g e
36. What is the function of a "cookie" in HTTP communication?
Answer: B
Explanation: Cookies are small pieces of data sent by a server to store information on
the client side and maintain session state between HTTP requests.
37. In HTML5, which of the following is used to manage local, persistent storage
in the browser?
A) Cookies
B) SessionStorage
C) LocalStorage
D) File API
Answer: C
Explanation: LocalStorage allows websites to store data persistently in the browser,
which remains after the browser is closed and reopened.
Answer: A
Explanation: The .gitignore file specifies which files and directories should be
ignored by Git, preventing them from being tracked or committed.
A) POST
B) DELETE
C) PATCH
51 | P a g e
D) PUT
Answer: D
Explanation: PUT is idempotent, meaning multiple identical requests will result in the
same resource state. POST and PATCH are not idempotent, while DELETE is conditionally
idempotent.
40. Which of the following CSS properties is used to create rounded corners for
an element?
A) border-radius
B) corner-shape
C) border-style
D) box-shadow
Answer: A
Explanation: The border-radius property is used to create rounded corners on
elements in CSS.
41. Which of the following properties in CSS helps achieve a flex container's
child element alignment along the cross-axis?
A) align-content
B) justify-content
C) align-items
D) flex-direction
Answer: C
Explanation: align-items defines how flex container children are aligned along the
cross-axis (perpendicular to the main axis).
42. In JavaScript, what is the primary difference between null and undefined?
A) null represents a variable that has not been declared, while undefined represents a
declared but uninitialized variable.
B) undefined is assigned by the JavaScript engine, while null is assigned by the
programmer.
C) null is a primitive type, while undefined is an object type.
D) Both null and undefined behave the same way in all scenarios.
52 | P a g e
Answer: B
Explanation: undefined is automatically assigned to variables declared without
initialization, while null is an intentional assignment to represent "no value."
Answer: C
Explanation: git reflog records all movements of HEAD, even those that are no
longer part of any branch or are otherwise unreachable.
Answer: B
Explanation: event.preventDefault() is used to prevent the default behavior of the
event, such as stopping a form submission or link redirection.
45. In REST APIs, which of the following HTTP methods is considered safe and
idempotent?
A) POST
B) PATCH
C) GET
D) DELETE
Answer: C
Explanation: GET is both safe and idempotent. Safe means it doesn't alter the state of the
resource, and idempotent means repeating the request gives the same result.
53 | P a g e
46. In JavaScript, which of the following best describes the call() method?
Answer: B
Explanation: call() allows you to invoke a function and explicitly set the this context
for that function, with arguments passed individually.
47. Which of the following HTML5 input types is used to capture a URL?
A) input type="url"
B) input type="web"
C) input type="text"
D) input type="link"
Answer: A
Explanation: The input type="url" allows users to input and validate a URL.
Answer: B
Explanation: git cherry-pick allows you to select a specific commit from one branch
and apply it to your current branch.
49. Which of the following is true about the fetch() method in JavaScript when
performing an HTTP request?
54 | P a g e
C) It only supports GET and POST methods for making requests.
D) It is a deprecated method for AJAX requests.
Answer: B
Explanation: The fetch() method returns a promise that resolves to the response of the
HTTP request, which can then be processed.
50. Which of the following is TRUE about the same-origin policy for HTTP
cookies?
Answer: B
Explanation: The same-origin policy restricts web pages from accessing cookies that
do not share the same origin (same domain, protocol, and port).
51. In RESTful APIs, which HTTP status code is returned when a requested
resource is not found?
Answer: C
Explanation: The 404 Not Found status code indicates that the server cannot find the
requested resource.
52. In CSS, how would you select all paragraph elements that are direct children
of a div element?
A) div p { ... }
B) div > p { ... }
C) div ~ p { ... }
D) div + p { ... }
55 | P a g e
Answer: B
Explanation: The > selector is used to select direct children, so div > p selects all p
elements that are direct children of a div.
53. Which of the following best describes the purpose of the Strict-Transport-
Security (HSTS) header in HTTP?
Answer: A
Explanation: The HSTS header enforces HTTPS for future requests to the domain,
ensuring secure connections.
Answer: B
Explanation: An IIFE is a function expression that is immediately invoked after its
definition. It’s wrapped in parentheses followed by ().
Answer: B
Explanation: git tag is used to mark a specific commit with a reference (such as
v1.0), often to signify releases.
56 | P a g e
56. Which of the following is TRUE about POST requests in REST APIs?
Answer: C
Explanation: POST requests are used to create a new resource on the server and are not
idempotent (repeating the request may create additional resources).
Answer: B
Explanation: CORS allows servers to define which origins are permitted to access
resources on the server, controlling cross-origin requests.
Answer: B
Explanation: The reduce() method applies a function to each array element,
accumulating a single result from the operation.
57 | P a g e
59. Which HTTP header is used to control browser caching behavior for
responses?
A) Authorization
B) Cache-Control
C) Set-Cookie
D) ETag
Answer: B
Explanation: Cache-Control is used to specify caching policies for both requests and
responses, controlling how browsers cache data.
60. Which of the following CSS Grid properties is used to define the number of
rows and columns in a grid layout?
A) grid-template
B) grid-template-areas
C) grid-template-rows and grid-template-columns
D) grid-gap
Answer: C
Explanation: The properties grid-template-rows and grid-template-columns are
used to define the structure of the grid layout, specifying the number of rows and
columns. While grid-template is a shorthand, specifying rows and columns
individually with these two properties gives more explicit control.
58 | P a g e
Software Engineering:
o Basic Software Testing Concepts (Black Box Testing, White Box Testing,
Unit/Integration/Regression Testing, and UAT).
1. Which SDLC model is most suitable when requirements are uncertain and
subject to frequent changes?
A) Waterfall Model
B) V-Model
C) Agile Model
D) Spiral Model
Answer: C
Explanation: The Agile model is iterative and allows frequent changes, making it ideal
for projects with dynamic requirements.
A) Requirement Analysis
B) Design Phase
C) Coding Phase
D) Testing Phase
Answer: B
Explanation: The design phase involves system and software design based on gathered
requirements, forming the blueprint for the system's architecture.
A) Unit Testing
B) Black Box Testing
C) Refactoring
D) Regression Testing
59 | P a g e
Answer: C
Explanation: Refactoring is the process of improving code without changing its
functionality, not a testing technique.
4. Which design pattern ensures a class has only one instance and provides a
global point of access to it?
A) Factory Pattern
B) Singleton Pattern
C) Observer Pattern
D) Prototype Pattern
Answer: B
Explanation: The Singleton pattern ensures that a class has only one instance and
provides a global access point to that instance.
5. In which SDLC phase are Unit, Integration, and System testing performed?
A) Deployment Phase
B) Maintenance Phase
C) Testing Phase
D) Design Phase
Answer: C
Explanation: The Testing phase of the SDLC involves different levels of testing such as
unit, integration, and system testing.
Answer: B
Explanation: The Open/Closed Principle states that software entities should be open to
extension but closed to modification, promoting flexible and maintainable code.
60 | P a g e
7. Which type of testing focuses on evaluating the internal structure of the
application?
Answer: B
Explanation: White Box Testing involves testing the internal structure and workings of
an application, unlike Black Box Testing, which focuses on functionality.
8. In the context of SDLC, which term refers to reviewing code to improve its
structure without changing its behavior?
A) Refactoring
B) Debugging
C) Regression Testing
D) Integration Testing
Answer: A
Explanation: Refactoring is the process of restructuring existing code to improve its
readability, efficiency, or maintainability without altering its functionality.
Answer: C
Explanation: The Factory pattern defines an interface for creating objects and lets
subclasses decide which class to instantiate.
Answer: C
Explanation: Regression Testing ensures that new code or modifications do not
negatively impact existing functionalities.
11. Which of the following testing methods is most appropriate for testing the
application's functionality without knowing its internal structure?
Answer: B
Explanation: Black Box Testing evaluates the functionality of the application without
any knowledge of the underlying code or architecture.
A) Factory Pattern
B) Bridge Pattern
C) Adapter Pattern
D) Strategy Pattern
Answer: B
Explanation: The Bridge pattern decouples the abstraction from its implementation,
allowing them to evolve independently.
62 | P a g e
Answer: A
Explanation: The Dependency Inversion Principle states that high-level modules should
not depend on low-level modules but rather on abstractions.
14. Which phase of the SDLC typically involves activities such as code
walkthroughs, code reviews, and unit testing?
A) Coding Phase
B) Deployment Phase
C) Maintenance Phase
D) Requirement Gathering Phase
Answer: A
Explanation: The Coding phase involves the actual development of the software,
including code reviews, unit testing, and implementation of logic.
15. Which testing approach divides the application into logical modules and
verifies that each one functions correctly when integrated?
A) Unit Testing
B) System Testing
C) Integration Testing
D) Regression Testing
Answer: C
Explanation: Integration Testing checks how different modules of the application
interact and function together as a complete system.
16. What type of testing is done to ensure that a fix or enhancement has not
broken any other parts of the system?
A) Unit Testing
B) Regression Testing
C) White Box Testing
D) UAT
Answer: B
Explanation: Regression Testing ensures that a recent code change or bug fix hasn't
adversely affected existing functionalities.
63 | P a g e
17. Which design pattern is commonly used to represent a group of objects as a
single object?
A) Singleton Pattern
B) Composite Pattern
C) Observer Pattern
D) Decorator Pattern
Answer: B
Explanation: The Composite pattern allows treating individual objects and compositions
of objects uniformly by representing a group of objects as a single entity.
Answer: C
Explanation: UAT stands for User Acceptance Testing, which is done by the end-users
to verify if the system meets their requirements.
19. Which principle of SOLID states that a class should have one and only one
reason to change?
Answer: A
Explanation: The Single Responsibility Principle (SRP) ensures that a class should have
only one reason to change, making the code easier to maintain.
A) Open/Closed Principle
64 | P a g e
B) Liskov Substitution Principle
C) DRY (Don't Repeat Yourself) Principle
D) Interface Segregation Principle
Answer: C
Explanation: DRY (Don't Repeat Yourself) is a software engineering principle but not
one of the five SOLID principles.
21. Which SDLC model is best suited for handling very complex projects where
risk analysis is a crucial step?
A) Waterfall Model
B) V-Model
C) Spiral Model
D) Agile Model
Answer: C
Explanation: The Spiral Model is designed to manage complex projects and includes
risk assessment at every iteration, making it ideal for high-risk projects.
22. In which SDLC phase is the feasibility of the project evaluated based on
resources, time, and cost?
Answer: C
Explanation: The Planning phase assesses the feasibility of a project in terms of
available resources, time, and budget.
65 | P a g e
Answer: C
Explanation: The Liskov Substitution Principle ensures that subclasses can be
substituted for their base classes without altering the correctness of the program.
24. Which of the following is a key benefit of using the Prototype design pattern?
Answer: C
Explanation: The Prototype pattern is used to clone objects, reducing the cost of creating
new instances, particularly when the instantiation is expensive.
25. Which of the following testing levels focuses on testing the entire integrated
application to ensure it meets the business requirements?
A) Unit Testing
B) System Testing
C) Integration Testing
D) Acceptance Testing
Answer: B
Explanation: System Testing evaluates the entire application to ensure that it meets both
functional and non-functional requirements.
A) Requirement Gathering
B) Maintenance
C) Testing
D) Design and Development
Answer: D
Explanation: In Agile, the Design and Development phase is iterated multiple times in
short cycles, allowing for incremental delivery of functionality.
66 | P a g e
27. Which type of testing is primarily concerned with the validation of the non-
functional aspects of an application, such as performance, scalability, and
security?
A) Functional Testing
B) Non-Functional Testing
C) Unit Testing
D) User Acceptance Testing
Answer: B
Explanation: Non-Functional Testing focuses on aspects like performance, reliability,
and security rather than just functionality.
Answer: C
Explanation: The Adapter pattern allows incompatible interfaces to work together by
providing a wrapper class to adapt one interface to another.
29. In which SDLC phase is a product put into a real-world environment and
users begin using it for its intended purpose?
A) Testing Phase
B) Deployment Phase
C) Maintenance Phase
D) Requirement Gathering Phase
Answer: B
Explanation: The Deployment phase involves releasing the product to the customer,
where it is put into a real-world environment for use.
30. Which design principle helps avoid breaking the code by ensuring that a class
or module should have only one reason to change?
67 | P a g e
A) Single Responsibility Principle (SRP)
B) Open/Closed Principle (OCP)
C) Interface Segregation Principle (ISP)
D) Liskov Substitution Principle (LSP)
Answer: A
Explanation: The Single Responsibility Principle (SRP) ensures that a class should have
only one reason to change, which makes the code easier to maintain and less error-prone.
A) Integration Testing
B) Unit Testing
C) System Testing
D) Acceptance Testing
Answer: A
Explanation: Integration Testing evaluates the interaction between different modules or
components in a system to verify that they work together as expected.
32. In SOLID principles, which principle suggests that clients should not be
forced to depend on methods they do not use?
Answer: D
Explanation: The Interface Segregation Principle (ISP) recommends that a client should
not depend on interfaces it does not use, promoting smaller, more focused interfaces.
68 | P a g e
Answer: B
Explanation: Dependency Injection helps decouple the instantiation of objects from the
classes that use them, making code more modular and testable.
34. Which of the following SDLC models emphasizes documentation and rigid
structure, making it less adaptable to changes during development?
A) Agile Model
B) Waterfall Model
C) V-Model
D) Spiral Model
Answer: B
Explanation: The Waterfall model is linear and documentation-heavy, making it difficult
to incorporate changes once development begins.
A) Observer Pattern
B) Strategy Pattern
C) Adapter Pattern
D) Composite Pattern
Answer: B
Explanation: The Strategy pattern defines a family of algorithms, encapsulates each one,
and allows them to be interchangeable without altering the client that uses them.
36. Which type of testing ensures that each individual unit of the software works
as intended, typically conducted by developers?
A) System Testing
B) Unit Testing
C) Integration Testing
D) Regression Testing
Answer: B
Explanation: Unit Testing involves testing individual units or components of the
software to ensure that they perform as expected.
69 | P a g e
37. Which of the following is NOT a benefit of the Agile development process?
Answer: B
Explanation: Agile is characterized by flexibility, adaptability, and customer
collaboration, in contrast to rigid adherence to an initial plan.
38. Which of the following design patterns is useful for converting the interface
of a class into another interface that clients expect?
A) Factory Pattern
B) Adapter Pattern
C) Singleton Pattern
D) Observer Pattern
Answer: B
Explanation: The Adapter Pattern allows a class to be used by converting its interface
into a compatible one expected by clients.
Answer: B
Explanation: The Observer pattern allows multiple objects (observers) to listen for
updates from a subject and respond accordingly.
70 | P a g e
40. In which SDLC model are development and testing phases carried out
simultaneously?
A) Waterfall Model
B) V-Model
C) Agile Model
D) Iterative Model
Answer: B
Explanation: In the V-Model, development and testing activities are performed in
parallel, ensuring validation at each stage of development.
Databases:
A) Durability ensures that once a transaction commits, changes are lost if the system
crashes.
B) Isolation ensures that multiple transactions occurring at the same time are independent
of each other.
C) Consistency ensures that the database is left in an inconsistent state after a transaction.
D) Atomicity ensures that a transaction can be partially completed.
Answer: B
Explanation: Isolation ensures that the operations of one transaction are isolated from
others, preventing interference between concurrent transactions. Consistency ensures the
database remains consistent before and after the transaction, while Durability guarantees
persistence of the transaction once committed, even in the event of a crash.
A) Denormalization
B) Joins
C) Indexing
D) Normalization
71 | P a g e
Answer: D
Explanation: Normalization is the process of organizing data to reduce redundancy and
improve data integrity, typically by dividing large tables into smaller ones and defining
relationships between them.
A) Primary Key
B) Foreign Key
C) Strong Entity Set
D) Ternary Relationship
Answer: C
Explanation: A weak entity set cannot be uniquely identified by its own attributes alone
and must be associated with a strong entity set via a foreign key.
4. Which type of key is used to uniquely identify tuples in a table but cannot
serve as the primary key?
A) Candidate Key
B) Foreign Key
C) Composite Key
D) Alternate Key
Answer: D
Explanation: An alternate key is a candidate key that is not chosen as the primary key
but can still uniquely identify tuples in the table.
5. Which of the following types of joins will return all rows from the left table,
along with matched rows from the right table, and NULLs for non-matched
rows?
A) Inner Join
B) Left Outer Join
C) Right Outer Join
D) Full Outer Join
72 | P a g e
Answer: B
Explanation: A Left Outer Join returns all records from the left table and the matching
rows from the right table. If there is no match, NULL values are returned for the right
table.
A) 1NF
B) 2NF
C) 3NF
D) BCNF
Answer: B
Explanation: 2NF eliminates partial dependencies (where a non-key attribute depends on
part of a composite primary key) but does not eliminate transitive dependencies. 3NF
removes transitive dependencies.
A) 1NF
B) 2NF
C) 3NF
D) BCNF
Answer: A
Explanation: 1NF (First Normal Form) requires that all attributes contain only atomic
(indivisible) values, and that each attribute value is unique.
Answer: B
Explanation: A clustered index rearranges the rows of the table in the order of the index.
73 | P a g e
A table can only have one clustered index, but it provides faster read performance for
ordered data.
Answer: C
Explanation: BCNF ensures that every determinant is a candidate key, but it does not
eliminate all redundancy. Some functional dependencies might still exist.
Answer: B
Explanation: A Foreign Key ensures referential integrity by linking two tables, ensuring
that the value in one table corresponds to a valid record in another.
11. Which of the following SQL statements is used to change the structure of an
existing database table?
A) INSERT
B) UPDATE
C) ALTER
D) SELECT
Answer: C
Explanation: The ALTER command is used to modify the structure of an existing table,
such as adding, deleting, or modifying columns.
74 | P a g e
12. Which type of join is most likely to return the Cartesian product of two tables
if no join condition is specified?
A) Inner Join
B) Outer Join
C) Natural Join
D) Cross Join
Answer: D
Explanation: A Cross Join returns the Cartesian product of two tables, meaning every
row in the first table is combined with every row in the second table.
13. Which of the following types of SQL constraints ensures that a column
cannot accept NULL values?
A) UNIQUE
B) CHECK
C) NOT NULL
D) PRIMARY KEY
Answer: C
Explanation: The NOT NULL constraint ensures that a column cannot have NULL values.
It is commonly used with the PRIMARY KEY constraint.
14. What does the term "referential integrity" in a relational database refer to?
Answer: B
Explanation: Referential integrity ensures that foreign key values in one table match the
primary key values in another, preventing orphaned records.
15. Which of the following is a property of the 3rd Normal Form (3NF) in
databases?
75 | P a g e
B) No non-key attribute is transitively dependent on the primary key.
C) Every table must contain a composite key.
D) Every functional dependency is preserved.
Answer: B
Explanation: 3NF requires that there are no transitive dependencies, meaning no non-
key attribute is dependent on another non-key attribute.
16. Which SQL command is used to remove a table from the database entirely?
A) DELETE
B) TRUNCATE
C) REMOVE
D) DROP
Answer: D
Explanation: The DROP command is used to remove a table (or other database objects)
entirely from the database. DELETE removes rows, and TRUNCATE removes all rows but
retains the table structure.
A) One-to-One
B) One-to-Many
C) Many-to-Many
D) Self-Referencing
Answer: B
Explanation: In a One-to-Many relationship, the primary key from the "one" side
becomes a foreign key in the "many" side table to maintain referential integrity.
76 | P a g e
Answer: B
Explanation: Indexing improves data retrieval speed by creating a data structure that
allows for faster search and query execution.
19. Which SQL operation is used to combine two or more SELECT queries and
return the distinct rows that result?
A) UNION ALL
B) JOIN
C) INTERSECT
D) UNION
Answer: D
Explanation: The UNION operation combines the result sets of two or more SELECT
queries, returning distinct rows. UNION ALL returns all rows, including duplicates.
A) INDEX
B) CONSTRAINT
C) DEFAULT
D) CHECK
Answer: C
Explanation: The DEFAULT keyword sets a default value for a column if no explicit value
is provided during the insert operation.
Answer: C
Explanation: Clustered indexes physically rearrange the data in the table to match the
index, which can increase I/O operations during inserts and updates since rows may need
to be shifted.
77 | P a g e
22. Which of the following statements is true regarding deferred constraints in a
relational database?
Answer: C
Explanation: Deferred constraints can be checked after a transaction completes instead
of after every DML operation, allowing for batch validation.
23. What is the result of applying the Third Normal Form (3NF) but not Boyce-
Codd Normal Form (BCNF)?
Answer: C
Explanation: 3NF eliminates transitive dependencies, but BCNF ensures that every
determinant is a candidate key. If 3NF is applied without BCNF, anomalies can still
occur due to non-candidate key dependencies.
Answer: C
Explanation: A composite key is required when two or more attributes together can
uniquely identify a record in a table.
78 | P a g e
25. What is the primary risk of denormalizing a database to improve query
performance?
Answer: B
Explanation: Denormalization introduces redundancy, which can lead to data
inconsistency because updates need to be made in multiple places.
Answer: B
Explanation: A trigger automatically executes a predefined action when a specified
event (like INSERT, UPDATE, or DELETE) occurs on a table.
27. Which join type will exclude unmatched rows from both participating tables?
A) Left Join
B) Right Join
C) Full Outer Join
D) Inner Join
Answer: D
Explanation: An Inner Join returns only the rows that have matching values in both
tables, excluding unmatched rows from both sides.
A) INSERT
B) DELETE
79 | P a g e
C) JOIN
D) SELECT
Answer: C
Explanation: A highly normalized database often has many tables and foreign key
relationships, leading to more complex and slower JOIN operations, especially if large
datasets are involved.
Answer: C
Explanation: When a deadlock is detected, the system selects one of the transactions as
the victim and rolls it back, allowing the other to proceed.
30. In which case would a database use a bitmap index over a B-tree index?
Answer: B
Explanation: Bitmap indexes are efficient when a column has a small number of distinct
values (low cardinality), as they store bits to represent rows that satisfy a condition.
31. In a transaction where multiple SQL statements are executed, what does the
term write-ahead logging refer to?
80 | P a g e
Answer: C
Explanation: Write-ahead logging ensures that changes are written to a log before being
applied to the actual database, allowing recovery in case of failure.
Answer: B
Explanation: Stored procedures can increase maintenance complexity since logic is
embedded within the database, which may require version control and more effort to
update and manage.
A) Consistent transactions
B) Serializable transactions
C) Committed transactions
D) Atomic transactions
Answer: B
Explanation: Serializable transactions must appear to execute in isolation from other
transactions to avoid interference, ensuring the highest level of isolation.
Answer: B
Explanation: Incorrect functional dependencies can lead to anomalies such as update,
insert, or delete anomalies, causing inconsistencies in the database.
81 | P a g e
35. In an ER diagram, how is a total participation of an entity set in a relationship
represented?
Answer: B
Explanation: Total participation is represented by a double line between the entity set
and the relationship in an ER diagram, indicating that every entity in the set must
participate in the relationship.
36. Which isolation level in SQL allows for dirty reads but prevents lost updates?
A) Serializable
B) Repeatable Read
C) Read Committed
D) Read Uncommitted
Answer: D
Explanation: Read Uncommitted allows dirty reads (reading uncommitted data from
another transaction), but it prevents lost updates by ensuring that each write is visible
immediately.
37. Which of the following best describes shadow paging in database recovery
techniques?
Answer: C
Explanation: Shadow paging keeps a copy (shadow) of the database, reflecting the state
before the transaction, ensuring that the original pages are not overwritten until the
transaction completes.
82 | P a g e
38. Which of the following types of constraints is used to limit the range of values
a column can take in a relational database?
A) CHECK
B) NOT NULL
C) UNIQUE
D) PRIMARY KEY
Answer: A
Explanation: The CHECK constraint is used to limit the range or values a column can
hold, ensuring that the data meets specific conditions.
39. Which normalization form (NF) eliminates all partial and transitive
dependencies, ensuring that every non-key attribute depends only on the
primary key?
A) 1NF
B) 2NF
C) 3NF
D) BCNF
Answer: C
Explanation: 3NF eliminates all partial and transitive dependencies, ensuring that every
non-key attribute is directly dependent on the primary key.
40. Which of the following correctly describes a phantom read in the context of
transaction isolation levels?
Answer: B
Explanation: A phantom read occurs when a new row is inserted by another transaction,
and subsequent reads by the original transaction return different results.
83 | P a g e
Basic questions based on different types of web
application attacks like:
o Tree Traversal strategies like Breadth and Depth First Search o Questions
based on Data Structures with code snippets
▪ DDL, DML and TCL commands ▪ Basic of SQL Functions ▪ Views, Triggers
and Cursors o Monolith vs Microservice architecture.
Answer: B
Explanation: XSS involves injecting malicious scripts into websites, which are then
executed in the victim's browser, potentially leading to data theft or session hijacking.
Answer: C
Explanation: Anti-CSRF tokens are unique tokens included in forms that verify a
84 | P a g e
request is legitimate and prevent attackers from making unauthorized requests on behalf
of users.
Answer: B
Explanation: SQL injection involves injecting malicious SQL code into a query,
enabling attackers to manipulate databases, exfiltrate data, or bypass authentication.
4. Which tree traversal strategy visits nodes in the following order: left subtree,
node, right subtree?
A) Pre-order
B) In-order
C) Post-order
D) Level-order
Answer: B
Explanation: In-order traversal visits nodes in the order of left subtree, current node, and
right subtree, often used for binary search trees (BSTs).
Answer: B
Explanation: DDoS attacks involve multiple compromised machines flooding a server
with traffic to make it unavailable to legitimate users.
85 | P a g e
6. Which data structure is best suited for implementing Breadth-First Search
(BFS) traversal of a graph?
A) Stack
B) Queue
C) Hash Table
D) Linked List
Answer: B
Explanation: BFS uses a queue to explore nodes level by level in a graph or tree, visiting
all neighbors of a node before moving deeper.
A) Public-key encryption uses the same key for both encryption and decryption.
B) Private-key encryption is faster but less secure than public-key encryption.
C) Public-key encryption uses two different keys, one for encryption and one for
decryption.
D) Private-key encryption is used for digital signatures only.
Answer: C
Explanation: Public-key encryption uses a pair of keys: a public key for encryption and
a private key for decryption, offering a secure communication method.
8. Which of the following is not a member of the OWASP Top 10 web application
security risks?
A) Injection Attacks
B) Sensitive Data Exposure
C) Insecure Deserialization
D) Password Brute Force Attack
Answer: D
Explanation: Password brute force attacks are not specifically listed in the OWASP Top
10, although related issues such as broken authentication are addressed.
A) CREATE
B) ALTER
86 | P a g e
C) UPDATE
D) DROP
Answer: C
Explanation: UPDATE is a DML (Data Manipulation Language) command, used for
modifying data, while CREATE, ALTER, and DROP are DDL commands used for defining or
modifying database structure.
10. Which of the following database objects can store compiled code that is
automatically executed in response to certain events?
A) View
B) Index
C) Trigger
D) Cursor
Answer: C
Explanation: A trigger contains compiled code that executes automatically when a
specified event, such as an insert, update, or delete, occurs on a table.
11. Which of the following is the primary benefit of using digital signatures?
Answer: B
Explanation: Digital signatures ensure that the data comes from a verified source
(authenticity) and that it has not been altered (integrity).
87 | P a g e
Answer: C
Explanation: In microservice architecture, each service is an independent unit, modular,
and can be deployed independently without affecting other services.
13. Which type of tree traversal guarantees that the nodes of a binary search tree
(BST) are visited in ascending order?
A) Pre-order
B) Post-order
C) In-order
D) Level-order
Answer: C
Explanation: In-order traversal of a binary search tree visits nodes in ascending order
because it processes the left subtree, the current node, and then the right subtree.
14. What type of attack is primarily mitigated by input validation and prepared
statements?
Answer: B
Explanation: SQL injection attacks can be mitigated by using input validation and
prepared statements, which prevent attackers from injecting malicious SQL queries.
A) INSERT
B) CREATE
C) GRANT
D) DROP
Answer: A
Explanation: INSERT is a DML command used to add data into a database table. CREATE
88 | P a g e
and DROP are DDL commands, while GRANT is a DCL (Data Control Language)
command.
Answer: C
Explanation: Symmetric-key encryption is faster and more efficient for encrypting large
datasets since it uses the same key for both encryption and decryption.
17. Which SQL clause is used to filter results based on a condition applied after
grouping?
A) WHERE
B) GROUP BY
C) HAVING
D) ORDER BY
Answer: C
Explanation: The HAVING clause is used to filter records after a GROUP BY operation,
whereas WHERE is used before grouping.
18. In the context of cryptography, what is the primary function of a public key?
A) To encrypt data that can only be decrypted by the corresponding private key.
B) To decrypt data that was encrypted using the corresponding private key.
C) To generate a symmetric key.
D) To sign digital certificates.
Answer: A
Explanation: In public-key cryptography, the public key is used to encrypt data, which
can only be decrypted by the holder of the corresponding private key.
89 | P a g e
19. Which of the following is true about a cursor in SQL?
Answer: B
Explanation: A cursor allows row-by-row processing of query results, which is useful
for operations that require iteration over result sets.
20. Which of the following is the least likely threat in a monolithic architecture
compared to a microservices architecture?
Answer: B
Explanation: Service-to-service communication vulnerabilities are more common in
micro
21. Which of the following techniques can prevent Cross-Site Scripting (XSS)
attacks?
A) Input validation
B) Enabling HTTP Strict Transport Security (HSTS)
C) Using HTTP cookies for authentication
D) Regularly updating server software
Answer: A
Explanation: Input validation is crucial for preventing XSS attacks by ensuring that any
data sent to the server is properly sanitized to remove potentially harmful scripts.
22. In the context of web applications, what does the Same-Origin Policy
enforce?
A) Only requests from the same domain can access resources on that domain.
B) Only secure HTTPS requests are allowed.
C) Cookies must be sent over encrypted connections.
90 | P a g e
D) Users must authenticate with a username and password.
Answer: A
Explanation: The Same-Origin Policy restricts web pages from making requests to a
different domain than the one that served the web page, preventing certain types of
attacks like XSS.
23. Which HTTP method is idempotent and can be safely retried without causing
side effects?
A) POST
B) GET
C) DELETE
D) PUT
Answer: B
Explanation: The GET method is idempotent, meaning multiple identical requests
should have the same effect as a single request, making it safe to retry.
Answer: A
Explanation: AJAX (Asynchronous JavaScript and XML) allows web applications to
send and retrieve data asynchronously without interfering with the display and behavior
of the existing page.
91 | P a g e
Answer: B
Explanation: The SameSite attribute helps mitigate CSRF attacks by controlling how
cookies are sent in cross-origin requests, enhancing security.
26. What does REST stand for in the context of web services?
Answer: B
Explanation: REST stands for Representational State Transfer, an architectural style for
designing networked applications using standard HTTP methods.
Answer: B
Explanation: The command git branch <branch_name> is used to create a new
branch in the repository. The command git checkout -b <branch_name> also creates
and switches to a new branch.
Answer: B
Explanation: Black Box Testing focuses on testing the functionality of an application
based on its specifications without any knowledge of the internal code structure.
92 | P a g e
29. Which design pattern is used to define a one-to-many dependency between
objects so that when one object changes state, all its dependents are notified and
updated automatically?
A) Factory Pattern
B) Observer Pattern
C) Singleton Pattern
D) Adapter Pattern
Answer: B
Explanation: The Observer Pattern establishes a one-to-many relationship between
objects, allowing multiple observers to be notified of changes in the subject's state.
30. What are the ACID properties in the context of database transactions?
Answer: A
Explanation: The ACID properties ensure reliable processing of database transactions:
Atomicity ensures all-or-nothing execution, Consistency ensures valid state changes,
Isolation prevents interference between transactions, and Durability guarantees that
committed transactions remain permanent.
Answer: A
Explanation: A well-normalized database minimizes redundant data, ensuring data
integrity and reducing the risk of anomalies.
93 | P a g e
32. Which of the following is NOT a common type of SQL join?
A) INNER JOIN
B) OUTER JOIN
C) CROSS JOIN
D) SELECT JOIN
Answer: D
Explanation: SELECT JOIN is not a recognized type of SQL join. The common types are
INNER JOIN, OUTER JOIN (which includes LEFT, RIGHT, and FULL), and CROSS
JOIN.
Answer: C
Explanation: A Brute Force Attack involves systematically guessing a user's password
until the correct one is found.
Answer: C
Explanation: Prepared statements prevent SQL injection attacks by separating SQL code
from data, ensuring that user input is treated as data only, not executable code.
94 | P a g e
35. Which of the following is an example of a Denial of Service (DoS) attack?
Answer: A
Explanation: A Denial of Service (DoS) attack aims to make a service unavailable by
overwhelming it with excessive requests.
36. Which of the following is true regarding Depth-First Search (DFS) traversal
of a graph?
Answer: B
Explanation: DFS explores as deeply as possible down one branch before backtracking,
utilizing a stack or recursion.
37. Which encryption method involves a single key for both encryption and
decryption?
A) Asymmetric encryption
B) Symmetric encryption
C) Hashing
D) Digital signatures
Answer: B
Explanation: Symmetric encryption uses the same key for both encryption and
decryption, allowing for faster processing than asymmetric encryption.
95 | P a g e
38. In a RESTful API, which HTTP status code indicates that the request was
successful and that the server has created a new resource?
A) 200 OK
B) 201 Created
C) 204 No Content
D) 400 Bad Request
Answer: B
Explanation: The status code 201 Created indicates that the request was successful and a
new resource has been created.
Answer: D
Explanation: Triggers are automatically invoked by specific events (like inserts, updates,
or deletes) and cannot be called directly from application code.
Answer: B
Explanation: Microservices commonly communicate using synchronous HTTP requests
(or asynchronous messaging) to interact with each other while remaining independent.
96 | P a g e
D) Service unavailability due to overwhelming requests.
Answer: A
Explanation: CSRF allows an attacker to trick an authenticated user into unknowingly
submitting a request, potentially leading to unauthorized actions.
Answer: B
Explanation: An API Gateway acts as a single entry point, handling requests and routing
them to the appropriate microservice, simplifying client interactions.
Answer: B
Explanation: Digital Signatures provide a way to verify the authenticity and integrity of
a message or document, ensuring it hasn't been tampered with.
A) DELETE TABLE
B) DROP TABLE
C) REMOVE TABLE
D) CLEAR TABLE
Answer: B
Explanation: The DROP TABLE command is used to delete a table and all its data from
the database permanently.
97 | P a g e
45. Which of the following vulnerabilities allows an attacker to execute arbitrary
SQL code on a database?
Answer: B
Explanation: SQL Injection attacks occur when an attacker is able to manipulate SQL
queries by injecting malicious input, allowing arbitrary code execution on the database.
46. In the context of tree traversal, which algorithm guarantees visiting each
node at least once?
Answer: C
Explanation: Both BFS and DFS algorithms visit each node at least once during their
traversal of a tree or graph structure.
Answer: C
Explanation: Normalization reduces redundancy and helps maintain data integrity by
organizing data in a way that minimizes duplication and potential anomalies.
98 | P a g e
48. Which HTTP status code indicates that the server cannot or will not process
the request due to something that is perceived to be a client error?
A) 200 OK
B) 400 Bad Request
C) 403 Forbidden
D) 404 Not Found
Answer: B
Explanation: The 400 Bad Request status code indicates that the server cannot process
the request due to a client error, such as malformed syntax.
Answer: B
Explanation: A View provides a way to create a virtual table that presents data from one
or more tables based on a specific query, simplifying complex queries for users.
50. Which of the following attacks can be mitigated using prepared statements in
SQL?
A) Denial of Service
B) SQL Injection
C) Cross-Site Scripting (XSS)
D) Brute Force Attack
Answer: B
Explanation: Prepared statements help prevent SQL Injection by separating SQL code
from user input, ensuring that the input is treated as data rather than executable code.
99 | P a g e
51. Which of the following design patterns provides a way to create an object
without specifying the exact class of object that will be created?
A) Factory Pattern
B) Singleton Pattern
C) Decorator Pattern
D) Observer Pattern
Answer: A
Explanation: The Factory Pattern allows for the creation of objects without specifying
the exact class of the object, promoting loose coupling in code.
Answer: B
Explanation: DDoS attacks involve multiple compromised systems (often part of a
botnet) flooding the target with traffic, making it unavailable to legitimate users.
53. In a REST API, what does the POST method primarily accomplish?
Answer: C
Explanation: The POST method is used to create a new resource on the server, often
sending data in the body of the request.
Answer: C
Explanation: Cookies are typically created on the server side and sent to the client,
which can then store them for subsequent requests.
55. What type of testing involves verifying the individual components of the
software for correctness?
A) Integration Testing
B) Unit Testing
C) System Testing
D) Acceptance Testing
Answer: B
Explanation: Unit Testing focuses on verifying the correctness of individual components
or functions within the software.
56. In the context of asymmetric encryption, which key is used for encryption?
A) Public Key
B) Private Key
C) Shared Key
D) Session Key
Answer: A
Explanation: In asymmetric encryption, the Public Key is used to encrypt data, while the
Private Key is used for decryption.
Answer: B
Explanation: The Observer pattern establishes a one-to-many dependency between
objects, allowing one object to notify multiple dependents of state changes.
101 | P a g e
58. In an SQL database, what does the term "foreign key" refer to?
Answer: B
Explanation: A foreign key is a field (or collection of fields) in one table that uniquely
identifies a row of another table, establishing a relationship between the two tables.
Answer: C
Explanation: Indexes are used to enhance the speed of data retrieval operations on a
database table by providing quick access paths to the data.
A) CHANGE
B) MODIFY
C) UPDATE
D) SET
Answer: C
Explanation: The UPDATE command is used to modify existing records in a table in a
database.
102 | P a g e
2.Infra Support
o I/O Scheduling algorithms (FCFS, SSTF, SCAN, LOOK, CSCAN, CLOOK etc.)
A) exec()
B) fork()
C) kill()
D) wait()
Answer: B
Explanation: The fork() system call is used to create a new process in UNIX-like
operating systems. It creates a child process that runs concurrently with the parent
process.
A) FIFO
B) LRU
C) Optimal Page Replacement
D) Clock Algorithm
103 | P a g e
Answer: C
Explanation: The Optimal Page Replacement algorithm theoretically provides the fewest
page faults but is difficult to implement because it requires future knowledge of page
references.
Answer: B
Explanation: In SJF scheduling, longer jobs may suffer from starvation because shorter
jobs are always prioritized.
A) Preemption
B) No mutual exclusion
C) Circular wait
D) Unlimited resources
Answer: C
Explanation: Deadlock requires four conditions, one of which is a circular wait, where
each process is waiting for a resource held by another process in the set.
Answer: C
Explanation: The exec() system call replaces the current process image with a new
program, effectively running a new executable within the same process.
104 | P a g e
6. In which of the following scheduling algorithms does the CPU allocate the time
slice to processes in a cyclic order?
A) FCFS
B) SJF
C) Round Robin
D) Priority Scheduling
Answer: C
Explanation: In the Round Robin scheduling algorithm, each process is given a fixed
time slice (or quantum) and processes are cycled through until they complete execution.
A) Paging
B) Segmentation
C) Contiguous Memory Allocation
D) Swapping
Answer: A
Explanation: Paging divides memory into fixed-sized blocks called pages and allocates
them to processes without requiring contiguous memory allocation.
8. Which page replacement algorithm selects the page that has not been used for
the longest period of time?
A) FIFO
B) LRU
C) Optimal Page Replacement
D) Clock Algorithm
Answer: B
Explanation: The Least Recently Used (LRU) algorithm replaces the page that has not
been used for the longest time.
A) Circular wait
105 | P a g e
B) Preemption
C) Starvation
D) Infinite loops
Answer: A
Explanation: Circular wait is one of the four necessary conditions for a deadlock to
occur, where processes form a cycle and each process is waiting for a resource held by
another process in the cycle.
Answer: C
Explanation: Threads within the same process share the same memory space, including
global variables, but each thread has its own program counter and stack.
11. What is the main disadvantage of the FIFO page replacement algorithm?
Answer: C
Explanation: The FIFO page replacement algorithm can suffer from Belady's anomaly,
where adding more frames increases the number of page faults.
A) Pipes
B) Message Queues
C) Shared Memory
D) Sockets
106 | P a g e
Answer: A
Explanation: Pipes allow bidirectional communication between parent and child
processes, making them a common IPC mechanism in UNIX-based systems.
13. Which of the following is NOT a valid strategy for handling deadlocks?
Answer: D
Explanation: Deadlock acceleration is not a valid strategy. The other three—detection
and recovery, prevention, and even ignorance—are legitimate strategies for managing
deadlocks.
14. Which of the following I/O scheduling algorithms moves the disk arm
towards the end of the disk and then reverses direction, serving requests along
the way?
A) FCFS
B) SSTF
C) SCAN
D) LOOK
Answer: C
Explanation: The SCAN (or elevator) algorithm moves the disk arm towards one end of
the disk, serving requests, then reverses direction and continues servicing requests in the
opposite direction.
A) Paging
B) Segmentation
C) Virtual Memory
D) Contiguous Memory Allocation
107 | P a g e
Answer: C
Explanation: Virtual Memory allows the execution of processes that are not completely
in memory, by loading pages into memory as needed.
16. Which page replacement algorithm uses a circular list of pages and a "use"
bit to track page references?
A) FIFO
B) LRU
C) Clock Algorithm
D) Optimal Page Replacement
Answer: C
Explanation: The Clock Algorithm, also known as the Second Chance Algorithm, uses a
circular list of pages and a "use" bit to track whether a page has been recently accessed.
A) Semaphores
B) Mutex locks
C) Spinlocks
D) Monitors
Answer: C
Explanation: Spinlocks achieve mutual exclusion by busy waiting, where a process
continuously checks for a condition, consuming CPU cycles until it can enter its critical
section.
A) A condition where too many processes are using too much CPU time.
B) A condition where the system spends most of its time swapping pages in and out of
memory.
C) A situation where I/O devices are overwhelmed with requests.
D) A scenario where processes are stuck in a circular wait.
108 | P a g e
Answer: B
Explanation: Thrashing occurs when a system is spending most of its time swapping
pages in and out of memory rather than executing processes.
19. Which of the following CPU scheduling algorithms has the shortest average
waiting time in the case where all processes arrive simultaneously?
A) FCFS
B) SJF (Non-preemptive)
C) Round Robin
D) Priority Scheduling
Answer: B
Explanation: SJF (Shortest Job First) minimizes the average waiting time when all
processes arrive at the same time by executing the shortest jobs first.
20. What happens if there is a page fault in a system using virtual memory?
Answer: B
Explanation: In virtual memory, a page fault occurs when the requested page is not in
main memory. The operating system swaps the page from secondary storage (such as a
hard disk) into main memory.
21. Which of the following conditions must be present for a system to experience
thrashing?
Answer: C
Explanation: Thrashing occurs when the combined working set of all processes exceeds
the available physical memory, causing excessive paging and low CPU utilization.
109 | P a g e
22. Which type of memory is used by the operating system to improve access
speed to frequently accessed data?
A) Main memory
B) Cache memory
C) Virtual memory
D) Secondary storage
Answer: B
Explanation: Cache memory is used by the operating system to store frequently accessed
data to speed up access time, as it is much faster than main memory.
23. Which of the following page replacement algorithms does NOT suffer from
Belady’s anomaly?
A) FIFO
B) LRU
C) Optimal Page Replacement
D) Second Chance
Answer: B
Explanation: LRU (Least Recently Used) page replacement algorithm does not suffer
from Belady’s anomaly, unlike FIFO.
24. In which situation is an inverted page table more efficient than a traditional
page table?
Answer: A
Explanation: Inverted page tables are more efficient in systems with large address
spaces because they use less memory by mapping the physical pages to virtual addresses,
reducing overhead.
110 | P a g e
25. Which of the following techniques is most suitable for managing a deadlock
situation when resources are preemptible?
Answer: D
Explanation: If resources are preemptible, resource preemption can be used to break
deadlocks by reallocating resources to waiting processes.
26. Which memory management scheme uses both segmentation and paging for
efficient memory utilization?
A) Pure Paging
B) Pure Segmentation
C) Segmented Paging
D) Contiguous Memory Allocation
Answer: C
Explanation: Segmented paging combines the benefits of both segmentation and paging,
allowing variable-length segments to be divided into fixed-size pages, improving
memory utilization.
27. Which of the following is NOT a goal of the CPU scheduling algorithm?
A) Maximizing throughput
B) Minimizing turnaround time
C) Minimizing CPU utilization
D) Minimizing waiting time
Answer: C
Explanation: The goal of a CPU scheduling algorithm is to maximize CPU utilization,
not minimize it. It aims to ensure the CPU is used as efficiently as possible.
111 | P a g e
28. Which of the following is an advantage of a multilevel feedback queue over a
multilevel queue in CPU scheduling?
Answer: B
Explanation: In a multilevel feedback queue, processes can move between queues based
on their behavior, and each queue can have a different time quantum, making it more
flexible than a multilevel queue.
29. Which I/O scheduling algorithm is a variant of SCAN but stops once it
reaches the last request in one direction?
A) LOOK
B) SSTF
C) CSCAN
D) FCFS
Answer: A
Explanation: The LOOK algorithm is a variant of SCAN, but instead of going to the end
of the disk, it only goes as far as the last request in each direction before reversing.
30. In which scenario is preemptive CPU scheduling more effective than non-
preemptive CPU scheduling?
Answer: C
Explanation: Preemptive scheduling is more effective in systems where processes have
different priorities or varying execution times because higher-priority processes can
preempt lower-priority ones.
112 | P a g e
31. Which page replacement algorithm uses the "use bit" and a circular queue to
approximate LRU behavior?
A) FIFO
B) Clock Algorithm
C) Optimal Page Replacement
D) LFU
Answer: B
Explanation: The Clock Algorithm is an approximation of the LRU page replacement
algorithm. It uses a circular queue and a "use bit" to decide which page to replace.
Answer: A
Explanation: The primary drawback of the Banker's algorithm is that it is
computationally expensive and inefficient for a large number of processes and resources.
Answer: B
Explanation: Each thread has its own program counter, allowing it to execute
independently. However, threads share the same memory space but do not share stacks.
113 | P a g e
34. In UNIX-based systems, which system call is used to send a signal to another
process?
A) fork()
B) kill()
C) exec()
D) wait()
Answer: B
Explanation: The kill() system call is used to send a signal to a process in UNIX-
based operating systems, which can be used for terminating or handling processes.
35. Which of the following types of memory can be accessed directly by the CPU?
A) Cache memory
B) Secondary storage
C) Virtual memory
D) Tertiary storage
Answer: A
Explanation: Cache memory is the fastest memory type and can be directly accessed by
the CPU to speed up the execution of frequently used instructions.
36. In operating systems, which type of page table organization uses a two-level
hierarchy for virtual memory address translation?
Answer: D
Explanation: A multilevel page table uses a hierarchy of page tables, with each level
providing further details on the memory mapping, improving memory management in
large address spaces.
114 | P a g e
37. Which CPU scheduling algorithm gives priority to processes with the shortest
burst time remaining?
A) FCFS
B) SJF
C) SRTF
D) Round Robin
Answer: C
Explanation: Shortest Remaining Time First (SRTF) gives priority to processes that
have the shortest remaining burst time, preempting the CPU if a process with a shorter
burst arrives.
A) Fragmentation
B) Inefficient for large address spaces
C) High memory overhead
D) High page fault rate
Answer: A
Explanation: Contiguous memory allocation can lead to fragmentation, as memory is
allocated in fixed blocks, and gaps may form between processes, leading to inefficient
memory usage.
39. Which page replacement algorithm minimizes the number of page faults, but
is not feasible to implement in practice?
A) FIFO
B) Optimal Page Replacement
C) LRU
D) Clock Algorithm
Answer: B
Explanation: The Optimal Page Replacement algorithm minimizes page faults by
replacing the page that will not be used for the longest period of time, but it is not
feasible to implement because future page references cannot be predicted.
115 | P a g e
40. Which of the following I/O scheduling algorithms always goes in one
direction across the disk and jumps back to the beginning when it reaches the
end?
A) SSTF
B) LOOK
C) CSCAN
D) FCFS
Answer: C
Explanation: CSCAN (Circular SCAN) is an I/O scheduling algorithm that services
requests in one direction and, when it reaches the end, it jumps back to the beginning to
start servicing again.
41. Which of the following scheduling algorithms allows for a process to execute
for a fixed time slice and then be re-queued if it has not finished?
Answer: C
Explanation: Round Robin (RR) scheduling allocates a fixed time quantum to each
process. If a process doesn't finish within its time slice, it is placed back in the queue for
execution.
Answer: A
Explanation: In multilevel queue scheduling, if there is a fixed priority system,
processes in lower-priority queues may suffer starvation if high-priority processes
constantly occupy the CPU.
116 | P a g e
43. Which of the following synchronization primitives uses a busy-wait
mechanism?
A) Mutex
B) Semaphores
C) Condition variables
D) Spinlocks
Answer: D
Explanation: Spinlocks are synchronization mechanisms where a thread repeatedly
checks whether it can acquire a lock, hence busy-waiting.
Answer: C
Explanation: A monolithic kernel lacks modularity because all the kernel services are
integrated into one large process, making it harder to maintain and extend.
45. Which CPU scheduling algorithm is more likely to exhibit the "convoy
effect," where shorter processes wait for a longer process to finish?
A) FCFS
B) SRTF
C) RR
D) Multilevel Queue Scheduling
Answer: A
Explanation: The "convoy effect" occurs in FCFS scheduling when short processes wait
for a long process to complete before they can run.
117 | P a g e
46. Which of the following is true about preemptive scheduling in comparison to
non-preemptive scheduling?
A) Preemptive scheduling does not allow higher priority processes to interrupt lower
priority ones.
B) Preemptive scheduling can result in more context switches.
C) Preemptive scheduling leads to lower CPU utilization.
D) Preemptive scheduling has no effect on the turnaround time.
Answer: B
Explanation: Preemptive scheduling allows higher-priority processes to preempt running
processes, which can lead to more context switches and increased CPU overhead.
47. Which page replacement algorithm could theoretically lead to fewer page
faults than LRU but is difficult to implement due to its need to know future page
references?
A) FIFO
B) Optimal Page Replacement
C) Clock Algorithm
D) NRU (Not Recently Used)
Answer: B
Explanation: Optimal Page Replacement replaces the page that will not be used for the
longest time in the future, but it is impractical because it requires knowledge of future
page references.
48. In which type of deadlock prevention technique is the "Hold and Wait"
condition negated by ensuring processes acquire all necessary resources before
starting execution?
A) Mutual Exclusion
B) No Preemption
C) Circular Wait
D) Preemptive Scheduling
Answer: C
Explanation: The Circular Wait condition is avoided by making processes request all the
resources they need before starting execution, eliminating hold-and-wait situations.
118 | P a g e
49. Which of the following I/O scheduling algorithms provides the most optimal
throughput for disk-intensive workloads?
A) FCFS
B) SSTF
C) LOOK
D) CSCAN
Answer: B
Explanation: SSTF (Shortest Seek Time First) scheduling selects the I/O request closest
to the current disk head position, optimizing throughput for disk-intensive workloads.
50. Which of the following is the main disadvantage of using an inverted page
table in systems with large amounts of memory?
Answer: B
Explanation: Inverted page tables reduce memory overhead but use hashing for lookups,
which can lead to slower lookups due to hash collisions in systems with large memory.
51. Which type of memory allocation strategy divides memory into fixed-size
partitions?
A) Contiguous Allocation
B) Paging
C) Segmentation
D) Fixed Partitioning
Answer: D
Explanation: Fixed partitioning divides memory into fixed-size partitions, and each
partition holds a single process.
119 | P a g e
52. Which of the following page replacement algorithms may replace a page that
will be used soon and thus can suffer from "Belady's Anomaly"?
A) FIFO
B) LRU
C) Optimal Page Replacement
D) Clock Algorithm
Answer: A
Explanation: FIFO (First-In, First-Out) may exhibit "Belady’s Anomaly," where
increasing the number of frames leads to an increase in the number of page faults.
53. Which of the following system calls is used to create a new process in UNIX?
A) exec()
B) fork()
C) wait()
D) kill()
Answer: B
Explanation: The fork() system call creates a new process by duplicating the calling
process in UNIX systems.
54. Which memory management technique allows for processes to be larger than
the available physical memory?
A) Segmentation
B) Paging
C) Virtual Memory
D) Contiguous Memory Allocation
Answer: C
Explanation: Virtual memory allows processes to be larger than the available physical
memory by using disk space as an extension of RAM.
120 | P a g e
55. Which CPU scheduling algorithm is guaranteed to have the minimum
average waiting time, assuming all processes arrive at the same time?
A) FCFS
B) SJF
C) RR
D) Priority Scheduling
Answer: B
Explanation: Shortest Job First (SJF) scheduling minimizes the average waiting time if
all processes arrive at the same time.
56. Which of the following memory management techniques results in the highest
degree of fragmentation?
A) Paging
B) Segmentation
C) Contiguous Allocation
D) Virtual Memory
Answer: C
Explanation: Contiguous memory allocation can result in internal and external
fragmentation, as memory is allocated in fixed blocks, which may not always be fully
used.
57. Which of the following synchronization mechanisms ensures that only one
process can enter a critical section at a time?
A) Semaphores
B) Spinlocks
C) Mutex
D) Condition variables
Answer: C
Explanation: Mutexes (mutual exclusion locks) ensure that only one process can enter a
critical section at a time, preventing race conditions.
121 | P a g e
58. Which of the following is an example of a preemptive CPU scheduling
algorithm?
A) FCFS
B) SJF
C) Round Robin (RR)
D) Priority Scheduling (Non-Preemptive)
Answer: C
Explanation: Round Robin (RR) is a preemptive CPU scheduling algorithm where each
process is given a fixed time slice, and if it doesn’t finish, it is preempted and put back
into the ready queue.
Answer: B
Explanation: Segmentation can result in fragmentation within memory segments,
particularly external fragmentation, because segments are of varying sizes.
60. Which of the following scheduling algorithms is best suited for real-time
systems where time constraints are critical?
A) FCFS
B) SRTF
C) Priority Scheduling
D) Round Robin
Answer: C
Explanation: Priority scheduling is best suited for real-time systems where time
constraints are critical because processes with higher priorities can be executed before
lower-priority ones.
122 | P a g e
Basics of virtual machines, storage solutions, and networking
components
A) Type 1 Hypervisor
B) Type 2 Hypervisor
C) Hosted Hypervisor
D) Bare-metal Hypervisor
Answer: D
Explanation: A Bare-metal or Type 1 Hypervisor runs directly on hardware, offering
high performance as it avoids the overhead of a host OS.
Answer: B
Explanation: Virtual machines allow simplified resource management, including
memory, storage, and CPU, while ensuring isolation between virtual environments.
A) Virtual NIC
B) Virtual Switch
C) Network Bridge
D) Virtual Router
Answer: B
Explanation: A Virtual Switch acts like a physical network switch, allowing VMs on the
same host to communicate with each other and route traffic.
123 | P a g e
4. Which of the following storage architectures provides a virtualized storage
environment where multiple physical storage devices appear as a single logical
unit?
Answer: C
Explanation: Software-Defined Storage (SDS) abstracts the storage hardware, enabling
centralized control and management of multiple physical storage devices.
A) Network Virtualization
B) Full Virtualization
C) Para-Virtualization
D) Storage Virtualization
Answer: B
Explanation: Full virtualization provides an abstraction layer that enables guest OSs to
run independently of the host OS, as if they were running on physical hardware.
A) Thin Provisioning
B) Overcommitment
C) Memory Ballooning
D) Resource Pooling
Answer: C
Explanation: Memory Ballooning is a feature that reallocates memory between VMs
based on their actual needs, enabling dynamic memory management.
124 | P a g e
7. Which storage system allows for block-level access and is typically used in
enterprise environments to provide high-speed access to storage devices?
A) NAS
B) SAN
C) DAS (Direct Attached Storage)
D) Cloud Storage
Answer: B
Explanation: A SAN (Storage Area Network) provides block-level storage access,
which is faster and more suitable for performance-critical applications than NAS.
Answer: B
Explanation: VMware's vMotion allows live migration of running VMs from one
physical host to another without any downtime, facilitating maintenance and load
balancing.
A) RAID 0
B) RAID 1
C) RAID 5
D) RAID 10
Answer: C
Explanation: RAID 5 uses striping with parity to provide fault tolerance and improved
read performance, making it ideal for balancing redundancy and performance.
125 | P a g e
10. Which networking component in a virtualized environment is responsible for
handling the communication between a virtual network and a physical network?
A) Virtual NIC
B) Virtual Switch
C) Virtual Router
D) Network Bridge
Answer: D
Explanation: A Network Bridge connects the virtual network (VMs) to the physical
network, allowing communication between the two environments.
11. Which protocol is commonly used in storage solutions for block-level data
transfer over a network and is often implemented in SAN environments?
Answer: A
Explanation: iSCSI is a protocol that allows block-level data transfer over IP networks,
making it ideal for SAN environments.
12. What is the main advantage of using thin provisioning in storage systems?
Answer: C
Explanation: Thin provisioning allows more storage to be allocated to VMs than is
physically available, as only the actual used space is provisioned, optimizing storage
utilization.
126 | P a g e
13. Which virtual storage solution allows for dynamic addition of storage without
shutting down virtual machines?
A) Thin Provisioning
B) Hot Storage Swapping
C) Live Migration
D) Storage DRS (Distributed Resource Scheduler)
Answer: B
Explanation: Hot Storage Swapping allows storage devices to be added or replaced
while the system is running, ensuring minimal downtime and operational continuity.
A) VLAN Trunking
B) NAT (Network Address Translation)
C) DHCP (Dynamic Host Configuration Protocol)
D) IPsec (Internet Protocol Security)
Answer: A
Explanation: VLAN Trunking allows multiple VLANs to be carried across a single
physical network link by tagging traffic with VLAN IDs.
15. Which type of storage system stores data as objects, and is typically used in
cloud storage environments?
A) Block Storage
B) File Storage
C) Object Storage
D) SAN
Answer: C
Explanation: Object storage is used in cloud environments and stores data as objects
with metadata, providing scalability and easy access to unstructured data.
127 | P a g e
16. Which networking component in virtualized environments is responsible for
controlling traffic between different VLANs?
A) Virtual NIC
B) Virtual Router
C) Layer 2 Switch
D) Virtual Firewall
Answer: B
Explanation: A virtual router is responsible for routing traffic between different VLANs,
allowing VMs on different virtual networks to communicate.
17. Which of the following describes "spanning tree protocol" (STP) in the
context of virtual networking?
Answer: B
Explanation: Spanning Tree Protocol (STP) prevents network loops by creating a loop-
free topology, selectively disabling links as needed.
18. What is the main advantage of using a Type 2 Hypervisor over a Type 1
Hypervisor?
Answer: B
Explanation: Type 2 Hypervisors run on top of an existing operating system, making
them easier to implement and manage on personal computers, although they have more
overhead than Type 1 hypervisors.
128 | P a g e
19. In cloud environments, which storage type is typically used for applications
requiring low-latency access to frequently used data?
A) Archive Storage
B) SSD (Solid State Drives)
C) Object Storage
D) Tape Storage
Answer: B
Explanation: SSDs are used for low-latency, high-performance applications due to their
fast read/write speeds, making them ideal for frequently accessed data in cloud
environments.
Answer: A
Explanation: FCoE is a network protocol that allows Fibre Channel communications to
be encapsulated over Ethernet, enabling high-speed access to shared storage in virtualized
environments.
Answer: B
Explanation: The clock cycle represents the time required to complete a single operation
in the CPU, which determines how quickly the processor executes instructions.
129 | P a g e
2. Which cache memory level is closest to the CPU and typically offers the lowest
latency?
A) L1 Cache
B) L2 Cache
C) L3 Cache
D) DRAM
Answer: A
Explanation: The L1 cache is the closest to the CPU and offers the lowest latency,
making it the fastest type of cache memory, but it's usually the smallest in size.
A) Ensuring that multiple caches have the same data at the same time.
B) The ability of the cache to predict future data requests.
C) The synchronization of cache data with main memory.
D) A method to increase the size of the cache dynamically.
Answer: A
Explanation: Cache coherence refers to ensuring that all processors in a multi-core
system have a consistent view of the memory, preventing data conflicts between multiple
caches.
A) Seek Time
B) Rotational Latency
C) Read/Write Speed
D) NAND Flash Technology
Answer: D
Explanation: NAND flash technology is used in SSDs (Solid State Drives), not HDDs.
HDD performance is affected by seek time, rotational latency, and read/write speed.
130 | P a g e
5. In a CPU, what does the term "pipelining" refer to?
Answer: C
Explanation: Pipelining allows a CPU to execute multiple instructions simultaneously
by dividing the execution process into stages, with each stage handling a part of the
instruction.
A) SATA SSD
B) NVMe SSD
C) MLC SSD
D) SLC SSD
Answer: B
Explanation: NVMe SSDs use the PCIe interface, which offers significantly faster data
transfer rates compared to traditional SATA SSDs, making them ideal for high-
performance tasks.
A) Cache Controller
B) Memory Management Unit (MMU)
C) Arithmetic Logic Unit (ALU)
D) Direct Memory Access (DMA)
Answer: B
Explanation: The Memory Management Unit (MMU) is responsible for translating
virtual addresses into physical addresses, enabling efficient memory management in
modern processors.
131 | P a g e
8. What does the term "instruction-level parallelism" (ILP) refer to in CPU
architecture?
Answer: B
Explanation: Instruction-level parallelism refers to the ability of a CPU to execute
multiple instructions in parallel within a single processor cycle, improving performance.
Answer: A
Explanation: SSDs are faster than HDDs because they use flash memory and have no
moving parts, making them more reliable and efficient for high-speed data access.
10. What role does the "branch predictor" play in modern CPU architecture?
Answer: B
Explanation: The branch predictor attempts to guess the outcome of conditional
branches in the code, allowing the CPU to reduce delays caused by pipeline stalls.
132 | P a g e
11. In memory hierarchy, what is the primary purpose of the TLB (Translation
Lookaside Buffer)?
Answer: C
Explanation: The TLB speeds up the process of virtual-to-physical address translation
by caching recently used translations, improving the performance of memory accesses.
12. Which of the following factors directly influences the number of instructions
that a CPU can execute per second?
A) Cache size
B) Clock speed
C) Memory bandwidth
D) Number of I/O devices
Answer: B
Explanation: The clock speed, measured in Hertz (Hz), determines how many
instructions the CPU can execute per second, with a higher clock speed resulting in faster
instruction execution.
13. What is the primary advantage of using multi-level caches (L1, L2, L3) in
modern processors?
Answer: C
Explanation: Multi-level caches balance speed and capacity, with L1 being the fastest
but smallest, and L3 being slower but larger, thus reducing memory access latency.
133 | P a g e
14. Which of the following defines the concept of "out-of-order execution" in
CPU design?
A) The CPU executes instructions in the exact order they are written in the program.
B) The CPU reorders instructions to optimize pipeline utilization.
C) The CPU skips instructions with dependencies and returns to them later.
D) The CPU executes instructions based on priority rather than order.
Answer: B
Explanation: Out-of-order execution allows the CPU to execute instructions that are
ready, even if previous instructions are stalled, thereby optimizing the usage of the CPU
pipeline.
15. What is the primary benefit of using SRAM (Static RAM) over DRAM
(Dynamic RAM) in cache memory?
Answer: C
Explanation: SRAM is faster than DRAM because it does not need to be refreshed
periodically, making it ideal for use in cache memory where speed is critical.
Answer: B
Explanation: RISC architecture uses a simplified instruction set that allows instructions
to be executed in fewer clock cycles, leading to higher performance in certain
applications.
134 | P a g e
17. What is the primary difference between synchronous and asynchronous
DRAM?
Answer: B
Explanation: Synchronous DRAM operates in sync with the system clock, while
asynchronous DRAM does not rely on a clock signal, leading to performance differences.
18. In the context of SSDs, what does the term "wear leveling" refer to?
A) Reducing the amount of data written to the SSD to prolong its lifespan.
B) Distributing write and erase cycles evenly across all memory cells.
C) Increasing the read/write speed of the SSD.
D) Adjusting the size of memory blocks dynamically based on usage.
Answer: B
Explanation: Wear leveling is a technique used in SSDs to distribute write and erase
cycles evenly across all memory cells, thereby extending the lifespan of the SSD.
19. Which of the following memory types is used to store the BIOS or UEFI
firmware in a computer?
A) SRAM
B) DRAM
C) ROM
D) Flash Memory
Answer: D
Explanation: Flash memory is used to store BIOS or UEFI firmware in modern
computers as it is non-volatile and can be updated when necessary.
135 | P a g e
20. What is the primary benefit of using a CPU with Hyper-Threading
technology?
Answer: B
Explanation: Hyper-Threading allows a single CPU core to execute multiple threads
simultaneously, improving the CPU’s ability to handle parallel tasks efficiently.
1. Which type of backup only stores changes made since the last backup,
regardless of whether it was full or incremental?
A) Full Backup
B) Differential Backup
C) Incremental Backup
D) Synthetic Backup
Answer: C
Explanation: An incremental backup only stores the changes made since the last backup
of any type (full or incremental), resulting in smaller backups but slower recovery times.
Answer: B
Explanation: Snapshot-based backups capture the entire state of the file system at a
specific moment, allowing for quick backups without interrupting system operations.
136 | P a g e
3. In a Unix/Linux system, which command is commonly used for performing
incremental backups?
A) cp
B) tar
C) rsync
D) dd
Answer: C
Explanation: rsync is commonly used for incremental backups as it only transfers and
synchronizes the differences between source and destination directories.
4. Which backup strategy ensures that no more than one day's worth of data can
be lost in case of a failure?
A) Incremental Backup
B) Differential Backup
C) Daily Full Backup
D) RAID 5 Backup
Answer: C
Explanation: A daily full backup ensures that, in the worst case, only one day's worth of
data is lost because a complete backup is made every day.
A) top
B) chkconfig
C) aide
D) iptables
Answer: C
Explanation: aide (Advanced Intrusion Detection Environment) is a tool used for
monitoring file integrity by creating and comparing snapshots of system files, ensuring
compliance with security standards.
137 | P a g e
6. In Windows systems, what is the purpose of the Volume Shadow Copy Service
(VSS)?
Answer: B
Explanation: VSS allows the creation of snapshots (shadow copies) of files, even while
they are in use, enabling consistent backups without stopping services.
Answer: B
Explanation: Journaling file systems like ext3 or ext4 log every transaction to a journal,
allowing for quick recovery in case of a system crash.
Answer: B
Explanation: Performing a full backup every day significantly increases storage space
requirements, making it less efficient compared to incremental or differential backups.
138 | P a g e
9. In a disaster recovery plan, what does the term "Recovery Point Objective"
(RPO) refer to?
Answer: C
Explanation: RPO refers to the maximum amount of data that can be lost after a disaster,
typically measured in time (e.g., if RPO is 24 hours, data from the last 24 hours can be
lost).
A) tar
B) rsync
C) scp
D) dd
Answer: B
Explanation: rsync is commonly used for creating backups and syncing files over a
network efficiently, as it transfers only the changes made to files.
11. In Windows, which of the following is a native tool used for system state
recovery and restoring Windows system files after failure?
A) System Restore
B) Windows Defender
C) Task Manager
D) BitLocker
Answer: A
Explanation: System Restore is a built-in Windows tool that can revert system files and
settings to a previous state, aiding in recovery after a failure.
139 | P a g e
12. Which of the following best describes a "hot backup"?
A) A backup made while the system is running and data is still being accessed.
B) A backup performed after shutting down all system services.
C) A backup stored offsite to protect against disasters.
D) A backup that is encrypted for added security.
Answer: A
Explanation: A hot backup is taken while the system is still running and data is actively
being accessed, unlike a cold backup, which requires services to be stopped.
13. Which of the following RAID configurations provides redundancy but does
not improve read/write performance?
A) RAID 0
B) RAID 1
C) RAID 5
D) RAID 6
Answer: B
Explanation: RAID 1 mirrors data across multiple disks for redundancy but does not
offer any performance improvements for reading or writing.
14. In Unix/Linux systems, what does the umask command control in the context
of security and compliance?
Answer: B
Explanation: The umask command controls the default file and directory permissions for
newly created files, which is crucial for ensuring proper security configurations.
140 | P a g e
15. Which type of disaster recovery site is fully operational and can immediately
take over in the event of a primary site failure?
A) Cold Site
B) Warm Site
C) Hot Site
D) Mirror Site
Answer: C
Explanation: A hot site is a fully operational recovery site that can take over
immediately after a primary site failure, minimizing downtime and data loss.
16. Which Linux command is used to check the integrity of a file system after a
crash and potentially fix errors?
A) fsck
B) chown
C) chmod
D) mount
Answer: A
Explanation: The fsck (file system check) command is used to check the integrity of a
file system and repair any issues, especially after a system crash or power failure.
17. What is the primary purpose of using a "cold site" in disaster recovery?
Answer: C
Explanation: A cold site is a backup location with the infrastructure ready (like power
and connectivity), but no active data or equipment, requiring setup before it becomes
operational.
141 | P a g e
18. In the context of security, what does "Defense in Depth" mean?
Answer: B
Explanation: Defense in Depth refers to a layered approach to security, where multiple
security measures are implemented at various levels to protect against a wide range of
threats.
A) cp
B) rsync
C) mv
D) diff
Answer: B
Explanation: rsync is used to synchronize files between two locations by only
transferring the differences, making it ideal for incremental backups.
20. Which file system in Linux is known for its journaling capabilities, providing
better data integrity during unexpected shutdowns?
A) FAT32
B) NTFS
C) ext3
D) HFS+
Answer: C
Explanation: The ext3 file system is known for its journaling capabilities, which log
changes before they are made to the file system, improving recovery after unexpected
shutdowns.
21. In a Unix/Linux system, which command is used to safely shut down the
system while ensuring all file system buffers are written to disk?
A) halt
B) shutdown
142 | P a g e
C) poweroff
D) sync
Answer: B
Explanation: The shutdown command safely stops all processes and ensures that all file
system buffers are written to disk before powering off the system.
Answer: C
Explanation: Differential backups store changes made since the last full backup,
resulting in faster restoration compared to incremental backups, which require the
restoration of multiple smaller backup files.
23. What does the "WORM" (Write Once Read Many) feature in backup
systems ensure?
Answer: C
Explanation: WORM (Write Once, Read Many) storage allows data to be written only
once, preventing any future modification, ensuring the integrity of archived data.
24. In the context of Unix/Linux, which utility is used to create a backup of the
entire disk, including the boot sector?
A) tar
B) dd
C) cpio
D) gzip
143 | P a g e
Answer: B
Explanation: The dd command is used to create raw disk images, including the boot
sector, by copying data at the block level.
25. Which method of backup is most appropriate for minimizing the backup
window in environments with large volumes of data?
A) Full Backup
B) Incremental Backup
C) Differential Backup
D) Continuous Data Protection (CDP)
Answer: D
Explanation: Continuous Data Protection (CDP) minimizes the backup window by
continuously capturing changes, providing near real-time backup and recovery without
the need for traditional scheduled backups.
26. Which type of backup retains only the most recent changes and eliminates
redundant data to reduce storage requirements?
A) Deduplicated Backup
B) Synthetic Full Backup
C) Snapshot Backup
D) Differential Backup
Answer: A
Explanation: Deduplicated backups retain only unique data, eliminating redundant
information, which significantly reduces the required storage space.
27. What does the principle of "Least Privilege" in compliance and security
controls imply?
Answer: B
Explanation: The principle of Least Privilege states that users should only be granted
144 | P a g e
permissions necessary to perform their job duties, minimizing the risk of accidental or
malicious system alterations.
28. In a RAID 5 configuration, how many disks can fail without losing data?
A) None
B) One
C) Two
D) Three
Answer: B
Explanation: RAID 5 can tolerate the failure of one disk without data loss, as the parity
information allows reconstruction of the lost data.
29. Which page replacement algorithm might result in the "Belady’s anomaly,"
where increasing the number of page frames results in more page faults?
Answer: B
Explanation: Belady's anomaly occurs with the FIFO page replacement algorithm,
where adding more page frames can lead to an increase in page faults in certain cases.
30. Which of the following Windows commands is used to initiate a full system
scan for file corruption and repair issues automatically?
A) sfc /scannow
B) chkdsk /r
C) diskpart
D) defrag
Answer: A
Explanation: The sfc /scannow command runs the System File Checker, scanning and
repairing corrupted or missing system files.
145 | P a g e
31. What type of I/O scheduling algorithm ensures that requests are serviced in
the order they arrive, without considering the location on the disk?
A) SSTF
B) SCAN
C) LOOK
D) FCFS
Answer: D
Explanation: The First-Come, First-Served (FCFS) algorithm processes I/O requests in
the order they arrive, without optimizing for disk location or minimizing seek time.
32. In Unix/Linux systems, what is the role of the "superblock" in the context of
file system recovery?
Answer: B
Explanation: The superblock contains critical information about the file system,
including its size, status, and metadata. Corruption of the superblock can lead to serious
file system issues.
33. In a Linux system, which of the following tools is most commonly used for
managing security policies, such as firewalls and packet filtering?
A) iptables
B) fsck
C) crontab
D) chkconfig
Answer: A
Explanation: iptables is the utility in Unix/Linux systems used to configure network
packet filtering, such as setting up firewalls and managing security policies.
146 | P a g e
34. Which page replacement algorithm always produces the least number of page
faults but is impossible to implement practically?
Answer: B
Explanation: The Optimal Page Replacement algorithm replaces the page that will not
be used for the longest period, but it requires future knowledge of memory accesses,
making it impossible to implement in practice.
A) Hypervisor
B) Guest OS
C) Virtual CPU
D) Virtual Memory Manager
Answer: A
Explanation: The hypervisor is responsible for managing virtual machines and enabling
them to interact with the physical hardware of the host machine.
36. Which I/O scheduling algorithm favors processes with shorter seek times and
thus may lead to starvation of requests for tracks far from the current head
position?
A) FCFS
B) SSTF
C) SCAN
D) LOOK
Answer: B
Explanation: Shortest Seek Time First (SSTF) favors processes that are closest to the
current head position but can lead to starvation for processes further away on the disk.
147 | P a g e
37. What is the main purpose of memory paging in operating systems?
Answer: C
Explanation: Memory paging allows processes to use non-contiguous memory blocks,
which helps efficiently manage RAM by loading only the required pages into memory.
38. Which of the following protocols provides encryption and security features
for backup data transmitted over the network?
A) HTTP
B) FTP
C) HTTPS
D) SCP
Answer: D
Explanation: SCP (Secure Copy Protocol) uses SSH to securely transfer files, ensuring
encryption and integrity of backup data transmitted over the network.
39. In Unix/Linux, what is the role of the rsyslog service in compliance and
security auditing?
Answer: B
Explanation: rsyslog is used to aggregate and manage log files, including forwarding
system logs to a central server for monitoring and auditing, making it an essential tool in
compliance and security auditing.
148 | P a g e
40. In a Linux system, which command would you use to check the status of
currently mounted file systems and their available storage?
A) df
B) du
C) fdisk
D) lsblk
Answer: A
Explanation: The df command reports the disk space usage of mounted file systems,
showing the available and used storage space.
3.Networking
Types of Networks (LAN, WAN, MAN etc) - Network Topologies (Ring , Mesh,
Bus, Star, etc) - Network Devices (Hub, Bridge, Routers, Gateway, etc) -
OSI Data Model, TCP/IP Model - Subnets and Supernets
Answer: B
Explanation: LANs (Local Area Networks) are networks that cover a small geographical
area, such as a single building or campus, and typically offer high data transfer speeds.
2. Which topology ensures that each device is connected to every other device,
providing high fault tolerance but requiring the most cabling?
A) Star
B) Bus
C) Ring
D) Mesh
Answer: D
Explanation: In a Mesh topology, every device is connected to every other device,
which provides high fault tolerance but requires more cabling compared to other
topologies.
149 | P a g e
3. Which network device operates at the Data Link layer of the OSI model and is
used to separate collision domains in a LAN?
A) Router
B) Hub
C) Bridge
D) Gateway
Answer: C
Explanation: A Bridge operates at the Data Link layer (Layer 2) of the OSI model and is
used to divide a network into separate collision domains, improving efficiency.
4. In which layer of the OSI model is error detection and correction primarily
handled?
A) Network Layer
B) Transport Layer
C) Data Link Layer
D) Physical Layer
Answer: C
Explanation: Error detection and correction are primarily handled at the Data Link
layer (Layer 2) of the OSI model, using mechanisms like cyclic redundancy check
(CRC).
Answer: B
Explanation: A subnet mask is used to differentiate between the network portion and
the host portion of an IP address, which helps in routing traffic within and between
subnets.
150 | P a g e
6. Which device is used to connect different types of networks together and
operates at Layer 3 (Network Layer) of the OSI model?
A) Hub
B) Switch
C) Router
D) Repeater
Answer: C
Explanation: A Router operates at Layer 3 (Network Layer) of the OSI model and is
used to connect different networks, such as a LAN and a WAN, together.
A) Connectionless communication
B) No guarantee of delivery
C) Flow control through windowing
D) Operates at the Network Layer
Answer: C
Explanation: TCP (Transmission Control Protocol) provides reliable, connection-
oriented communication, including flow control using a mechanism called windowing,
which manages data flow between sender and receiver.
Answer: B
Explanation: Subnets divide a large network into smaller segments, while supernets
(also called CIDR or Classless Inter-Domain Routing) aggregate multiple smaller
networks into one larger network.
151 | P a g e
9. Which protocol is used by network devices to exchange routing information in
a WAN and operates at the Application Layer of the OSI model?
A) OSPF
B) BGP
C) RIP
D) ICMP
Answer: B
Explanation: BGP (Border Gateway Protocol) is a protocol used to exchange routing
information between different networks in a WAN. It operates at the Application Layer
of the OSI model.
10. Which network topology can continue to function even if a single cable or
node breaks, but will fail if the central hub fails?
A) Ring
B) Mesh
C) Star
D) Bus
Answer: C
Explanation: In a Star topology, devices are connected to a central hub. If a single cable
or node fails, the network continues to function, but if the hub fails, the entire network
goes down.
11. In IPv6, what is the default length of a subnet mask (prefix length)?
A) /48
B) /56
C) /64
D) /128
Answer: C
Explanation: The default subnet prefix length in IPv6 is /64, meaning the first 64 bits
represent the network portion, and the remaining 64 bits represent the host portion.
152 | P a g e
12. Which protocol in the OSI model is responsible for ensuring reliable
communication and error recovery?
A) UDP
B) IP
C) TCP
D) ICMP
Answer: C
Explanation: TCP (Transmission Control Protocol) operates at the Transport Layer of
the OSI model and is responsible for ensuring reliable communication, including error
recovery and flow control.
13. Which OSI layer is primarily responsible for providing encryption and data
compression during data transfer?
A) Application Layer
B) Presentation Layer
C) Network Layer
D) Transport Layer
Answer: B
Explanation: The Presentation Layer (Layer 6) of the OSI model handles data
encryption, decryption, and compression to ensure that data is transmitted securely and
efficiently.
Answer: B
Explanation: A Gateway acts as a translator between different network protocols,
converting data formats to ensure communication between different systems or networks.
153 | P a g e
15. Which device operates at Layer 2 of the OSI model and creates multiple
collision domains but a single broadcast domain?
A) Hub
B) Router
C) Switch
D) Bridge
Answer: C
Explanation: A Switch operates at Layer 2 (Data Link Layer) of the OSI model and
creates separate collision domains for each connected device but maintains a single
broadcast domain.
16. Which subnet mask allows for the maximum number of hosts in a Class C IP
address?
A) 255.255.255.0
B) 255.255.255.128
C) 255.255.255.192
D) 255.255.255.224
Answer: A
Explanation: A subnet mask of 255.255.255.0 allows for 254 hosts in a Class C network,
which is the maximum number of hosts that can be supported in this class.
17. Which type of network is most suitable for connecting different branches of a
corporation located in multiple cities?
A) LAN
B) PAN
C) WAN
D) CAN
Answer: C
Explanation: A WAN (Wide Area Network) connects different branches or locations
over long distances, typically across cities or even countries, making it ideal for inter-city
corporate communication.
154 | P a g e
18. In TCP/IP networking, which of the following is responsible for routing
packets across different networks?
A) TCP
B) IP
C) DNS
D) DHCP
Answer: B
Explanation: The IP (Internet Protocol) is responsible for routing packets across
different networks by using IP addresses and routing tables.
19. In the OSI model, which layer handles routing, forwarding, and logical
addressing?
Answer: C
Explanation: The Network Layer (Layer 3) of the OSI model is responsible for logical
addressing (IP addresses), routing, and forwarding packets across different networks.
20. What is the purpose of the "Time to Live" (TTL) field in an IP header?
Answer: B
Explanation: The TTL field in an IP header limits the lifespan of a packet in the
network. It is decremented
A) 192.168.1.63
B) 192.168.1.65
C) 192.168.1.127
155 | P a g e
D) 192.168.1.128
Answer: B
Explanation: The /26 means 64 addresses (from 192.168.1.64 to 192.168.1.127). The
valid host range is from 192.168.1.65 to 192.168.1.126, as 192.168.1.64 is the network
address and 192.168.1.127 is the broadcast address.
22. Which protocol operates at Layer 4 of the OSI model and is connectionless?
A) TCP
B) ICMP
C) UDP
D) IP
Answer: C
Explanation: UDP (User Datagram Protocol) operates at the Transport Layer (Layer 4)
and is a connectionless protocol, unlike TCP which is connection-oriented.
23. Which of the following scenarios can lead to a routing loop in distance-vector
routing protocols like RIP?
A) Link-state advertisements
B) Count to infinity problem
C) Path vector instability
D) Erroneous route summarization
Answer: B
Explanation: The count to infinity problem occurs in distance-vector protocols like
RIP, where routes to a failed network increase their metric indefinitely, causing a routing
loop.
24. In IPv6, what is the prefix length for a global unicast address?
A) /48
B) /32
C) /64
D) /128
156 | P a g e
Answer: C
Explanation: In IPv6, a global unicast address typically has a prefix length of /64, which
provides a large address space for each network.
25. In which topology does every device have a direct point-to-point link to every
other device, resulting in N(N-1)/2 connections for N devices?
A) Bus
B) Star
C) Ring
D) Mesh
Answer: D
Explanation: In a full mesh topology, each device is directly connected to every other
device, leading to N(N-1)/2 connections, which ensures high redundancy.
A) BGP
B) RIP
C) OSPF
D) EIGRP
Answer: C
Explanation: OSPF (Open Shortest Path First) uses the SPF algorithm to determine
the shortest path between routers and exchange routing information.
27. What is the primary difference between a Layer 2 switch and a Layer 3
switch?
A) Layer 2 switch forwards packets based on MAC addresses, while Layer 3 switch
forwards based on IP addresses.
B) Layer 2 switch performs routing, while Layer 3 switch handles switching.
C) Layer 2 switch supports only Ethernet, while Layer 3 switch supports multiple
protocols.
D) There is no difference between the two.
157 | P a g e
Answer: A
Explanation: A Layer 2 switch forwards packets based on MAC addresses, whereas a
Layer 3 switch can route packets based on IP addresses.
28. In a supernet with the CIDR block 172.16.0.0/12, what is the total number of
host addresses available?
A) 16,384
B) 65,536
C) 1,048,576
D) 4,194,304
Answer: C
Explanation: The /12 CIDR block leaves 20 bits for the host addresses. Thus, the total
number of host addresses is 220=1,048,5762^{20} = 1,048,576220=1,048,576.
29. Which of the following OSI layers is responsible for flow control,
segmentation, and reassembly of data?
A) Data Link
B) Network
C) Transport
D) Session
Answer: C
Explanation: The Transport Layer (Layer 4) is responsible for flow control,
segmentation, and reassembly of data during transmission.
30. Which type of NAT allows multiple private IP addresses to share a single
public IP by mapping different ports?
A) Static NAT
B) Dynamic NAT
C) PAT (Port Address Translation)
D) None of the above
Answer: C
Explanation: PAT (Port Address Translation) allows multiple devices on a private
network to share a single public IP by assigning different port numbers to each
connection.
158 | P a g e
31. What is the subnet mask for a subnet with the CIDR notation /28?
A) 255.255.255.0
B) 255.255.255.128
C) 255.255.255.240
D) 255.255.255.248
Answer: C
Explanation: The /28 means the first 28 bits are used for the network, leaving 4 bits for
hosts. This corresponds to a subnet mask of 255.255.255.240.
Answer: C
Explanation: A default gateway routes traffic destined for networks outside the local
subnet to other networks, typically the internet.
A) OSPF
B) BGP
C) RIP
D) EIGRP
Answer: B
Explanation: BGP (Border Gateway Protocol) is an exterior gateway protocol
(EGP), while OSPF, RIP, and EIGRP are all interior gateway protocols (IGP).
159 | P a g e
D) They are used for experimental purposes.
Answer: B
Explanation: Class D IPv4 addresses (224.0.0.0 to 239.255.255.255) are used for
multicast communication.
35. In the OSI model, which layer handles encryption and decryption of data for
secure transmission?
A) Application Layer
B) Presentation Layer
C) Session Layer
D) Transport Layer
Answer: B
Explanation: The Presentation Layer (Layer 6) handles encryption and decryption of
data for secure communication between systems.
36. What is the function of the "checksum" field in the IPv4 header?
Answer: C
Explanation: The checksum field in the IPv4 header is used to verify the integrity of
the header data during transmission.
A) OSPF
B) RIP
C) EIGRP
D) BGP
Answer: C
Explanation: EIGRP (Enhanced Interior Gateway Routing Protocol) uses the Diffusing
Update Algorithm (DUAL) to provide faster convergence and calculate backup routes.
160 | P a g e
38. What technique does IPv6 use to allow IPv4 devices to communicate with
IPv6 devices?
A) NAT64
B) Dual Stack
C) SLAAC
D) ARP
Answer: A
Explanation: NAT64 allows IPv6 devices to communicate with IPv4 devices by
translating IPv6 addresses to IPv4 addresses and vice versa.
39. In a network with the subnet 192.168.10.0/23, how many host IP addresses
are available?
A) 256
B) 510
C) 512
D) 1024
Answer: B
Explanation: A /23 subnet provides 510 usable host addresses as 29−2=5102^9 - 2 =
51029−2=510, with 9 bits for hosts.
40. Which layer of the OSI model is responsible for end-to-end error recovery
and flow control?
A) Data Link
B) Network
C) Transport
D) Application
Answer: C
Explanation: The Transport Layer (Layer 4) is responsible for end-to-end error
recovery and flow control in data communication.
161 | P a g e
UDP, TCP, sockets and ports. - IPv4 vs IPv6 - Classless inter-domain
routing. - IP support protocols (ARP, DHCP, ICMP), Network Address
Translation (NAT) - Application layer protocols: DNS, SMTP, HTTP, FTP, etc.
- Internet Application Protocols (FTP, Telnet, SMTP, SNMP, POP3 etc).
Answer: B
Explanation: TCP (Transmission Control Protocol) is a connection-oriented protocol
that ensures reliable delivery with error-checking, retransmission, and flow control
mechanisms.
Answer: B
Explanation: The TCP three-way handshake sequence involves the client sending a
SYN packet, the server responding with a SYN-ACK, and the client confirming with an
ACK.
Answer: C
Explanation: UDP (User Datagram Protocol) is a connectionless, lightweight protocol
162 | P a g e
that provides fast transmission without built-in reliability, flow control, or congestion
control.
A) Source port
B) Destination port
C) Sequence number
D) Length
Answer: C
Explanation: The UDP header consists of the source port, destination port, length,
and checksum fields. It does not include a sequence number, unlike TCP.
A) FE80::/10
B) FC00::/7
C) FF00::/8
D) 2001::/16
Answer: A
Explanation: Link-local IPv6 addresses are in the FE80::/10 range. These addresses
are used for communication within a single network segment.
6. Which of the following IP address ranges is reserved for private use in IPv4?
A) 127.0.0.0/8
B) 169.254.0.0/16
C) 172.16.0.0/12
D) 224.0.0.0/4
Answer: C
Explanation: 172.16.0.0/12 is a range reserved for private IPv4 addresses, along with
10.0.0.0/8 and 192.168.0.0/16. The other options are reserved for special purposes.
163 | P a g e
7. Which of the following best describes Classless Inter-Domain Routing
(CIDR)?
Answer: B
Explanation: CIDR (Classless Inter-Domain Routing) allows for subnetting and
supernetting by using variable-length subnet masks, enabling more efficient use of the
IPv4 address space.
A) DNS
B) ARP
C) ICMP
D) DHCP
Answer: B
Explanation: ARP (Address Resolution Protocol) is used to map an IP address to a
MAC address on a local network.
A) POP3
B) IMAP
C) SMTP
D) FTP
Answer: C
Explanation: SMTP (Simple Mail Transfer Protocol) is responsible for transferring
email messages between mail servers. POP3 and IMAP are used by clients to retrieve
email from servers.
164 | P a g e
10. Which of the following best describes the purpose of the Time-To-Live (TTL)
field in an IP packet?
Answer: B
Explanation: The TTL (Time-To-Live) field specifies the maximum number of hops
a packet can travel through the network before being discarded, preventing routing loops.
11. Which IP support protocol is used for error reporting and network
diagnostics?
A) ARP
B) DHCP
C) ICMP
D) FTP
Answer: C
Explanation: ICMP (Internet Control Message Protocol) is used for error reporting,
network diagnostics, and tasks such as the ping operation.
12. In NAT (Network Address Translation), what is the primary purpose of Port
Address Translation (PAT)?
Answer: A
Explanation: PAT (Port Address Translation) maps multiple private IP addresses to a
single public IP by using different port numbers for each connection.
165 | P a g e
13. Which protocol dynamically assigns IP addresses to devices on a network?
A) ARP
B) DNS
C) ICMP
D) DHCP
Answer: D
Explanation: DHCP (Dynamic Host Configuration Protocol) is responsible for
dynamically assigning IP addresses to devices on a network.
14. Which field in a DNS query specifies the type of DNS record being requested,
such as A, AAAA, or MX?
A) Query Name
B) Query Class
C) Query Type
D) Query Header
Answer: C
Explanation: The Query Type field in a DNS query specifies the type of DNS record
being requested, such as A (IPv4 address), AAAA (IPv6 address), or MX (Mail
Exchange).
A) Multicast
B) Unicast
C) Anycast
D) Broadcast
Answer: D
Explanation: IPv6 does not support broadcast addresses. It only supports unicast,
multicast, and anycast addresses.
166 | P a g e
16. What is the maximum number of subnets that can be created with the CIDR
block 192.168.1.0/28?
A) 4
B) 6
C) 8
D) 16
Answer: C
Explanation: The /28 CIDR block provides 16 IP addresses, of which 2 are reserved
(network and broadcast), leaving 14 usable host addresses. However, this setup allows
for 16 subnets with fewer host addresses.
17. Which transport layer protocol would be most suitable for real-time
applications like video streaming and VoIP?
A) TCP
B) FTP
C) UDP
D) ICMP
Answer: C
Explanation: UDP is ideal for real-time applications like video streaming and VoIP, as
it is fast, connectionless, and does not require reliable delivery, which reduces latency.
18. Which layer of the OSI model does the DNS protocol operate in?
A) Application Layer
B) Network Layer
C) Transport Layer
D) Data Link Layer
Answer: A
Explanation: DNS (Domain Name System) operates at the Application Layer of the
OSI model, translating domain names into IP addresses.
167 | P a g e
19. Which of the following correctly describes the "SYN flood" attack?
A) An attack that overwhelms the target server with incomplete TCP connection requests.
B) An attack that attempts to break DNS resolution by injecting false responses.
C) An attack that exploits ARP by poisoning the MAC address cache of a device.
D) An attack that generates a large number of ICMP Echo requests.
Answer: A
Explanation: A SYN flood attack overwhelms a target server with a large number of
half-open TCP connections by sending SYN packets without completing the three-way
handshake.
20. Which of the following protocols is responsible for the secure transmission of
HTTP data over the internet?
A) FTP
B) HTTPS
C) SMTP
D) SNMP
Answer: B
Explanation: HTTPS (Hypertext Transfer Protocol Secure) is responsible for secure
transmission of HTTP data using SSL/TLS encryption.
21. What is the primary function of the TCP sliding window protocol?
Answer: C
Explanation: The TCP sliding window protocol is used for flow control and ensures
that data is transmitted reliably by allowing a sender to send multiple packets before
needing an acknowledgment.
168 | P a g e
22. Which type of attack specifically exploits the TCP/IP stack's ability to
establish multiple connections?
A) DNS Spoofing
B) SYN Flood
C) SQL Injection
D) Man-in-the-Middle
Answer: B
Explanation: A SYN Flood attack exploits the TCP/IP stack by sending a large number
of SYN packets, leading to resource exhaustion on the target server due to half-open
connections.
23. In which scenario would you use ICMP Type 11 (Time Exceeded) messages?
A) When a router receives a packet that it cannot forward due to lack of resources.
B) To indicate that a requested service is not available.
C) When a packet's TTL expires before reaching its destination.
D) To respond to a successful ping request.
Answer: C
Explanation: ICMP Type 11 messages indicate that a packet's Time-To-Live (TTL) has
expired, meaning it could not reach its destination within the allowed hops.
24. Which feature of IPv6 allows devices to automatically configure their own IP
addresses?
Answer: A
Explanation: SLAAC (Stateless Address Autoconfiguration) allows IPv6 devices to
automatically configure their own IP addresses without the need for a DHCP server.
169 | P a g e
25. What is the main advantage of using Classless Inter-Domain Routing (CIDR)
over traditional IP addressing?
Answer: B
Explanation: CIDR simplifies routing tables and reduces waste of IP addresses by
allowing for variable-length subnet masks.
26. What type of DNS record is used to map a domain name to an IPv6 address?
A) A Record
B) CNAME Record
C) AAAA Record
D) MX Record
Answer: C
Explanation: The AAAA record maps a domain name to an IPv6 address. An A
record is used for IPv4 addresses.
Answer: D
Explanation: NAT allows internal devices to use private IP addresses while
translating these to a single public IP address for internet access, meaning not all
devices need public IPs.
170 | P a g e
28. In a socket programming context, what is the purpose of the 'bind' function?
Answer: B
Explanation: The 'bind' function is used to assign a specific port number and
optionally an IP address to a socket, allowing the application to listen on that port.
29. Which of the following is NOT a valid reason to use HTTP/2 over HTTP/1.1?
Answer: C
Explanation: HTTP/2 introduces header compression, multiplexing, and server push
capabilities, all aimed at improving performance and reducing latency, making option C
incorrect.
30. Which protocol is used by a client to retrieve email messages from a server
while keeping the messages on the server?
A) POP3
B) IMAP
C) SMTP
D) FTP
Answer: B
Explanation: IMAP (Internet Message Access Protocol) allows clients to retrieve
email messages while keeping them stored on the server, enabling access from multiple
devices.
171 | P a g e
31. Which of the following best describes a "socket" in network programming?
Answer: B
Explanation: A socket is defined as a combination of an IP address and a port
number, which allows for communication between two devices over a network.
Answer: B
Explanation: ARP (Address Resolution Protocol) is used to map an IP address to a
physical MAC address on a local network.
A) GET
B) POST
C) PUT
D) DELETE
Answer: C
Explanation: The PUT method is used to update or replace an existing resource on a
server.
34. What is the maximum transmission unit (MTU) for Ethernet frames?
A) 128 bytes
B) 256 bytes
C) 1500 bytes
D) 9000 bytes
172 | P a g e
Answer: C
Explanation: The maximum transmission unit (MTU) for standard Ethernet frames is
1500 bytes.
Answer: C
Explanation: When a packet's TTL (Time-To-Live) reaches zero, it is discarded, and
an ICMP Time Exceeded message is sent back to the sender.
A) IPv4 uses a 64-bit address space, while IPv6 uses a 128-bit address space.
B) IPv6 supports multicast addressing, while IPv4 does not.
C) IPv4 addresses are represented in hexadecimal format, while IPv6 addresses use
decimal format.
D) IPv6 has a larger address space than IPv4, allowing for a greater number of unique IP
addresses.
Answer: D
Explanation: IPv6 has a 128-bit address space, allowing for a significantly larger
number of unique IP addresses compared to the 32-bit address space of IPv4.
Answer: C
Explanation: The ICMP (Internet Control Message Protocol) is primarily used to
send error messages and operational information related to IP processing.
173 | P a g e
38. What is a key benefit of using DNS over hard-coded IP addresses in
applications?
Answer: B
Explanation: Using DNS allows for easier management and updates of resource
locations without changing application code, as domain names can be mapped to
different IP addresses.
39. In what scenario would you typically use the TCP/IP model?
Answer: B
Explanation: The TCP/IP model is primarily used for establishing connections for
data communication over the Internet, particularly for protocols like FTP and HTTP.
40. What advantage does the use of ports provide in TCP/IP communications?
Answer: B
Explanation: Ports allow multiple applications to run on the same device using the same
IP address, enabling communication with different services simultaneously.
174 | P a g e
Different types of Network Security Protections:
Answer: D
Explanation: A firewall is designed to filter incoming and outgoing network traffic
based on security rules, acting as a barrier between a trusted internal network and
untrusted external networks.
A) Stateful firewalls inspect packets only at the application layer, while stateless firewalls
inspect at the transport layer.
B) Stateless firewalls track the state of active connections, while stateful firewalls do not.
C) Stateful firewalls can make decisions based on the context of traffic, while stateless
firewalls make decisions based on individual packets.
D) There is no difference; both terms refer to the same technology.
Answer: C
Explanation: Stateful firewalls maintain the state of active connections and can make
more informed decisions based on the context of traffic, while stateless firewalls treat
each packet in isolation.
3. Which type of access control policy restricts access based on user roles and
their permissions?
175 | P a g e
Answer: B
Explanation: Role-Based Access Control (RBAC) assigns access permissions based on
the user’s role within an organization, making it easier to manage user rights based on
responsibilities.
Answer: B
Explanation: A Remote Access VPN allows users to securely connect to a private
network from a remote location, encrypting data transmitted over potentially insecure
networks like the Internet.
Answer: B
Explanation: A Proxy Firewall acts as an intermediary between clients and servers,
primarily used for filtering and controlling web traffic, providing anonymity and
security.
Answer: C
Explanation: Discretionary Access Control (DAC) allows data owners to control
176 | P a g e
access to their resources based on user identity, giving them discretion over who can
access what.
Answer: B
Explanation: Stateful firewalls require more resources to maintain connection states,
making them generally more resource-intensive than stateless firewalls.
Answer: B
Explanation: An Intrusion Detection System (IDS) is designed to monitor network
traffic for suspicious activity and generate alerts when potential threats are detected.
Answer: B
Explanation: A hardware firewall deployed at the network perimeter is an example of
a network-based firewall, designed to protect the entire network rather than individual
devices.
177 | P a g e
10. Which access control model uses attributes to determine access rights?
Answer: D
Explanation: Attribute-Based Access Control (ABAC) uses attributes (such as user,
resource, and environment attributes) to define and enforce access policies.
11. What is the key difference between a VPN and a Remote Access VPN?
A) A VPN is used for site-to-site connections, while a Remote Access VPN is used for
individual users.
B) A VPN encrypts all traffic, while a Remote Access VPN does not.
C) A VPN requires client-side software, while a Remote Access VPN does not.
D) There is no difference; both terms are interchangeable.
Answer: A
Explanation: A VPN can refer to both site-to-site connections (between networks) and
Remote Access VPNs (for individual users), but the key difference lies in their
applications.
Answer: A
Explanation: Packet filtering firewalls operate at the network layer and primarily
examine packet headers, which means they cannot perform deep packet inspection to
analyze payload content.
178 | P a g e
13. Which type of firewall combines the features of both packet filtering and
stateful inspection?
A) Application Firewall
B) Next-Generation Firewall (NGFW)
C) Proxy Firewall
D) Circuit-Level Gateway
Answer: B
Explanation: A Next-Generation Firewall (NGFW) combines features of traditional
firewalls (packet filtering and stateful inspection) with additional capabilities such as
application awareness and deep packet inspection.
A) Packet Filtering
B) Public Key Infrastructure (PKI)
C) Protocol Encryption (e.g., SSL/TLS, IPsec)
D) Firewall Rules
Answer: C
Explanation: Protocol encryption (such as SSL/TLS or IPsec) is used in VPNs to
ensure the confidentiality of data transmitted over the VPN tunnel.
15. Which of the following statements is true regarding remote access VPNs?
Answer: C
Explanation: Remote access VPNs allow remote users to securely access an
organization’s internal network, enabling secure communication over the Internet.
16. What is a common use case for implementing Access Control Lists (ACLs) in
firewalls?
Answer: C
Explanation: Access Control Lists (ACLs) in firewalls are used to define and enforce
rules regarding which traffic is allowed or denied access through the firewall based on
specified criteria.
17. Which of the following best describes the role of a DMZ (Demilitarized Zone)
in network security?
Answer: C
Explanation: A DMZ (Demilitarized Zone) is a perimeter network that isolates publicly
accessible servers (such as web servers) from the internal network, providing an
additional layer of security.
18. In a VPN connection, what does the term "tunneling" refer to?
A) The process of creating a secure pathway through the Internet for data transmission.
B) The technique used to bypass firewall restrictions.
C) The method of verifying user identities.
D) The encryption algorithm applied to data packets.
Answer: A
Explanation: Tunneling refers to the process of creating a secure pathway through the
Internet for transmitting data, often using encapsulation and encryption techniques to
ensure privacy and security.
180 | P a g e
Answer: B
Explanation: The primary purpose of Network Access Control (NAC) is to prevent
unauthorized access to network resources by enforcing security policies based on user
identity and device compliance.
Answer: D
Explanation: Privilege Escalation attacks aim to manipulate or bypass access control
measures, allowing attackers to gain unauthorized levels of access to systems or data.
21. Which type of firewall operates at the application layer to filter traffic based
on specific content within the packets?
Answer: C
Explanation: An Application Firewall operates at the application layer and is capable
of filtering traffic based on specific content and applications rather than just packet
headers.
Answer: B
Explanation: A bastion host is a special-purpose computer on a network specifically
181 | P a g e
designed and configured to withstand attacks, often acting as a gateway between
internal and external networks.
Answer: B
Explanation: The use of a VPN can lead to reduced performance because of the
encryption overhead required to secure the connection, especially with large data
transfers.
Answer: B
Explanation: NAT (Network Address Translation) is primarily used to conceal
internal IP addresses from external networks, providing an additional layer of security
and allowing multiple devices to share a single public IP address.
A) Network-based Firewall
B) Stateful Packet Inspection Firewall
C) Application Layer Firewall
D) Circuit-Level Gateway
Answer: C
Explanation: An Application Layer Firewall is specifically designed to protect against
application-layer attacks by inspecting the content of the traffic and enforcing security
policies at the application level.
182 | P a g e
26. Which of the following protocols is commonly used for implementing Remote
Access VPNs?
A) ARP
B) RDP
C) IPsec
D) DHCP
Answer: C
Explanation: IPsec is one of the most commonly used protocols for implementing
Remote Access VPNs, providing security at the IP layer through encryption and
authentication.
27. In an access control model, which of the following principles states that users
should have the minimum level of access necessary to perform their job
functions?
A) Need-to-Know Principle
B) Principle of Least Privilege
C) Separation of Duties
D) Mandatory Access Control
Answer: B
Explanation: The Principle of Least Privilege states that users should have the
minimum level of access necessary to perform their job functions, reducing the risk of
unauthorized access.
Answer: C
Explanation: Defense in depth refers to the practice of utilizing multiple layers of
security controls throughout the network to provide redundancy and enhance overall
security.
183 | P a g e
29. Which of the following access control methods allows for the dynamic
granting of access rights based on attributes and conditions?
Answer: D
Explanation: Attribute-Based Access Control (ABAC) allows for dynamic granting
of access rights based on a combination of attributes and conditions, providing more
flexible access control.
30. What is the primary risk associated with using a poorly configured firewall?
Answer: B
Explanation: A poorly configured firewall can lead to unauthorized access to
internal systems, as it may not effectively enforce the security policies intended to
protect the network.
31. What type of firewall filters traffic based on session information and
maintains the state of active connections?
A) Stateless Firewall
B) Stateful Firewall
C) Proxy Firewall
D) Application Firewall
Answer: B
Explanation: A Stateful Firewall maintains session information and the state of active
connections, allowing it to make more informed decisions about whether to allow or
block traffic.
184 | P a g e
32. Which of the following is a disadvantage of using a proxy server as a firewall?
Answer: C
Explanation: One disadvantage of using a proxy server as a firewall is that it can
introduce latency into network connections, as traffic is routed through the proxy before
reaching its destination.
33. Which access control model is most commonly used in database management
systems?
Answer: C
Explanation: Discretionary Access Control (DAC) is the most commonly used model
in database management systems, allowing users to control access to their own data.
Answer: B
Explanation: A security policy outlines the security rules and procedures that govern
the protection of an organization’s assets, serving as a foundational document for security
practices.
35. In the context of firewalls, what does the term "logging" refer to?
185 | P a g e
C) The method of filtering traffic based on content.
D) The configuration of access control rules.
Answer: B
Explanation: Logging refers to the act of monitoring and recording network activity,
allowing administrators to review traffic patterns and identify potential security incidents.
Answer: C
Explanation: A reverse proxy server is primarily used to distribute incoming traffic
among multiple servers, improving load balancing, performance, and security.
Answer: C
Explanation: A VPN does not necessarily require dedicated hardware for
implementation; it can be configured using software on existing hardware.
A) Phishing Attack
B) Man-in-the-Middle Attack
C) Trust Exploit Attack
D) Port Scanning Attack
Answer: C
Explanation: A Trust Exploit Attack is designed to bypass firewalls by exploiting trust
relationships between networks, allowing attackers to gain unauthorized access.
186 | P a g e
39. Which of the following statements about Remote Access VPNs is true?
Answer: C
Explanation: Remote Access VPNs allow remote users to access internal resources
securely, providing encryption and security for data transmitted over public networks.
Answer: B
Explanation: A VPN concentrator is a device that creates and manages VPN
communication, establishing secure connections for remote users and managing multiple
VPN tunnels.
4. Cloud
A) On-demand self-service
B) Broad network access
C) Low latency and high throughput
D) Resource pooling
187 | P a g e
Answer: C
Explanation: Low latency and high throughput are performance metrics, but not a core
characteristic of cloud computing. Cloud characteristics typically include on-demand
self-service, broad network access, resource pooling, etc.
A) Resource pooling
B) Elasticity
C) Virtualization
D) Multi-tenancy
Answer: B
Explanation: Elasticity refers to the cloud’s ability to dynamically scale resources up
or down based on current workloads, ensuring efficient resource utilization.
3. Which type of cloud service allows users to run and manage applications
without dealing with the underlying infrastructure?
A) SaaS
B) PaaS
C) IaaS
D) FaaS
Answer: B
Explanation: PaaS (Platform as a Service) enables users to develop, run, and manage
applications without dealing with the complexities of infrastructure management.
Answer: B
Explanation: IaaS provides hardware infrastructure such as servers, storage, and
188 | P a g e
networking, whereas PaaS offers a platform for developing applications without the
need to manage the underlying infrastructure.
A) Clients pay upfront for all the resources they may use in the future.
B) Clients are billed based on the number of users.
C) Clients pay only for the resources they consume.
D) Clients are billed annually for cloud services.
Answer: C
Explanation: In the pay-as-you-go model, clients are billed based on actual resource
consumption, rather than paying for a predetermined set of resources or services.
6. Which cloud service model allows users to control the operating system,
storage, and deployed applications, but not the underlying hardware?
A) SaaS
B) IaaS
C) PaaS
D) CaaS
Answer: B
Explanation: IaaS (Infrastructure as a Service) gives users control over operating
systems, storage, and applications, but they do not manage the underlying hardware
infrastructure.
7. In cloud computing, which feature ensures that services are available across
various platforms and devices, independent of location?
Answer: A
Explanation: Broad network access means services are accessible from a variety of
devices and platforms, such as mobile phones, laptops, and workstations, regardless of
location.
189 | P a g e
8. Which of the following statements is true about Private Cloud?
Answer: B
Explanation: Private clouds are dedicated to a single organization and are typically
more expensive to maintain because the organization must handle hardware and
software management.
9. Which cloud deployment model provides the highest level of security and data
control?
A) Public Cloud
B) Private Cloud
C) Hybrid Cloud
D) Community Cloud
Answer: B
Explanation: Private Cloud offers the highest level of security and data control, as the
infrastructure is dedicated to one organization and can be customized to meet strict
security and compliance requirements.
10. Which cloud computing model allows companies to combine their private
cloud infrastructure with public cloud services?
A) Community Cloud
B) Hybrid Cloud
C) Public Cloud
D) Distributed Cloud
Answer: B
Explanation: A Hybrid Cloud combines both private and public cloud services,
allowing data and applications to be shared between them.
190 | P a g e
11. What is the primary advantage of the multi-tenancy architecture in cloud
computing?
Answer: B
Explanation: Multi-tenancy allows multiple users to share the same physical
resources, which reduces infrastructure costs, making cloud services more cost-effective.
12. Which type of cloud service is typically used by businesses to rent virtual
machines, storage, and networking capabilities?
A) SaaS
B) PaaS
C) IaaS
D) DaaS
Answer: C
Explanation: IaaS (Infrastructure as a Service) allows businesses to rent virtual
machines, storage, and networking resources without managing physical hardware.
13. Which characteristic of cloud computing allows organizations to only pay for
the resources they actually use?
A) Elasticity
B) Resource Pooling
C) Measured Service
D) On-Demand Self-Service
Answer: C
Explanation: Measured service enables billing based on actual usage, allowing
organizations to only pay for the resources they consume.
191 | P a g e
A) To secure cloud services
B) To provide a web interface for cloud management
C) To create multiple virtual environments on a single physical machine
D) To connect different cloud services
Answer: C
Explanation: Virtualization is a technology that allows multiple virtual machines to
run on a single physical machine, which is foundational to cloud computing.
15. Which of the following is NOT a key benefit of using SaaS (Software as a
Service)?
Answer: C
Explanation: SaaS solutions do not provide full control over infrastructure, as the
service provider manages the software, hardware, and network resources.
16. Which cloud deployment model would best suit a government organization
that needs to share cloud resources with other governmental agencies?
A) Public Cloud
B) Private Cloud
C) Hybrid Cloud
D) Community Cloud
Answer: D
Explanation: A Community Cloud is suitable when organizations with common goals
or requirements, like governmental agencies, need to share resources and infrastructure.
17. Which of the following is the main advantage of the Public Cloud over the
Private Cloud?
Answer: C
Explanation: One of the main disadvantages of a Public Cloud is that organizations
have less control over security and privacy, as the infrastructure is shared with other
tenants.
Answer: A
Explanation: A Hybrid Cloud combines the features of private and public clouds,
offering greater flexibility by allowing organizations to move workloads between clouds
as needed.
20. Which type of cloud service offers the least user control over the underlying
infrastructure?
A) SaaS
B) IaaS
C) PaaS
D) DaaS
Answer: A
Explanation: In SaaS (Software as a Service), users have the least control over the
underlying infrastructure, as the service provider manages the entire stack, from hardware
to software.
193 | P a g e
21. Which of the following is the most challenging issue when migrating a legacy
system to the cloud?
A) Cost optimization
B) Scalability of services
C) Data security and compliance
D) Virtualization of physical hardware
Answer: C
Explanation: Data security and compliance is often the most challenging issue because
legacy systems were often built without cloud security considerations, and ensuring
compliance with various regulations adds to the complexity.
22. In a hybrid cloud architecture, what challenge does "data sovereignty" refer
to?
Answer: A
Explanation: Data sovereignty refers to the control and legal jurisdiction over data
when it is stored in cloud environments spread across multiple countries.
A) Performance degradation
B) Cloud elasticity
C) Regulatory compliance
D) Isolation failure
Answer: D
Explanation: Isolation failure is a key concern in a multitenant architecture, where
multiple tenants share the same infrastructure, making it challenging to isolate each
tenant's data and processes securely.
194 | P a g e
24. What distinguishes a "community cloud" from a private cloud?
Answer: C
Explanation: A community cloud is shared by several organizations with common
goals or requirements, typically in highly regulated sectors like healthcare or
government.
25. In terms of cloud pricing models, which factor would have the least impact on
cost in a multi-cloud strategy?
Answer: C
Explanation: SLA guarantees do not directly impact the cost as much as resource
usage, such as data transfers and storage operations, which are critical factors in a
multi-cloud strategy.
Answer: C
Explanation: Serverless architectures often rely on vendor-specific services and
APIs, leading to a risk of vendor lock-in, making it difficult to migrate to other
platforms.
195 | P a g e
27. Which statement is true about "auto-scaling" in a cloud environment?
Answer: B
Explanation: Auto-scaling can be configured to scale resources dynamically or
predictively based on historical trends and anticipated workload demand.
28. What is the primary difference between a "hot site" and a "warm site" in
cloud disaster recovery?
A) A hot site requires manual data transfer, while a warm site is automated.
B) A hot site is fully operational with real-time data backup, while a warm site requires
some manual configuration.
C) A warm site is more expensive to maintain than a hot site.
D) A warm site provides better performance but less redundancy.
Answer: B
Explanation: A hot site is fully operational with real-time data synchronization,
whereas a warm site has infrastructure in place but requires some configuration and
data synchronization before becoming operational.
29. Which type of attack exploits the elasticity of cloud services to drive up the
victim's cost?
Answer: C
Explanation: Economic Denial of Sustainability (EDoS) targets the cloud service's
elasticity, causing excessive resource consumption and ultimately leading to increased
costs for the victim.
196 | P a g e
30. What is the primary reason for latency in hybrid cloud models where public
and private clouds are integrated?
Answer: C
Explanation: Latency in a hybrid cloud environment is mainly due to the data transfer
between public and private clouds, especially when significant data synchronization is
required.
Answer: B
Explanation: A multi-cloud strategy is often used to avoid vendor lock-in, improve
resiliency, and ensure high availability by leveraging multiple cloud providers.
32. Which of the following practices would most effectively mitigate the risk of
"VM Escape" in IaaS environments?
Answer: B
Explanation: VM Escape occurs when a malicious actor breaks out of a virtual machine
and gains access to the host system or other VMs. Hypervisor security and VM
isolation mechanisms are critical to preventing this.
197 | P a g e
33. In cloud service models, which layer offers virtual machine management and
API controls but requires the user to manage the OS and applications?
A) SaaS
B) PaaS
C) IaaS
D) FaaS
Answer: C
Explanation: In IaaS (Infrastructure as a Service), the user has control over the
operating system, applications, and data, while the cloud provider manages the
underlying hardware and virtualization.
A) Public Cloud
B) Hybrid Cloud
C) Private Cloud
D) Community Cloud
Answer: C
Explanation: Private Cloud is preferred in highly regulated industries, as it provides
better security and compliance capabilities, with full control over infrastructure and
data.
A) PaaS provides databases and middleware services, while IaaS provides only virtual
machines.
B) PaaS offers more control over hardware, while IaaS abstracts infrastructure
completely.
C) PaaS lacks scalability, while IaaS is designed for large-scale deployments.
D) PaaS requires more user control over security patches than IaaS.
Answer: A
Explanation: PaaS includes databases, middleware, and development tools, whereas
IaaS provides virtual machines and basic infrastructure but requires users to handle
everything from the operating system up.
198 | P a g e
36. Which of the following is a benefit of using a content delivery network (CDN)
in a cloud environment?
Answer: C
Explanation: A CDN improves performance by caching content in servers that are
closer to the end-users, thereby reducing latency.
37. Which type of firewall is best suited for protecting web applications from
specific vulnerabilities like SQL Injection or XSS?
A) Network-based firewall
B) Stateful firewall
C) Application Layer firewall
D) Stateless firewall
Answer: C
Explanation: Application Layer firewalls or Web Application Firewalls (WAFs) are
designed to protect web applications by filtering and monitoring HTTP traffic and
preventing attacks like SQL Injection and Cross-Site Scripting (XSS).
38. What is the role of the "Service Broker" in a cloud service model?
Answer: B
Explanation: A Service Broker in cloud computing is responsible for interfacing
between the cloud consumer and provider, abstracting the complexities of service
discovery and provisioning.
39. Which protocol is used in cloud environments for identity and access
management to enable single sign-on (SSO)?
199 | P a g e
A) OAuth
B) FTP
C) ICMP
D) SMTP
Answer: A
Explanation: OAuth is a widely-used protocol for identity and access management,
enabling single sign-on (SSO) capabilities by allowing third-party applications to grant
limited access to resources without exposing credentials.
Answer: B
Explanation: Multi-tenancy refers to the shared usage of computing resources (e.g.,
storage, servers) by multiple cloud tenants, while ensuring logical isolation between
them to protect data and workloads.
200 | P a g e
Answer: B
Explanation: Containerization packages applications and their dependencies into a
single container, ensuring that the software works uniformly across different
environments.
Answer: B
Explanation: Parallel computing handles multiple tasks simultaneously on different
processors within a single machine, while distributed computing spreads tasks across
multiple geographically dispersed machines.
Answer: C
Explanation: Type 2 hypervisors are installed on top of a host operating system and
provide virtualization capabilities, but they are generally slower compared to Type 1
hypervisors.
201 | P a g e
Answer: C
Explanation: Containers have significantly lower overhead and start much faster than
traditional virtual machines, making them highly efficient for microservices and cloud-
native applications.
A) The guest OS is aware of the virtualization and collaborates with the hypervisor.
B) The guest OS is unaware of the virtualization and relies on the hypervisor to translate
hardware instructions.
C) The hypervisor modifies the guest OS to enable better performance.
D) The hardware resources are shared equally among all virtual machines.
Answer: B
Explanation: In Full Virtualization, the guest OS is unaware of the virtualization and
the hypervisor translates hardware instructions to enable multiple operating systems to
run on the same physical machine.
6. In the context of virtualization, what is the key distinction between Type 1 and
Type 2 hypervisors?
Answer: A
Explanation: Type 1 hypervisors are installed directly on bare-metal hardware, while
Type 2 hypervisors run on top of an existing host operating system, making Type 1
faster and more efficient for enterprise use.
A) Para-virtualization
B) Full Virtualization
C) Storage Virtualization
D) Network Virtualization
202 | P a g e
Answer: B
Explanation: Full Virtualization enables multiple operating systems to run on the same
hardware without modifying the guest operating systems, by using a hypervisor to
translate system calls.
Answer: C
Explanation: Orchestration tools like Kubernetes automate the deployment, scaling,
and management of containerized applications, making it easier to handle large-scale
microservices architectures.
Answer: C
Explanation: Server-based virtualization (software-based) is often used in scenarios
where commodity hardware lacks the advanced support for hardware-level
virtualization (as required by hypervisor-based virtualization).
203 | P a g e
Answer: B
Explanation: Automated tests in the CI/CD pipeline ensure that code changes do not
introduce bugs or break existing functionality, thereby maintaining code quality.
A) Para-Virtualization
B) Full Virtualization
C) Network Virtualization
D) Desktop Virtualization
Answer: A
Explanation: Para-Virtualization requires modifications to the guest OS to improve
performance and better collaborate with the hypervisor, unlike full virtualization which
requires no such modifications.
Answer: B
Explanation: Distributed computing distributes tasks across multiple nodes or
machines, providing redundancy and improved fault tolerance, which is critical in cloud
environments.
Answer: B
Explanation: Type 1 Hypervisors are commonly used in enterprise data centers
because they provide bare-metal performance and allow multiple virtual servers to run
efficiently on a single physical machine.
204 | P a g e
14. In a microservices architecture, which of the following is the best reason for
using containers?
Answer: B
Explanation: Containers are lightweight, start quickly, and can be easily orchestrated
and scaled, which makes them highly suitable for microservices architectures.
15. Which of the following correctly describes continuous delivery (CD) in the
context of CI/CD?
Answer: B
Explanation: Continuous delivery (CD) ensures that code is always ready for
deployment, but does not automatically deploy it to production. This deployment
decision can be made manually.
A) Virtual Machines
B) Hypervisors
C) Kernel Namespaces and Control Groups (cgroups)
D) Bare-metal servers
Answer: C
Explanation: Containerization uses Kernel Namespaces and Control Groups
(cgroups) to isolate applications and their resources, unlike traditional hypervisor-based
virtual machines.
205 | P a g e
17. How does network virtualization differ from traditional networking?
Answer: B
Explanation: Network virtualization abstracts network resources from physical
hardware, allowing them to be managed as software-defined components, leading to
greater flexibility and scalability.
18. What is the key role of Continuous Integration (CI) in the software
development lifecycle?
Answer: B
Explanation: Continuous Integration (CI) ensures that code is tested and validated
every time a developer pushes changes, which helps identify integration issues early in
the development lifecycle.
Answer: B
Explanation: Containers have lower resource overhead and start much faster than
virtual machines, making them more suitable for fast-paced CI/CD pipelines.
206 | P a g e
20. What is a key feature of para-virtualization that distinguishes it from full
virtualization?
Answer: B
Explanation: In para-virtualization, the guest OS is aware of the virtualization and
collaborates with the hypervisor to improve performance, unlike full virtualization which
abstracts the hardware layer completely.
21. What is the primary benefit of using container orchestration tools like
Kubernetes in a cloud-native environment?
Answer: B
Explanation: Kubernetes and other orchestration tools automate the deployment,
scaling, and management of containers, which simplifies running complex applications in
cloud-native environments.
Answer: B
Explanation: A Type 1 Hypervisor (bare-metal hypervisor) runs directly on the
physical hardware, offering better performance and efficiency than Type 2 hypervisors,
which run on top of a host OS.
207 | P a g e
23. Which feature distinguishes Virtual Machines (VMs) from containers in
cloud environments?
Answer: B
Explanation: Virtual Machines virtualize an entire operating system and hardware,
while containers only virtualize at the OS level, sharing the host OS kernel, which
makes them more lightweight and efficient.
24. What role does Continuous Integration (CI) play in a CI/CD pipeline?
Answer: C
Explanation: Continuous Integration (CI) automates the testing and validation of
code changes, ensuring that new commits do not break the build and errors are detected
early in the development process.
A) Full Virtualization
B) Para-Virtualization
C) Network Virtualization
D) Desktop Virtualization
Answer: B
Explanation: In Para-Virtualization, the guest OS is aware of the virtualization and
works in coordination with the hypervisor for better performance. Full virtualization
abstracts this interaction completely.
208 | P a g e
26. Which of the following is a characteristic of server-based virtualization?
Answer: B
Explanation: Server-based virtualization abstracts multiple virtual servers from a
single physical server, enabling better resource utilization and isolation of different
services.
27. What is the main difference between "Full Virtualization" and "Para-
Virtualization"?
A) Full virtualization modifies the guest OS, whereas para-virtualization does not.
B) Full virtualization requires hardware support, whereas para-virtualization can run on
any hardware.
C) Para-virtualization modifies the guest OS, whereas full virtualization does not.
D) Para-virtualization offers less performance overhead than full virtualization.
Answer: C
Explanation: Para-virtualization modifies the guest OS to interact more efficiently
with the hypervisor, while in Full Virtualization, the guest OS remains unmodified, and
the hypervisor handles all interactions.
Answer: B
Explanation: Serverless computing enables developers to run applications without
managing the underlying server infrastructure. The cloud provider handles the server
management, scaling, and resource allocation.
209 | P a g e
29. Which of the following is a key advantage of using containers for
microservices?
Answer: B
Explanation: Containers allow each microservice to be packaged with its
dependencies, ensuring that it runs consistently across different environments, making
them ideal for microservices architectures.
30. What is the key difference between "Network Virtualization" and "Storage
Virtualization"?
Answer: C
Explanation: Network virtualization abstracts and manages network resources as
software-defined components, while storage virtualization abstracts storage devices,
making them appear as a unified storage resource.
31. Which of the following statements is true about "Type 1" hypervisors?
Answer: B
Explanation: Type 1 Hypervisors are installed directly on the bare-metal hardware,
offering higher performance and efficiency compared to Type 2 Hypervisors, which
run on top of an existing OS.
210 | P a g e
32. In a virtualized environment, what is the purpose of "Live Migration"?
Answer: B
Explanation: Live Migration is the process of moving a virtual machine from one
physical host to another without downtime, ensuring service continuity during host
maintenance or load balancing.
Answer: B
Explanation: A Service Mesh provides secure, reliable communication between
microservices, handling tasks such as load balancing, encryption, and monitoring within
a containerized architecture.
Answer: B
Explanation: NAT allows multiple devices with private IP addresses to communicate
with the internet using a single public IP address, effectively hiding internal network
details.
211 | P a g e
35. In CI/CD pipelines, what is the purpose of continuous deployment?
Answer: A
Explanation: Continuous deployment automates the process of deploying every
validated change to production without manual intervention, ensuring rapid release
cycles.
36. What is the primary difference between Full Virtualization and Hardware-
Assisted Virtualization?
Answer: B
Explanation: Hardware-assisted virtualization uses CPU extensions (e.g., Intel VT-x,
AMD-V) to improve the performance of virtual machines by enabling better hardware
access, unlike full virtualization, which emulates hardware.
Answer: B
Explanation: CI/CD pipelines enable the faster detection of bugs and issues by
automating testing, validation, and deployment processes, which helps in improving the
overall software quality.
212 | P a g e
38. Which of the following best describes "Bare-Metal as a Service (BMaaS)"?
A) A cloud service model that provides physical servers for customer workloads without
a hypervisor.
B) A virtualization service that optimizes hardware resources.
C) A service that offers both physical and virtual servers for load balancing.
D) A cloud service that abstracts hardware using a hypervisor.
Answer: A
Explanation: BMaaS provides customers with physical servers without a hypervisor,
allowing them to run workloads directly on bare-metal hardware.
Answer: B
Explanation: Containers reduce startup time and have lower resource overhead
compared to virtual machines, making them ideal for fast deployment in microservices
architectures.
Answer: B
Explanation: Container orchestration tools, like Kubernetes, automate the
deployment, scaling, and management of containerized applications, enabling efficient
operation of large-scale, distributed systems.
213 | P a g e
Real life situational mcqs from the whole syllabus:
A) The VMs are not properly sized, and you should add more memory to each.
B) The web applications are not optimized, and code refactoring is needed.
C) The physical server hosting the VMs is over-utilized, and load balancing across
multiple servers is required.
D) The applications are encountering network bottlenecks, and you should upgrade
network bandwidth.
Answer: C
Explanation: The likely cause is the physical server hosting the virtual machines being
over-utilized. A solution would be to implement load balancing across multiple servers
to distribute traffic and resources more efficiently.
A) Virtual Machines
B) Service Mesh (e.g., Istio)
C) CI/CD pipelines
D) Container Orchestration (e.g., Kubernetes)
Answer: B
Explanation: A Service Mesh (e.g., Istio) provides a framework for managing service-
to-service communication, handling traffic routing, security, and observability, making
it ideal for microservices architectures.
3. You are asked to scale an application in the cloud to handle sudden traffic
spikes. The application is containerized and deployed in a Kubernetes cluster.
What is the best method to ensure smooth scaling during traffic spikes?
214 | P a g e
C) Upgrading the server hardware to handle more containers.
D) Migrating the application to virtual machines for better resource allocation.
Answer: B
Explanation: Kubernetes' Horizontal Pod Autoscaler can automatically scale pods
based on resource usage (e.g., CPU, memory), allowing the application to efficiently
handle traffic spikes without manual intervention.
A) Public Cloud
B) Private Cloud
C) Hybrid Cloud
D) Multi-Cloud
Answer: B
Explanation: A Private Cloud is ideal for organizations like financial services
companies that need to maintain full control over their infrastructure and comply with
regulatory requirements while benefiting from cloud services.
A) Continuous Integration
B) Blue-Green Deployment
C) Full Virtualization
D) Manual Rollback Process
Answer: B
Explanation: Blue-Green Deployment minimizes downtime by keeping two
environments (blue and green) and switching between them for updates. If something
goes wrong, they can quickly roll back to the previous environment.
215 | P a g e
6. Your company is transitioning from traditional on-premise servers to cloud
infrastructure and needs to ensure data security during transit and at rest.
Which combination of security practices would best ensure this?
Answer: B
Explanation: For cloud infrastructure, data encryption at rest (e.g., using AES-256)
and SSL/TLS for data in transit ensures that data is protected both in storage and
during transmission, meeting best security practices.
A) Public Cloud
B) Hybrid Cloud
C) Community Cloud
D) Private Cloud
Answer: D
Explanation: A Private Cloud would ensure that the application has dedicated
infrastructure, which helps meet compliance requirements by preventing resource
sharing with other tenants.
A) Type 1 Hypervisor
B) Type 2 Hypervisor
C) Para-Virtualization
D) Full Virtualization
Answer: C
Explanation: Para-Virtualization can improve resource management because the guest
216 | P a g e
OS is aware of the virtualized environment and can interact with the hypervisor more
efficiently, reducing overhead and improving performance.
9. A tech startup is developing a web app and wants to ensure it can scale easily
as user demand grows. They have a limited budget for infrastructure and do not
want to manage servers themselves. Which cloud service model would be most
appropriate?
Answer: B
Explanation: PaaS (Platform as a Service) offers the application platform without the
need to manage the underlying infrastructure, making it ideal for startups that want to
focus on development and scalability without dealing with servers.
10. Your company has a large amount of structured and unstructured data, and
you need to implement a backup solution that allows for fast recovery of specific
data in case of a failure. What solution would best meet this need?
Answer: B
Explanation: Incremental Backups with daily snapshots allow fast recovery of specific
data since only changed data is backed up daily, reducing storage usage and improving
recovery times for large datasets.
217 | P a g e
D) NAT (Network Address Translation)
Answer: B
Explanation: A Remote Access VPN provides a secure connection for remote workers
to access company resources by encrypting traffic between the user and the
organization's network, ensuring data security.
12. Your organization is experiencing latency issues when accessing data stored
on traditional HDDs in your data center. To improve performance, what would
be the best approach?
Answer: A
Explanation: SSDs (Solid State Drives) have significantly faster access times and
lower latency compared to traditional HDDs, making them ideal for improving
performance in data-heavy applications.
Answer: C
Explanation: Encrypting data at rest with AES-256 or similar encryption standards
ensures that data stored on public cloud servers remains secure, even if unauthorized
access occurs.
218 | P a g e
A) Using a multi-cloud strategy with load balancing across providers.
B) Deploying the application on VMs with high availability.
C) Migrating the application to a single, more reliable cloud provider.
D) Using Kubernetes to automate container scaling within a single cloud provider.
Answer: A
Explanation: A multi-cloud strategy with load balancing across providers ensures
high availability and resilience, even if one cloud provider experiences an outage, the
others can take over.
Answer: A
Explanation: Implementing failover to a private cloud in case of public cloud
downtime ensures continuous availability of applications in a hybrid cloud
environment, leveraging both public and private resources.
Answer: B
Explanation: NAT improves internal network security by masking internal IP
addresses, allowing multiple devices to share a single public IP when accessing the
internet, thus hiding the internal network structure.
219 | P a g e
17. Your organization wants to implement a solution that allows internal
developers to build, test, and deploy applications automatically, while also
integrating code changes frequently. What would be the best practice to achieve
this?
Answer: B
Explanation: CI/CD pipelines automate the process of building, testing, and deploying
applications, ensuring that code changes are integrated frequently, leading to faster
release cycles and fewer integration issues.
18. You are asked to ensure compliance with company data security policies,
especially regarding data storage in cloud environments. Which of the following
would best ensure that only authorized personnel can access sensitive data?
Answer: B
Explanation: IAM policies with Role-Based Access Control (RBAC) ensure that only
authorized personnel have access to specific cloud resources based on their roles,
enhancing compliance and security.
19. Your company uses a wide range of internet application protocols, including
FTP and Telnet, but has recently identified security vulnerabilities. What is the
best course of action to secure the protocols?
220 | P a g e
D) Implement IDS/IPS for monitoring the protocols.
Answer: A
Explanation: Migrating to encrypted versions like SFTP (for FTP) and SSH (for Telnet)
significantly enhances security by encrypting data transmissions, thereby protecting
against vulnerabilities in plain-text protocols.
20. Your company's web servers experience increased traffic, and the load on the
network devices becomes critical. The current network setup uses a single
gateway and router. What approach would improve the situation?
Answer: B
Explanation: Load balancing across multiple routers and gateways distributes the
traffic efficiently, preventing overloading of individual devices and improving overall
network performance.
21. Your team is developing a mobile application that requires fast access to user
profiles stored in a large database. Which data structure would be most efficient
for this purpose, and why?
A) Array
B) Linked List
C) Hash Table
D) Binary Search Tree
Answer: C
Explanation: A Hash Table provides O(1) average time complexity for lookups,
making it efficient for fast access to user profiles compared to other structures.
22. During the development of a web application, you need to ensure that user
sessions are managed securely. Which of the following techniques would be most
effective in preventing session hijacking?
221 | P a g e
B) Implementing cookies with the Secure and HttpOnly flags
C) Allowing users to choose their session timeout
D) Storing session data in local storage
Answer: B
Explanation: Using cookies with the Secure and HttpOnly flags helps prevent session
hijacking by ensuring cookies are only sent over HTTPS and are not accessible via
JavaScript.
23. You are tasked with designing a system that allows different shapes (like
circles, squares, and triangles) to be drawn. Which object-oriented programming
concept would you utilize to ensure that common behaviors are inherited while
allowing specific behaviors for each shape?
A) Composition
B) Abstraction
C) Inheritance
D) Polymorphism
Answer: C
Explanation: Inheritance allows you to create a base class (e.g., Shape) that defines
common behaviors, while derived classes (e.g., Circle, Square) implement specific
behaviors.
24. While testing a new feature in your application, you notice that the new code
affects existing functionality. Which testing approach would be most appropriate
to identify this issue?
A) Unit Testing
B) Regression Testing
C) Black Box Testing
D) White Box Testing
Answer: B
Explanation: Regression Testing ensures that new code changes do not adversely affect
existing functionality, making it suitable for identifying issues caused by new features.
222 | P a g e
25. Your application has to process a large amount of data and perform sorting
operations frequently. Which sorting algorithm should you choose if you need
the best average-case performance?
A) Bubble Sort
B) Insertion Sort
C) Quick Sort
D) Selection Sort
Answer: C
Explanation: Quick Sort has an average-case time complexity of O(n log n), making it
more efficient for sorting large datasets compared to the other options listed.
26. You are designing a web application that needs to fetch user data from a
server asynchronously. Which technology would be best suited for this purpose?
A) HTML5
B) AJAX
C) CSS
D) SQL
Answer: B
Explanation: AJAX (Asynchronous JavaScript and XML) allows for asynchronous
communication with the server to fetch user data without reloading the page.
27. Your development team uses Git for version control. One developer
accidentally pushes a broken feature to the main branch. What is the best way to
revert the repository to the last stable commit?
Answer: B
Explanation: git revert safely undoes the changes introduced by the last commit
without altering the project history, creating a new commit that reverts the broken
feature.
223 | P a g e
28. You need to optimize the performance of a binary search tree (BST) after
multiple insertions. What should you consider doing?
Answer: B
Explanation: Converting the BST into a balanced tree (like an AVL tree) ensures that
operations remain efficient with time complexity close to O(log n), optimizing
performance after multiple insertions.
29. Your team is tasked with ensuring that data consistency is maintained during
transactions in a banking application. Which database property is most relevant
in this scenario?
A) Atomicity
B) Isolation
C) Durability
D) Consistency
Answer: D
Explanation: The Consistency property ensures that a transaction takes the database
from one valid state to another, maintaining data integrity, which is crucial for banking
applications.
30. You are developing a web application that allows users to upload images.
What is the best approach to validate the uploaded files to ensure security?
A) Allow any file type and validate the content after upload.
B) Restrict file uploads based on MIME type and file extensions.
C) Use client-side validation only.
D) Store all files on the server without validation.
Answer: B
Explanation: Restricting file uploads based on MIME types and file extensions helps
prevent malicious files from being uploaded, enhancing the application's security.
224 | P a g e
31. Your organization is using a microservices architecture, and one service
needs to communicate with another. Which method would be best for this inter-
service communication?
Answer: B
Explanation: REST API calls provide a stateless, lightweight, and scalable method for
microservices to communicate with one another while adhering to best practices.
32. While working with a linked list, you need to frequently add and remove
nodes from both ends. Which data structure would be the most efficient choice?
Answer: B
Explanation: A Doubly Linked List allows for efficient insertion and deletion at both
ends due to its bidirectional pointers, making it ideal for this requirement.
33. You are conducting a security review of your web application and discover it
is vulnerable to XSS attacks. Which approach should you take to mitigate this
vulnerability?
Answer: B
Explanation: Validating and sanitizing user inputs and encoding outputs is crucial for
preventing XSS attacks by ensuring that any injected scripts are not executed.
225 | P a g e
34. You are designing a web application that requires users to log in securely.
Which method would provide the best security for storing user passwords?
Answer: C
Explanation: Hashing passwords with a strong algorithm (like bcrypt) ensures that
passwords are stored securely and cannot be easily retrieved, even if the database is
compromised.
35. You need to implement a caching mechanism for frequently accessed data in
your application. Which caching strategy would be most effective for improving
performance?
Answer: B
Explanation: A time-based expiration policy (TTL) allows cached data to remain for a
specified duration, ensuring that frequently accessed data is available quickly while still
allowing for updates.
A) Singleton Pattern
B) Factory Pattern
C) Observer Pattern
D) Decorator Pattern
Answer: B
Explanation: The Factory Pattern allows you to create a family of related objects
without specifying their concrete classes, promoting flexibility and reusability in the
codebase.
226 | P a g e
37. Your application needs to perform a complex query that retrieves related
data from multiple tables. What is the most appropriate SQL operation to
achieve this?
Answer: A
Explanation: Using JOIN operations in a SELECT statement allows you to retrieve
related data from multiple tables efficiently, which is essential for complex queries.
Answer: B
Explanation: Conducting meetings to facilitate discussions allows for effective
communication among stakeholders, helping to resolve conflicts and gather
comprehensive feedback.
39. Your team is experiencing issues with database transactions not being rolled
back properly. What property of a transaction is crucial to address this issue?
A) Consistency
B) Isolation
C) Durability
D) Atomicity
Answer: D
Explanation: The Atomicity property ensures that a transaction is treated as a single
unit, meaning that if any part of the transaction fails, the entire transaction is rolled back,
maintaining data integrity.
227 | P a g e
40. In your project, you need to ensure that updates to the same piece of data do
not result in lost changes due to concurrent transactions. What mechanism
would you implement to handle this?
A) Optimistic Locking
B) Synchronous Transactions
C) Eventual Consistency
D) Direct Database Access
Answer: A
Explanation: Optimistic Locking is a concurrency control mechanism that assumes
transactions will not conflict, allowing for a check before committing changes to prevent
lost updates.
Answer: C
Explanation: Implementing multi-threading can improve performance by allowing
applications to handle multiple tasks concurrently, making better use of CPU resources.
42. You notice that a process in your system is stuck in a waiting state, and it
cannot proceed. What could be the cause, and which technique can help to
address it?
Answer: A
Explanation: The situation describes a deadlock where processes are stuck waiting for
228 | P a g e
each other. Implementing a deadlock detection algorithm can help identify and resolve
the issue.
43. You need to optimize the performance of your system's memory. Which
technique would be most effective in reducing the number of page faults?
Answer: B
Explanation: Using Least Recently Used (LRU) page replacement is effective in
reducing page faults by keeping frequently accessed pages in memory.
44. Your application is experiencing latency due to I/O operations. Which I/O
scheduling algorithm would likely improve performance for a workload with
many read requests?
A) FCFS
B) SSTF
C) SCAN
D) CLOOK
Answer: B
Explanation: Shortest Seek Time First (SSTF) reduces latency for read requests by
selecting the I/O request closest to the current head position, minimizing the movement
of the read/write head.
229 | P a g e
Answer: A
Explanation: Allocating more CPU cores to the VM can help distribute the workload
more efficiently and improve overall performance.
46. During a routine check, you discover that your database backups are not
completing successfully. Which best practice should you implement to ensure
successful backups?
Answer: C
Explanation: Monitoring backup logs for errors is crucial to identify issues and ensure
that backups are completed successfully and reliably.
A) SSD
B) HDD
C) Both SSD and HDD
D) None; Use tape storage.
Answer: A
Explanation: Solid State Drives (SSDs) provide faster data access and lower latency
compared to Hard Disk Drives (HDDs), making them ideal for high-performance
applications.
48. In your Unix/Linux environment, you need to manage processes that are not
responding. What command would you use to terminate a specific process?
A) killall
B) ps
C) top
D) ls
230 | P a g e
Answer: A
Explanation: The killall command can terminate all processes with a specified name
or ID, allowing you to manage unresponsive processes effectively.
49. You are tasked with improving the security of your servers. Which practice is
essential for ensuring compliance with security controls?
Answer: A
Explanation: Regularly updating software and applying patches is crucial for
maintaining security and compliance by addressing vulnerabilities.
Answer: B
Explanation: Implementing load balancing and failover systems enhances application
availability by distributing workloads and ensuring that a backup system is available in
case of failure.
51. Your system is using the Round Robin CPU scheduling algorithm. What
effect does this have on process management?
Answer: C
Explanation: Round Robin scheduling allocates equal CPU time to all processes in a
cyclic order, providing fairness in CPU allocation.
231 | P a g e
52. You are designing a backup strategy for a critical database. Which backup
type ensures that you can restore the database to a specific point in time?
A) Full Backup
B) Incremental Backup
C) Differential Backup
D) Snapshot Backup
Answer: D
Explanation: A Snapshot Backup captures the state of the database at a specific point in
time, allowing for precise restoration when needed.
A) Using semaphores.
B) Implementing file I/O.
C) Using shared memory.
D) Increasing thread priority.
Answer: C
Explanation: Shared memory allows multiple processes to access the same memory
space, enabling faster communication compared to other methods like file I/O.
54. In a scenario where multiple applications are competing for CPU time, which
CPU scheduling algorithm would be most effective in minimizing wait time?
A) FCFS
B) SJF
C) Round Robin
D) Priority Scheduling
Answer: B
Explanation: Shortest Job First (SJF) minimizes average wait time by prioritizing
shorter jobs, leading to improved responsiveness in a multi-application environment.
232 | P a g e
55. You are troubleshooting a system that is running slowly due to high memory
usage. Which technique would help you identify which processes are consuming
the most memory?
Answer: B
Explanation: The top command provides a dynamic view of system processes and their
resource consumption, helping to identify memory hogs.
Answer: B
Explanation: Direct-attached storage (DAS) provides high-speed access to storage,
making it ideal for deploying virtual machines efficiently.
57. During system performance testing, you notice that the cache hit ratio is low.
What is a possible solution to improve cache performance?
Answer: A
Explanation: Increasing the size of the cache allows more data to be stored and accessed
quickly, improving the cache hit ratio and overall performance.
233 | P a g e
58. In a scenario where users experience long delays when accessing files, which
disk scheduling algorithm would help reduce these delays?
A) FCFS
B) SSTF
C) Round Robin
D) LRU
Answer: B
Explanation: Shortest Seek Time First (SSTF) minimizes delays by servicing the
closest disk requests first, reducing the average wait time for file access.
59. You are deploying a web application that requires high throughput and low
latency. Which caching strategy would you implement to enhance performance?
A) Read-through caching.
B) Write-back caching.
C) No caching.
D) Distributed caching.
Answer: D
Explanation: Distributed caching allows data to be cached across multiple servers,
improving throughput and reducing latency for web applications.
A) Networking components
B) Backup systems
C) Storage devices
D) CPU
Answer: C
Explanation: Upgrading storage devices can enhance reliability and reduce downtime,
especially if slow or failing disks are causing application issues.
61. A company needs to deploy a customer relationship management (CRM) system that will
allow remote employees to access the application from anywhere. They need scalability,
security, and don't want to manage infrastructure. Which type of cloud service is most suitable
for this requirement?
234 | P a g e
A. IaaS
B. PaaS
C. SaaS
D. Public Cloud
Answer: C (SaaS)
Explanation: SaaS (Software as a Service) allows companies to use software applications over
the internet without managing infrastructure.
62. An organization runs its database on a public cloud but hosts sensitive internal data on a
private cloud. It needs to move data between these clouds securely. Which type of cloud model
does this describe?
A. Private Cloud
B. Public Cloud
C. Hybrid Cloud
D. Community Cloud
63. Your company is deploying an e-commerce application. To handle variable traffic, you need
the ability to scale the infrastructure dynamically based on demand. Which cloud characteristic
best supports this requirement?
A. Elasticity
B. High Availability
C. Security
D. Interoperability
Answer: A (Elasticity)
Explanation: Elasticity allows cloud infrastructure to scale up or down automatically in
response to fluctuating workloads.
64. Your development team needs to deploy and manage containers at scale across multiple
environments. They want a system that allows automation, scaling, and maintenance of
containerized applications. Which cloud-native solution should they use?
235 | P a g e
A. Docker
B. Kubernetes
C. Hyper-V
D. VMware
Answer: B (Kubernetes)
Explanation: Kubernetes is an open-source platform for managing and orchestrating
containerized applications across clusters.
65. A startup needs to deploy its applications on a platform that provides both computing
resources and developer tools but does not want to manage the underlying infrastructure. Which
cloud service model fits this scenario?
A. IaaS
B. PaaS
C. SaaS
D. FaaS
Answer: B (PaaS)
Explanation: PaaS (Platform as a Service) provides a platform to develop, test, and deploy
applications without managing the underlying infrastructure.
66. A large enterprise is migrating its on-premises data center to the cloud. They have numerous
virtual machines running different applications, and they want to retain control over their
operating system and storage. Which type of cloud service is suitable for this use case?
A. SaaS
B. PaaS
C. IaaS
D. FaaS
Answer: C (IaaS)
Explanation: IaaS (Infrastructure as a Service) provides control over computing resources like
virtual machines, storage, and networking.
67. Your team is tasked with choosing between Type 1 and Type 2 hypervisors. The
requirement is to run virtual machines directly on the physical hardware for better performance
and resource management. Which type of hypervisor should they choose?
236 | P a g e
A. Type 1 Hypervisor
B. Type 2 Hypervisor
C. Para Virtualization
D. Full Virtualization
68. You are managing an application with containers that need to communicate with external
APIs securely. Which cloud-native service is most appropriate for managing this API traffic?
69. Your team is implementing a CI/CD pipeline for deploying microservices. You want to
ensure that each commit automatically triggers a build, runs tests, and deploys the application to
the staging environment. Which practice should you use?
A. Continuous Integration
B. Continuous Delivery
C. Continuous Deployment
D. Automated Testing
70. A company’s infrastructure has multiple virtual machines running on VMware. The
management team wants to switch to containers for better efficiency. What is the primary
advantage of using containers over virtual machines?
A. Better Security
B. Faster Boot Time and Resource Efficiency
237 | P a g e
C. Higher Isolation
D. Easier Management
71. Your development team wants to reduce infrastructure management and focus on code. They
plan to use containers but don’t want to handle container orchestration. Which managed
container service should they use?
A. Docker Swarm
B. Kubernetes
C. AWS Fargate
D. OpenShift
72. A financial institution wants to run its core banking application on a private cloud to meet
regulatory requirements while allowing the flexibility to use additional compute resources from a
public cloud during peak loads. Which solution should they implement?
A. Public Cloud
B. Private Cloud
C. Hybrid Cloud
D. Community Cloud
73. A large-scale company has distributed data processing tasks across multiple servers. They
need a solution that offers elasticity, flexibility, and faster parallel execution. Which model
should they opt for?
A. Distributed Computing
B. Cloud Computing
238 | P a g e
C. Server-based Virtualization
D. Microservices
74. Your organization is deploying virtual machines (VMs) across a data center and wants to
reduce the overhead that typically comes with running multiple VMs. Which type of
virtualization provides better efficiency by allowing multiple operating systems to run directly on
the host hardware?
A. Full Virtualization
B. Para Virtualization
C. Type 1 Hypervisor
D. Type 2 Hypervisor
75. You are tasked with ensuring the continuous integration and deployment of a microservices-
based architecture. Which service is best suited to handle the deployment and rollback of
microservices?
A. Docker
B. Jenkins
C. Kubernetes
D. GitLab
Answer: C (Kubernetes)
Explanation: Kubernetes handles the deployment, scaling, and rollback of containerized
microservices effectively.
76. A healthcare startup is developing a sensitive patient data application. They want to use
encryption and make sure that the data is stored securely in the cloud. Which cloud feature
would best protect sensitive data?
A. High Availability
B. End-to-End Encryption
239 | P a g e
C. Elastic Load Balancing
D. Containerization
77. Your company is deploying a critical application with sensitive financial data. They need to
ensure that the cloud environment meets industry-specific security standards. Which type of
cloud environment should they choose?
A. Public Cloud
B. Private Cloud
C. Hybrid Cloud
D. Community Cloud
A. Server-based Virtualization
B. Hypervisor-based Virtualization (Type 1)
C. Hypervisor-based Virtualization (Type 2)
D. Para Virtualization
79. A tech company plans to use containers to package their microservices applications. Which
key benefit of containers makes them suitable for microservices architecture?
A. Low Latency
B. Portability and Consistency
C. Scalability
D. Fault Tolerance
240 | P a g e
Answer: B (Portability and Consistency)
Explanation: Containers provide consistent environments across development, testing, and
production, making them ideal for microservices.
80. A CI/CD pipeline needs to be set up where each change is automatically tested and deployed,
including into production, without manual approval. Which CI/CD practice allows for fully
automated deployment?
A. Continuous Integration
B.Continuous Delivery
C. Continuous Deployment
D. Continuous Testing
81. Your company runs a high-traffic web application on a private cloud. Due to unexpected
demand, the existing infrastructure becomes insufficient. To maintain performance without
scaling the private cloud, you plan to use a public cloud for additional resources. What cloud
service model should you implement?
82. A multinational corporation must deploy its applications across several regions, ensuring low
latency and high availability. The company also needs to dynamically allocate resources based
on varying demands in different regions. Which cloud characteristic is critical for achieving this
goal?
A. Fault Tolerance
B. Geo-distribution
241 | P a g e
C. Elasticity
D. Auto-scaling
Answer: B (Geo-distribution)
Explanation: Geo-distribution allows cloud resources to be deployed in multiple regions,
ensuring low-latency access and availability of services.
83. You have implemented a microservices architecture with multiple containers for a complex
web application. When a component fails, the entire system slows down due to
interdependencies. Which practice can help maintain performance and reduce system-wide
failure?
A. Service Mesh
B. Load Balancer
C. Auto-scaling
D. Blue/Green Deployment
84. Your organization needs to deploy a distributed system across multiple cloud providers to
avoid vendor lock-in. They also want to optimize costs while ensuring workload portability.
What cloud strategy should you adopt?
A. Multi-cloud Strategy
B. Hybrid Cloud Strategy
C. Cloud Bursting
D. Community Cloud
85. A healthcare company wants to deploy its patient management application to the cloud but
needs to comply with data protection regulations like HIPAA. Which cloud computing strategy
should they implement to ensure compliance while maintaining data accessibility?
242 | P a g e
A. Public Cloud
B. Private Cloud
C. Hybrid Cloud
D. Community Cloud
86. A large organization has a high throughput application that needs to maintain consistent
performance despite scaling up or down rapidly. What type of virtualization should be used to
ensure minimal overhead while optimizing resource allocation?
A. Para Virtualization
B. Full Virtualization
C. Server-based Virtualization
D. Containerization
Answer: D (Containerization)
Explanation: Containers share the host OS and use fewer resources than traditional VMs,
making them ideal for high-throughput applications with minimal overhead.
88. Your company is developing a data-heavy application where users from different
geographical regions need to access the same data simultaneously with low latency. Which cloud
architecture would best meet this requirement?
243 | P a g e
A. Multi-region deployment with edge computing
B. Public cloud with global DNS routing
C. Hybrid cloud with CDN integration
D. Private cloud with global load balancing
89. A company wants to automate the deployment process for an application hosted on Docker
containers. They require a tool that will manage both container orchestration and the rolling
updates to ensure zero downtime during the deployment process. What should they use?
A. Jenkins
B. Docker Swarm
C. Kubernetes
D. Ansible
Answer: C (Kubernetes)
Explanation: Kubernetes provides robust container orchestration and supports rolling updates to
ensure zero downtime during deployment.
90. An organization needs to run multiple instances of the same containerized application across
different availability zones for high availability. They want to ensure that each instance uses the
same configuration but is independently manageable. Which technique can they apply?
A. Container Cloning
B. Container Replication
C. Container Swarming
D. Container Spanning
91. A company is working with large datasets and needs to optimize data processing through
distributed parallel computing. They require a solution that distributes tasks across multiple
nodes to speed up computation. Which solution best meets this need?
244 | P a g e
A. Hadoop
B. Kubernetes
C. Docker
D. AWS Lambda
Answer: A (Hadoop)
Explanation: Hadoop is a distributed parallel computing framework designed to process large
datasets by distributing the tasks across multiple nodes.
92. You are building a private cloud for a government agency that requires highly sensitive
information to remain isolated from the public internet. Which type of virtualization would be
most secure and efficient in this scenario?
93. A startup is looking for a cost-effective solution to quickly develop and test new features of
their application in a cloud environment. They do not want to manage infrastructure or worry
about scaling. What cloud service model should they use?
A. IaaS
B. PaaS
C. SaaS
D. FaaS
Answer: B (PaaS)
Explanation: PaaS allows developers to focus on building applications without worrying about
infrastructure management or scalability, making it ideal for testing new features.
245 | P a g e
A. Auto-scaling with Load Balancer
B. Multi-tenancy with Elastic Load Balancing
C. Blue/Green Deployment with Fault Tolerance
D. Immutable Infrastructure
95. You are tasked with setting up a cloud infrastructure where different departments within your
company can share resources but still maintain isolated environments for security. What cloud
computing model is most suitable?
A. Private Cloud
B. Public Cloud
C. Community Cloud
D. Multi-cloud
A. Virtual Machines
B. Hypervisor-based Virtualization
C. Kubernetes with Pod Security Policies
D. Containers with SELinux
246 | P a g e
A. Infrastructure as Code (IaC)
B. Blue/Green Deployment
C. Canary Testing
D. Environment Variable Management
98. Your organization is using Type 2 virtualization for testing, but due to the overhead, the
performance is poor. They plan to move to a Type 1 hypervisor. What is the main benefit of
moving to a Type 1 hypervisor?
A. Increased Security
B. Improved Performance
C. Easier Management
D. Lower Latency
99. A software company is adopting containerization for its development teams, who are using
different OS platforms. They want to ensure that containers can be ported across various
platforms without compatibility issues. What approach should they take?
100. A logistics company uses cloud computing to manage its operations. To prevent vendor
lock-in, they plan to shift some workloads between public cloud providers. What should be
prioritized in the design to enable seamless workload migration?
247 | P a g e
A. Decoupled Architecture
B. Full Virtualization
C. Monolithic Design
D. On-premise Backup
101. Your organization wants to switch from traditional VMs to containers to improve agility
and reduce costs. However, security concerns arise because multiple containers will share the
same OS kernel. How can the company address these security concerns while maintaining the
agility of containers?
102. A company needs to reduce the downtime for its web application during updates. They are
already using containers and want to ensure that the updates can be tested in production without
affecting the end-users. What deployment strategy should they adopt?
A. Rolling Deployment
B. Blue/Green Deployment
C. Canary Deployment
D. Recreate Deployment
103. Your organization uses a cloud service provider for its public-facing services but needs to
process sensitive customer data on-premise. How can you securely integrate the cloud
environment with your on-premise data center while maintaining a unified infrastructure?
248 | P a g e
A. Use Virtual Private Cloud (VPC) with VPN Tunneling
B. Set up a Community Cloud with Security Policies
C. Implement Cloud Bursting with Data Encryption
D. Create a Hybrid Cloud with Direct Network Peering
104. A financial services company wants to migrate their legacy application to the cloud while
ensuring strict compliance with PCI DSS for processing payment card information. What cloud
deployment model is best suited to meet both scalability and compliance requirements?
A. Private Cloud
B. Hybrid Cloud
C. Public Cloud
D. Community Cloud
105. A DevOps team is implementing continuous delivery but wants to ensure that new code
passes a set of automated tests and manual approvals before it can be pushed to production. How
can they achieve this while still minimizing manual intervention?
Answer: C (Set up a Continuous Delivery Pipeline with Security and Compliance Gates)
Explanation: Continuous delivery pipelines can be configured with automated tests and manual
approval gates to ensure that only secure and compliant code reaches production.
106. A SaaS provider wants to implement a multi-tenant architecture on the cloud where each
customer is isolated, but they also need to optimize resource usage by sharing the underlying
infrastructure. Which virtualization approach would be most efficient for this use case?
249 | P a g e
A. Full Virtualization with Type 2 Hypervisors
B. Server-based Virtualization
C. Containerization with Namespace Isolation
D. Para-virtualization with Hypervisors
107. An e-commerce company needs to handle traffic spikes during sales events. Their
infrastructure should automatically scale and ensure that there are no delays in serving requests.
What feature of cloud computing can handle this scenario?
108. Your application requires real-time processing of streaming data and must scale up and
down frequently based on incoming data volumes. What cloud service model and architecture
should you choose?
250 | P a g e
109. A software development team wants to implement continuous integration and also wishes
to monitor performance metrics of the deployed applications in real time. Which combination of
tools or practices should they use?
110. A company using CI/CD pipelines has noticed that their production deployments
occasionally cause performance regressions, but the problem isn’t immediately apparent after the
deployment. What strategy should they implement to catch these regressions early?
251 | P a g e