Read each question, consider the options, then reveal the correct answer and explanation.
100 MCQs10 per page3 of 10
MCQ 21Computer Hardware & Architecture
Which of the following best describes the purpose of 'processor cache inclusivity' policies (inclusive vs. exclusive cache hierarchies)?
A policy that determines which users can access the cache
A design choice determining whether data in a smaller, faster cache level (like L1) must also exist in a larger, slower level (like L3), affecting cache coherence complexity and effective capacity
A synonym for cache write-back policy
A policy used only for network caches
Correct answerB — A design choice determining whether data in a smaller, faster cache level (like L1) must also exist in a larger, slower level (like L3), affecting cache coherence complexity and effective capacity
Explanation
Cache inclusivity policies determine whether data present in a smaller, faster cache level must also be duplicated in a larger, slower level (inclusive), or whether each level can hold entirely distinct data (exclusive), which affects cache coherence protocol complexity and total effective cache capacity.
MCQ 22Computer Networks
Which of the following best describes the purpose of 'network overlay' technologies, such as VXLAN?
To create a virtual network layer on top of an existing physical network infrastructure, allowing logical network segments to span across physical boundaries, such as multiple data centers
To physically replace all underlying network hardware
A synonym for a VPN used only for remote workers
A technique used only for wireless networks
Correct answerA — To create a virtual network layer on top of an existing physical network infrastructure, allowing logical network segments to span across physical boundaries, such as multiple data centers
Explanation
Network overlay technologies like VXLAN create a virtual network layer on top of existing physical infrastructure, allowing logical network segments to extend across physical boundaries (such as different racks, data centers, or cloud regions) without requiring changes to the underlying physical network.
MCQ 23Oop & Uml
What is the purpose of the 'Strategy' pattern combined with dependency injection in modern application design?
To allow different algorithm implementations (strategies) to be injected into a class at runtime or configuration time, rather than being hardcoded, improving flexibility and testability
To restrict a class to a single instance
To define a family of unrelated classes
A pattern used only for UI rendering
Correct answerA — To allow different algorithm implementations (strategies) to be injected into a class at runtime or configuration time, rather than being hardcoded, improving flexibility and testability
Explanation
Combining the Strategy pattern with dependency injection allows different algorithm implementations to be supplied to a class externally (such as via constructor injection) rather than being hardcoded internally, improving flexibility, configurability, and testability through the use of mock strategies.
MCQ 24Oop & Uml
What is the purpose of the 'Template Method' pattern's 'hook method', an optional step subclasses may override but aren't required to?
To force every subclass to override every step of the algorithm
To provide optional extension points within a fixed algorithm structure that subclasses can override if needed, but which have a sensible default (often empty) implementation if left unchanged
A synonym for a pure virtual function that must always be implemented
A concept used only for exception handling
Correct answerB — To provide optional extension points within a fixed algorithm structure that subclasses can override if needed, but which have a sensible default (often empty) implementation if left unchanged
Explanation
A hook method in the Template Method pattern provides an optional extension point within the fixed algorithm structure, with a sensible default (often empty or no-op) implementation, allowing subclasses to customize behavior at that specific point only if they actually need to, without being forced to.
MCQ 25Web Technologies
Which of the following best describes the purpose of the HTML 'picture' element combined with 'source' tags?
To allow a browser to select the most appropriate image source from several options, based on factors like screen size or supported image format
To permanently disable images on slow connections
A synonym for the img tag with no distinction
A technique used only for background videos
Correct answerA — To allow a browser to select the most appropriate image source from several options, based on factors like screen size or supported image format
Explanation
The <picture> element, combined with multiple <source> tags, allows the browser to choose the most appropriate image resource from several candidates based on criteria like viewport size, pixel density, or supported image formats (like WebP versus JPEG), improving performance and art direction control.
MCQ 26Computer Hardware & Architecture
What is the primary purpose of a processor's 'branch delay slot', found in some classic RISC architecture designs like early MIPS?
To specify that the instruction immediately following a branch instruction is always executed regardless of whether the branch is taken, exploiting the pipeline stage that would otherwise be wasted
To permanently disable branching entirely
A synonym for a memory fence
A feature used only for floating-point branches
Correct answerA — To specify that the instruction immediately following a branch instruction is always executed regardless of whether the branch is taken, exploiting the pipeline stage that would otherwise be wasted
Explanation
A branch delay slot is an architectural feature where the instruction immediately following a branch is always executed regardless of the branch outcome, allowing the compiler to fill that slot with useful work rather than wasting the pipeline stage that the branch decision would otherwise leave idle.
MCQ 27Web Technologies
What is the purpose of the PHP 'static' return type declaration used for a method within a class hierarchy?
To indicate that a method returns an instance of the actual called class, even when invoked on a subclass, supporting patterns like fluent builders in inheritance scenarios
To indicate the method belongs to a static (class-level) context only, unrelated to return type
A synonym for the 'self' return type with no distinction
A return type used only for constructors
Correct answerA — To indicate that a method returns an instance of the actual called class, even when invoked on a subclass, supporting patterns like fluent builders in inheritance scenarios
Explanation
The 'static' return type (distinct from the 'self' type) indicates that a method returns an instance of whatever class it was actually called on, even if that's a subclass, which is particularly useful for patterns like fluent method chaining that should work correctly across an inheritance hierarchy.
MCQ 28Oop & Uml
Which of the following best describes the purpose of the 'Bounded Context' concept in domain-driven design?
A single, universal model shared identically across an entire large organization
A synonym for a database table
An explicit boundary within which a particular domain model applies with a consistent, precise meaning, acknowledging that the same term may mean something different in a different context elsewhere in the organization
A concept used only for UI layout
Correct answerC — An explicit boundary within which a particular domain model applies with a consistent, precise meaning, acknowledging that the same term may mean something different in a different context elsewhere in the organization
Explanation
A Bounded Context defines an explicit boundary within which a specific domain model and its terminology apply consistently, acknowledging that large organizations often have multiple valid, context-specific models where the same term (like 'Customer') might mean something different in different areas.
MCQ 29Oop & Uml
What is the purpose of the 'Model-View-ViewModel' (MVVM) architectural pattern, commonly used in UI frameworks?
To restrict a class to a single instance
A synonym for the Repository pattern
To separate the UI (View) from the underlying data and business logic (Model) using an intermediary ViewModel that exposes data and commands the View can bind to, often enabling automatic UI updates
A pattern used only for database access
Correct answerC — To separate the UI (View) from the underlying data and business logic (Model) using an intermediary ViewModel that exposes data and commands the View can bind to, often enabling automatic UI updates
Explanation
MVVM separates the user interface (View) from the underlying data and business logic (Model) through an intermediary ViewModel, which exposes bindable data and commands, often enabling frameworks to automatically synchronize UI changes with underlying data changes, reducing manual UI-update code.
MCQ 30Database Pl/sql
What is the purpose of a 'fan-out' write pattern in NoSQL database design, such as for a social media feed?
To permanently delete old feed entries
To pre-compute and write data to multiple locations (such as each follower's individual feed) at write time, trading increased write cost for much faster read performance
A synonym for database sharding
A technique used only for relational databases
Correct answerB — To pre-compute and write data to multiple locations (such as each follower's individual feed) at write time, trading increased write cost for much faster read performance
Explanation
A fan-out write pattern pre-computes and distributes data to multiple destinations at write time (such as writing a new post to each follower's feed), trading higher write cost and complexity for significantly faster subsequent read performance, which is common in NoSQL-based social feed designs.