Each question below shows the correct answer with a full explanation. Use these to build conceptual understanding before attempting a timed quiz.
Advanced Programming ConceptsEasy
Q1. What is an event in event-driven programming?
- A.An action or occurrence that a program can respond to✓ Correct
- B.A function that performs a specific task when called
- C.A syntax error in the source code of the program
- D.A variable that stores data values during execution
Explanation
An event is a signal that something has happened that the program can respond to through event handlers.
Report an error in this question
Advanced Programming ConceptsEasy
Q2. What is refactoring?
- A.Adding new features and functionality to the existing codebase
- B.Restructuring code to improve structure without changing behavior✓ Correct
- C.Deleting unused code and removing deprecated function calls
- D.Rewriting the entire codebase from scratch completely
Explanation
Refactoring improves code quality and maintainability while preserving functionality.
Report an error in this question
Advanced Programming ConceptsEasy
Q3. What is the Singleton pattern?
- A.Ensuring a class has only one global instance✓ Correct
- B.Creating many instances of a class at once
- C.An error pattern for handling exceptions
- D.A function pattern for recursive operations
Explanation
The Singleton pattern restricts a class to a single instance with global access.
Report an error in this question
Advanced Programming ConceptsEasy
Q4. What is abstraction in programming?
- A.A primitive data type for storing numeric values only
- B.Making code unnecessarily complex and hard to follow
- C.Hiding details while exposing essential features only✓ Correct
- D.A type of error that occurs during program execution
Explanation
Abstraction simplifies complex systems by hiding implementation details and exposing only the necessary interface.
Report an error in this question
Advanced Programming ConceptsEasy
Q5. What is a data structure?
- A.A way of organizing data for efficient access✓ Correct
- B.A programming language for writing software
- C.A function that performs a specific operation
- D.A database management system for storage
Explanation
A data structure is a way of organizing data for efficient operations.
Report an error in this question
Advanced Programming ConceptsEasy
Q6. What is recursion?
- A.A function calling itself to solve problems✓ Correct
- B.An error in the program source code
- C.A type of iterative loop construct
- D.A data structure for storing elements
Explanation
Recursion is when a function calls itself, breaking down a problem into simpler sub-problems.
Report an error in this question
Advanced Programming ConceptsEasy
Q7. What is an annotation/decorator?
- A.Metadata or wrapper adding behavior without modifying code✓ Correct
- B.A loop construct for iterating over collection elements
- C.A comment in the source code for documentation
- D.A variable that stores a single data value in memory
Explanation
Annotations/decorators provide metadata or modify behavior without changing the underlying code.
Report an error in this question
Advanced Programming ConceptsEasy
Q8. What is a generic/template in programming?
- A.A design pattern for building complex object hierarchies
- B.Code that works with any type specified at compile time✓ Correct
- C.A default value assigned to variables automatically
- D.A runtime check that validates data types dynamically
Explanation
Generics/templates allow writing code parameterized by type, enabling type-safe reuse.
Report an error in this question
Advanced Programming ConceptsEasy
Q9. What is a design pattern?
- A.A reusable solution template for common software problems✓ Correct
- B.A type of algorithm for data processing
- C.A user interface visual design layout
- D.A programming language for building applications
Explanation
A design pattern is a general, reusable solution to a commonly occurring problem in software design.
Report an error in this question
Advanced Programming ConceptsMedium
Q10. What is the Strategy pattern?
- A.A sorting method that orders elements in a specific sequence
- B.A game strategy for winning competitions against opponents
- C.A pattern defining interchangeable algorithms varying independently✓ Correct
- D.A caching technique for storing frequently accessed data values
Explanation
The Strategy pattern encapsulates algorithms in separate classes with a common interface, allowing runtime selection.
Report an error in this question
Advanced Programming ConceptsMedium
Q11. What is the difference between aggregation and composition in UML?
- A.Composition implies weaker ownership than aggregation in all designs
- B.Aggregation implies stronger ownership than composition in all cases
- C.Aggregation implies weak ownership; composition implies strong ownership✓ Correct
- D.They are identical concepts with no practical differences at all
Explanation
Aggregation means parts can exist without the whole. Composition means parts are destroyed when the whole is destroyed.
Report an error in this question
Advanced Programming ConceptsMedium
Q12. What is the Iterator pattern?
- A.Accessing collection elements sequentially without exposing internals✓ Correct
- B.A search technique for finding elements in a sorted collection
- C.A sorting algorithm for ordering elements in ascending sequence
- D.A loop construct for iterating over elements in arrays
Explanation
The Iterator pattern provides a standard interface for traversing different collection types.
Report an error in this question
Advanced Programming ConceptsMedium
Q13. What is the Adapter pattern?
- A.A data converter for transforming file format encodings
- B.A sorting adapter for converting between sort algorithms
- C.A pattern wrapping one interface to match another interface✓ Correct
- D.A physical power adapter for electrical devices
Explanation
The Adapter pattern wraps an existing class with a new interface, allowing incompatible interfaces to collaborate.
Report an error in this question
Advanced Programming ConceptsMedium
Q14. What is the Factory pattern?
- A.A singleton variant that creates exactly one object instance
- B.A manufacturing system for producing physical goods
- C.An iterator pattern for traversing collections sequentially
- D.A pattern providing an interface for creating objects flexibly✓ Correct
Explanation
The Factory pattern delegates object creation to a factory method, allowing code to work with abstract types.
Report an error in this question
Advanced Programming ConceptsEasy
Q15. What is the DRY principle?
- A.A testing principle for validating dry run output
- B.A moisture management rule for server rooms
- C.Avoid duplicating code by abstracting common logic✓ Correct
- D.A drying algorithm for removing duplicate data
Explanation
DRY advocates reducing code duplication by extracting common logic into reusable components.
Report an error in this question
Advanced Programming ConceptsMedium
Q16. What is the Observer pattern?
- A.A logging pattern for recording application events to a file
- B.A security pattern for authenticating users before granting access
- C.A subject notifies dependent observers of state changes automatically✓ Correct
- D.Watching code execute step by step in the debugger tool
Explanation
The Observer pattern defines a one-to-many dependency where the subject notifies all observers of state changes.
Report an error in this question
Advanced Programming ConceptsMedium
Q17. What is the Model-View-Controller (MVC) pattern?
- A.A database pattern for organizing tables and their relationships
- B.A testing framework for writing and running automated test suites
- C.Separating application into Model (data), View (UI), Controller (logic)✓ Correct
- D.A data structure for organizing elements in memory efficiently
Explanation
MVC separates concerns: Model manages data, View handles display, Controller processes user input.
Report an error in this question
Advanced Programming ConceptsMedium
Q18. What is lazy loading?
- A.Loading resources in reverse chronological order
- B.Deferring initialization until actually needed✓ Correct
- C.A slow loading technique for large file downloads
- D.Loading all data and resources at startup time
Explanation
Lazy loading postpones resource initialization until it is first needed, improving startup performance.
Report an error in this question
Advanced Programming ConceptsMedium
Q19. What is the Decorator pattern?
- A.A user interface pattern for visual element styling
- B.A logging tool for recording method execution traces
- C.Adding annotations to class methods for documentation
- D.Dynamically adding responsibilities to objects through wrapping✓ Correct
Explanation
The Decorator pattern wraps an object with additional behavior dynamically.
Report an error in this question
Advanced Programming ConceptsMedium
Q20. What is the difference between composition and inheritance as design strategies?
- A.Composition offers flexibility and loose coupling; inheritance is tighter✓ Correct
- B.They are identical design strategies with no practical differences
- C.Inheritance is always better than composition in every design scenario
- D.Composition is always slower in execution than inheritance-based designs
Explanation
Composition provides flexibility and loose coupling. Inheritance provides code reuse but creates tight coupling.
Report an error in this question
Advanced Programming ConceptsHard
Q21. What is the actor model?
- A.Independent units communicating via asynchronous message passing✓ Correct
- B.A relational database model for organizing table schemas
- C.A user interface pattern for laying out visual components
- D.A design pattern for video game character development
Explanation
The actor model treats actors as fundamental units communicating only through asynchronous messages, avoiding shared state.
Report an error in this question
Advanced Programming ConceptsHard
Q22. What is a monad in functional programming?
- A.A single immutable value in the program code
- B.A pattern wrapping values for chaining operations with effects✓ Correct
- C.A primitive data type for storing basic values in memory
- D.A loop construct for iterating through collection elements
Explanation
A monad wraps a value in a computational context and provides bind/flatMap to chain operations while managing side effects.
Report an error in this question
Advanced Programming ConceptsHard
Q23. What is the difference between a microkernel and a monolithic architecture?
- A.Microkernel architecture is always larger in size than monolithic
- B.Monolithic architecture is always more modular than microkernel
- C.Microkernel has minimal core with plugins; monolithic is all-in-one✓ Correct
- D.There is no meaningful difference between the two architecture styles
Explanation
Microkernel has a small core with functionality added via plugins. Monolithic contains all functionality in one codebase.
Report an error in this question
Advanced Programming ConceptsHard
Q24. What is reactive programming?
- A.Procedural programming with sequential statement execution
- B.A paradigm focused on async data streams and change propagation✓ Correct
- C.Programming with user interface reactions and animations
- D.Event-driven programming using callbacks and event listeners
Explanation
Reactive programming models computation as reactions to data changes, using observable streams.
Report an error in this question
Advanced Programming ConceptsHard
Q25. What is the Visitor pattern and when would you use it?
- A.Defining new operations on objects without changing their classes✓ Correct
- B.An authentication pattern for verifying user identity securely
- C.A logging pattern for recording all application events to files
- D.Tracking website visitors for analytics and usage metrics
Explanation
The Visitor pattern separates algorithms from objects, enabling new operations without modifying existing classes.
Report an error in this question
Advanced Programming ConceptsHard
Q26. What is the Command Query Responsibility Segregation (CQRS) pattern?
- A.An authentication method for verifying user credentials
- B.A database query for selecting records from tables
- C.A sorting algorithm for ordering elements in collections
- D.Separating read and write operations into different models✓ Correct
Explanation
CQRS separates the read model from the write model, allowing independent scaling and optimization.
Report an error in this question
Advanced Programming ConceptsHard
Q27. What is a domain-specific language (DSL)?
- A.A general-purpose programming language for all domains
- B.A scripting language for automating repetitive tasks
- C.A specialized language designed for a particular domain✓ Correct
- D.An assembly language for low-level hardware programming
Explanation
A DSL is tailored to a specific problem domain, offering more expressive notation for domain tasks.
Report an error in this question
Advanced Programming ConceptsHard
Q28. What is the hexagonal architecture (ports and adapters)?
- A.A network topology for connecting distributed system nodes
- B.A six-sided geometric design for user interfaces
- C.Isolating core domain from externals through ports and adapters✓ Correct
- D.A database design for organizing tables and relationships
Explanation
Hexagonal architecture defines ports for the core domain and adapters for external concerns, making the core independent of infrastructure.
Report an error in this question
Advanced Programming ConceptsHard
Q29. What is algebraic effects as a programming concept?
- A.Expressing side effects as values handled by effect handlers separately✓ Correct
- B.An optimization technique for improving numerical computation speed
- C.Mathematical operations performed on algebraic expressions
- D.A specialized data structure for storing algebraic computation results
Explanation
Algebraic effects separate effect definition from implementation, allowing functions to perform effects handled by enclosing handlers.
Report an error in this question
Advanced Programming ConceptsHard
Q30. What is aspect-oriented programming (AOP)?
- A.A subtype of object-oriented programming methodology
- B.Separating cross-cutting concerns from business logic via aspects✓ Correct
- C.A user interface pattern for organizing visual layout components
- D.A testing approach for validating application behavior thoroughly
Explanation
AOP modularizes cross-cutting concerns that cut across multiple classes, weaving them into the code at join points.
Report an error in this question