1 Which of the following best summarizes the ultimate goal of applying Object-Oriented Programming and design patterns? A To maximize the total lines of code produced. B To create the deepest possible class inheritance hierarchies. C To use all 23 GoF design patterns in every software application. D To build software systems that are maintainable, extensible, robust against change, understandable, and testable over their entire lifecycle.
View answer & explanationFull Screen Mode →
2 What is 'Code Smells' as defined by Martin Fowler and Kent Beck? A Malicious viruses and Trojan horses in source code. B Syntax errors that prevent code from being compiled. C Surface indications in code structure that usually correspond to deeper architectural problems, poor design choices, or maintenance vulnerabilities. D Hardware malfunctions caused by overheating capacitors.
View answer & explanationFull Screen Mode →
3 What is the 'Specification Pattern' in domain-driven object-oriented design? A A written PDF document describing system architecture. B A pattern where business logic rules, validations, and filtering criteria are encapsulated into reusable, combinable boolean specification objects (e.g., spec.IsSatisfiedBy(entity)). C A compiler check that verifies method naming conventions. D A tool that counts lines of code in a project.
View answer & explanationFull Screen Mode →
4 What is the 'Unit of Work' pattern? A A pattern that maintains a list of objects affected by a business transaction and coordinates writing out changes and resolving concurrency issues atomically. B A standard unit of measurement for CPU processor cycles. C A design that assigns exactly one method per developer. D A rule that every class must contain a unit test.
View answer & explanationFull Screen Mode →
5 What is the 'Repository Pattern' in enterprise software architecture? A A memory cache for storing HTTP cookies. B A Git repository hosting open-source libraries. C A centralized file server storing compiled DLL binaries. D An abstraction layer between the domain model and data mapping layers that acts like an in-memory collection of domain objects, isolating the domain from database logic.
View answer & explanationFull Screen Mode →
6 What is the 'Clean Architecture' boundary rule regarding Entity and Use Case communication with the UI or Database? A Entities must directly call SQL stored procedures. B UI components must directly inherit from Domain Entity classes. C Use Cases pass simple, decoupled Plain Old Data Transfer Objects (DTOs) across boundaries rather than exposing rich domain entities directly to the UI or DB. D All data transferred must be formatted in binary assembly.
View answer & explanationFull Screen Mode →
7 What is 'Event Sourcing' in object-oriented domain modeling? A Writing UI event listeners using anonymous lambda functions. B Persisting the state of a business entity as a sequence of immutable state-changing events rather than overwriting its current state in a database. C Sourcing hardware interrupts directly from the motherboard. D Broadcasting database errors over WebSockets.
View answer & explanationFull Screen Mode →
8 What is 'Command-Query Responsibility Segregation' (CQRS)? A An architectural pattern that separates read operations (Queries) from write/update operations (Commands) using different models. B A rule that every database query must contain an SQL join. C A pattern that forbids classes from having getter methods. D A threading model where commands run on GPU and queries on CPU.
View answer & explanationFull Screen Mode →
9 What is the 'Service-Oriented Architecture' (SOA) vs Object-Oriented Programming relationship? A SOA replaces all class definitions with raw byte arrays. B SOA is a direct subclass of OOP written exclusively in C++. C OOP is an obsolete predecessor that cannot be used inside microservices. D OOP focuses on modularity, state encapsulation, and behavior within a single software component/process, while SOA focuses on coarse-grained, network-accessible, autonomous services communicating across boundaries.
View answer & explanationFull Screen Mode →
10 What is the 'Type Object' pattern (also known as Item-Descriptor pattern)? A A design that eliminates all polymorphism from an application. B A pattern where every class has a string type attribute. C Creating a class whose instances represent different conceptual types, allowing new dynamic types to be defined at runtime without writing new code classes. D A compiler optimization that converts objects into structs.
View answer & explanationFull Screen Mode →
11 In C#, what does the Null-Coalescing operator '??' do? A It compares two strings for alphabetical ordering. B It returns the left-hand operand if it is not null; otherwise, it returns the right-hand operand. C It checks whether an object implements a specific interface. D It converts an integer into a nullable boolean.
View answer & explanationFull Screen Mode →
12 In C#, what does the Null-Conditional operator '?.' (safe navigation operator) do? A It evaluates the member access only if the left-hand operand is not null, otherwise returning null without throwing a NullReferenceException. B It asserts that an object is never null, throwing an exception if it is. C It converts a null value to an empty string. D It casts an object to a dynamic type.
View answer & explanationFull Screen Mode →
13 In Java 8 and later, what class was introduced to represent optional values and prevent NullPointerExceptions in return types? A Option<T> B Nullable<T> C Maybe<T> D Optional<T>
View answer & explanationFull Screen Mode →
14 What is the 'Null Object' pattern in object-oriented design? A A design pattern that automatically throws NullPointerException. B Setting all object references to null at the end of every method. C Providing an object that implements an interface with neutral, do-nothing behavior to represent the absence of a value, eliminating explicit null checks. D A database constraint that forbids null columns.
View answer & explanationFull Screen Mode →
15 What is the 'Fail-Fast' iterator behavior in standard Java collections (like ArrayList and HashMap)? A Stopping the iteration only after 100 iterations. B Immediately throwing a ConcurrentModificationException if the collection is structurally modified by any thread while iteration is in progress. C Writing collection contents to disk before iteration. D Skipping null elements automatically during iteration.
View answer & explanationFull Screen Mode →
16 What is the 'Fail-Safe' iterator behavior in Java collections (such as ConcurrentHashMap)? A Iterating over a clone or snapshot of the collection, allowing modifications during iteration without throwing ConcurrentModificationException. B Terminating the program if any element in the collection is null. C Locking all CPU cores until iteration completes. D Preventing any items from being added to the collection forever.
View answer & explanationFull Screen Mode →
17 Why is catching a generic 'Exception' or 'Throwable' considered a bad practice in robust OOP design? A It causes the compiler to generate invalid assembly code. B It automatically terminates the operating system. C It corrupts the CPU stack registers. D It catches unexpected system errors and runtime exceptions (like NullPointerException or OutOfMemoryError) that the handler was not designed to recover from, masking bugs.
View answer & explanationFull Screen Mode →
18 What is 'Exception Chaining' (or Exception Wrapping) in object-oriented exception handling? A Converting all exceptions into string error codes. B Throwing five exceptions sequentially in a single line. C Catching a low-level or implementation-specific exception and throwing a higher-level domain exception that encapsulates the original exception as its 'cause'. D Suppressing exceptions completely using an empty catch block.
View answer & explanationFull Screen Mode →
19 Under what circumstance IS an Object Pool pattern still justified and recommended? A When creating basic string or integer variables. B When the objects manage expensive, scarce system/external resources (such as database connections, thread pools, or large network sockets). C When creating simple DTOs for REST endpoints. D When writing unit test helper methods.
View answer & explanationFull Screen Mode →
20 Why is general-purpose 'Object Pooling' often considered an anti-pattern in modern Java or .NET applications? A Modern generational garbage collectors allocate and reclaim short-lived objects faster than the synchronization and maintenance overhead of custom object pools. B Object pools are forbidden by modern operating systems. C Object pools permanently disable multithreading. D Object pools double the execution time of virtual methods.
View answer & explanationFull Screen Mode →
21 What is the 'Active Object' concurrency design pattern? A A class that cannot be garbage collected while the program is open. B An object that triggers continuous animation updates on a screen. C An object that occupies 100% CPU capacity. D A pattern that decouples method execution from method invocation for objects that reside in their own thread of control, processing client requests asynchronously via a queue.
View answer & explanationFull Screen Mode →
22 What is the purpose of a 'WeakReference' in object-oriented programming? A A reference that throws an exception whenever its target is accessed. B A pointer with only 16-bit address resolution. C A reference that allows referencing an object without preventing it from being reclaimed by the garbage collector. D A reference that can only point to primitive integers.
View answer & explanationFull Screen Mode →
23 In managed languages like C# and Java, how can an object leak memory if a garbage collector is running? A By having too many virtual functions in the class definition. B By remaining unintentionally reachable from a live GC Root (e.g., via forgotten event listeners, static collections, or unbounded caches). C By allocating memory inside a recursive function. D By running on a computer with less than 4GB of RAM.
View answer & explanationFull Screen Mode →
24 In managed object-oriented runtimes (like Java JVM and .NET CLR), what constitutes a 'Garbage Collection Root' (GC Root)? A Local variables on thread call stacks, active thread objects, static class fields, and JNI/native references. B Any object stored in the heap regardless of references. C All private instance variables inside an active object. D Temporary files stored in the operating system temp folder.
View answer & explanationFull Screen Mode →
25 Why are immutable objects considered inherently thread-safe in concurrent object-oriented programming? A They automatically terminate background worker threads. B They run exclusively on isolated thread processors. C They are placed in the CPU L2 cache permanently. D Their state cannot be modified after construction, preventing race conditions, data races, and the need for locks or synchronization.
View answer & explanationFull Screen Mode →
26 What is 'Lava Flow' (or Dead Code) in legacy systems? A Continuous automated deployment pipeline failure. B A system overheating CPU cores due to an infinite loop. C Old, obsolete code and classes left in a production codebase because developers are afraid to remove them, unsure of what might break. D Database transactions that commit out of order.
View answer & explanationFull Screen Mode →
27 What is 'Speculative Generality'? A Writing speculative CPU branch execution algorithms. B Writing unused abstract classes, hooks, parameters, and design patterns anticipating hypothetical future requirements that never materialize. C Creating generic variables without type constraints in C#. D Estimating project delivery dates without specifications.
View answer & explanationFull Screen Mode →
28 What is 'Refused Bequest'? A A code smell where a subclass inherits methods and data from a base class but uses only a tiny fraction of them and overrides the rest to throw exceptions or do nothing. B A class that refuses to compile due to missing header files. C A program that ignores garbage collection suggestions. D A method that rejects null arguments.
View answer & explanationFull Screen Mode →
29 What is the 'Middle Man' code smell? A An interface with exactly two implementing classes. B A middleware server that logs HTTP requests. C A developer who reviews code before merging. D A class that performs too much delegation, where most of its methods do nothing more than forward calls directly to another component.
View answer & explanationFull Screen Mode →
30 What is the 'Data Clumps' code smell? A An array containing mixed object types in dynamically typed languages. B A cluster of corrupted database records. C Groups of fields or parameters that frequently appear together across multiple classes and methods (e.g., startDate and endDate), suggesting they should be combined into an object. D A collection that exceeds 10,000 items in memory.
View answer & explanationFull Screen Mode →
31 What is 'Primitive Obsession' in object-oriented code? A Refusing to upgrade to modern 64-bit operating systems. B The overuse of primitive data types (strings, ints, floats) to represent domain concepts (such as Money, ZipCode, PhoneNumber, Email) instead of creating dedicated Value Objects. C Writing assembly instructions inside high-level methods. D Using integer loops instead of iterator objects.
View answer & explanationFull Screen Mode →
32 What is the 'Inappropriate Intimacy' code smell? A Two classes that spend too much time delving into each other's private or internal details, violating encapsulation. B A developer writing unit tests for another developer's code. C A subclass having the same name as a superclass. D Two packages referencing each other's documentation.
View answer & explanationFull Screen Mode →
33 What is the code smell 'Divergent Change'? A Converting synchronous code into asynchronous tasks. B Modifying two classes at the exact same millisecond. C A version control branch that cannot be merged. D A situation where a single class is repeatedly modified in different ways for different, unrelated business reasons.
View answer & explanationFull Screen Mode →
34 What is the code smell 'Shotgun Surgery'? A Refactoring code without running unit tests first. B Deleting random unused methods across the codebase. C A situation where making a single conceptual change in the application requires making many small edits across multiple different classes. D Replacing all inheritance with global variables.
View answer & explanationFull Screen Mode →
35 What code smell is termed 'Feature Envy'? A A programmer adding unnecessary experimental features to a project. B A method that invokes more methods and accesses more fields of another class than of the class it actually belongs to. C A class having multiple constructors with similar parameters. D A class that cannot be extended due to a final modifier.
View answer & explanationFull Screen Mode →
36 In a UML Sequence Diagram, how is a 'Return Message' depicted? A A dashed line with an open arrowhead pointing back to the caller B A solid line with a hollow diamond C A double solid line with a circle D A dotted red arrow pointing to the root
View answer & explanationFull Screen Mode →
37 In a UML Sequence Diagram, how is a 'Synchronous Message' visually distinguished from an 'Asynchronous Message'? A Synchronous messages always point upward, while asynchronous messages point downward. B A synchronous message is dashed, while an asynchronous message is solid. C An asynchronous message has a red color, while a synchronous message is blue. D A synchronous message has a solid line with a solid filled arrowhead, whereas an asynchronous message has a solid line with an open arrowhead.
View answer & explanationFull Screen Mode →
38 In a UML Sequence Diagram, what is an 'Activation Box' (or execution specification)? A A dialog box that prompts user input. B A button that triggers the simulation. C A thin vertical rectangle on a lifeline indicating the period during which an object is actively executing an operation. D A node representing the physical server hardware.
View answer & explanationFull Screen Mode →
39 In a UML Sequence Diagram, what does a vertical dashed line descending from an object box represent? A An active database connection B A Lifeline representing the existence of the participant object over time C A thread that has terminated unexpectedly D A memory boundary between CPU registers
View answer & explanationFull Screen Mode →
40 In a UML class diagram, how is a 'static' (class-level) attribute or method represented? A The attribute or method name is underlined. B The attribute name is enclosed in brackets []. C The method name is prefixed with an exclamation mark (!). D The method name is written in bold font.
View answer & explanationFull Screen Mode →
41 How are abstract classes and abstract methods typically represented in a UML class diagram? A They are drawn using red borders. B Their names are underlined. C Their names are written inside double parentheses. D Their names are displayed in italics, or annotated with the stereotype <<abstract>>.
View answer & explanationFull Screen Mode →
42 In a UML class diagram, what does a multiplicity of '1..*' on an association line mean? A Zero or one instance B Exactly one instance only C At least one, but potentially many instances D Any number of instances, including zero
View answer & explanationFull Screen Mode →
43 In a UML class diagram, how is a 'Dependency' relationship (USES-A) between two classes represented? A A solid line with a filled diamond B A dashed line with an open arrowhead pointing to the dependent supplier class C A solid line without any arrows D A dashed line with a solid circle
View answer & explanationFull Screen Mode →
44 In a UML class diagram, how is 'Composition' visually distinguished from 'Aggregation'? A Composition is depicted with a solid filled black diamond, whereas Aggregation is depicted with an open hollow white diamond. B Composition is depicted with an open hollow diamond, whereas Aggregation uses a filled black diamond. C Composition uses a dashed arrow, whereas Aggregation uses a double solid line. D Composition is represented with a circle, whereas Aggregation uses a square.
View answer & explanationFull Screen Mode →
45 In a UML class diagram, how is an 'Interface Realization' (implementation) relationship represented? A A curved line with double arrows B A solid line with a hollow closed triangle arrowhead pointing to the interface C A solid line with a hollow diamond D A dashed line with a hollow closed triangle arrowhead pointing to the interface
View answer & explanationFull Screen Mode →
46 In a UML class diagram, how is an 'Inheritance' (Generalization) relationship depicted between a subclass and a superclass? A A solid line with a filled diamond at the superclass end B A dashed line with a hollow closed triangle arrowhead pointing to the superclass C A solid line with a hollow closed triangle arrowhead pointing to the superclass D A dashed line with an open arrow pointing to the subclass
View answer & explanationFull Screen Mode →
47 In a UML class diagram, which symbol represents 'package' (or default) visibility? A # B ~ C - D *
View answer & explanationFull Screen Mode →
48 In a UML class diagram, which symbol represents 'protected' visibility? A # B + C - D ~
View answer & explanationFull Screen Mode →
49 In a UML class diagram, which symbol represents 'private' visibility? A ~ B + C # D -
View answer & explanationFull Screen Mode →
50 In a UML class diagram, which symbol represents 'public' visibility for a member attribute or method? A # B - C + D ~
View answer & explanationFull Screen Mode →