Software Architecture Interview Questions
- 25Unfamiliar
- 0Learning
- 0Familiar
- 0Mastered
When explaining your project architecture, what is the recommended approach according to the video?
When explaining your project architecture, what is the recommended approach according to the video?
25 questions
- 1
When explaining your project architecture, what is the recommended approach according to the video?
- A
Start with design patterns, then architecture patterns, then layers
- B
Start from the 50,000 ft level (layers), then 30,000 ft level (architecture patterns), then 10,000 ft level (design patterns)
- C
Focus only on the cloud hosting infrastructure
- D
Only talk about the MVC pattern used in the project
Correct answer
BStart from the 50,000 ft level (layers), then 30,000 ft level (architecture patterns), then 10,000 ft level (design patterns)
Explanation
The video suggests gliding from the 50,000 ft level (layers of the project) to the 30,000 ft level (architecture patterns inside layers) to the 10,000 ft level (specific design patterns used).
- A
- 2
What does an architecture style primarily define?
- A
The exact programming language to use
- B
A block diagram with predefined components
- C
Guidelines and principles for how a solution should be shaped
- D
A specific code-level implementation with context
Correct answer
CGuidelines and principles for how a solution should be shaped
Explanation
Architecture style, like REST, provides guidelines and principles, not specific code or block diagrams. It is at a high level (50,000 ft).
- A
- 3
Which of the following is considered an architecture pattern?
- A
Iterator pattern
- B
Singleton pattern
- C
REST
- D
MVC
Correct answer
DMVC
Explanation
MVC is an architecture pattern that defines a structure (model-view-controller). REST is an architecture style, singleton and iterator are design patterns.
- A
- 4
What is the key characteristic of a design pattern according to the video?
- A
It is a block-level diagram with no code specificity
- B
It defines guidelines and principles for a solution
- C
It is always related to network communication
- D
It has a very specific context and often clear code structure
Correct answer
DIt has a very specific context and often clear code structure
Explanation
Design patterns have a specific context and the code is often clear and similar across languages (e.g., singleton pattern has private constructor, static keyword).
- A
- 5
What are the three categories of design patterns from the Gang of Four?
- A
Creational, Functional, and Reactive
- B
Structural, Behavioral, and Concurrent
- C
Creational, Structural, and Behavioral
- D
Creational, Behavioral, and Architectural
Correct answer
CCreational, Structural, and Behavioral
Explanation
The three categories are creational (object creation), structural (object composition/structure), and behavioral (communication between objects).
- A
- 6
Which pattern is an example of a creational design pattern?
- A
Mediator pattern
- B
Adapter pattern
- C
Iterator pattern
- D
Singleton pattern
Correct answer
DSingleton pattern
Explanation
Singleton pattern deals with object creation (single instance), so it is creational. Adapter is structural, iterator and mediator are behavioral.
- A
- 7
Which pattern helps iterate over a collection without exposing its underlying representation?
- A
Iterator pattern
- B
Factory pattern
- C
Composite pattern
- D
Chain of Responsibility pattern
Correct answer
AIterator pattern
Explanation
Iterator pattern allows sequential access to elements without knowing the internal structure (e.g., list, dictionary).
- A
- 8
What is the primary purpose of the singleton pattern?
- A
To create multiple instances of a class with different configurations
- B
To encapsulate object creation logic in a separate class
- C
To create a single instance of an object that can be shared across the application
- D
To allow incompatible interfaces to work together
Correct answer
CTo create a single instance of an object that can be shared across the application
Explanation
Singleton pattern ensures only one instance is created and provides global access to it.
- A
- 9
Which of the following is a common use case for the singleton pattern?
- A
Iterating over a collection
- B
Caching data like country or state masters
- C
Creating objects with many optional parameters
- D
Handling UI events in MVC
Correct answer
BCaching data like country or state masters
Explanation
Singleton is often used for caching to avoid repeated database calls, as mentioned in the video with country/state masters.
- A
- 10
What is the purpose of the private constructor in a singleton class?
- A
To allow inheritance from the class
- B
To prevent external instantiation of the class
- C
To enable thread safety
- D
To implement lazy loading
Correct answer
BTo prevent external instantiation of the class
Explanation
A private constructor prevents other classes from creating instances, ensuring that only the singleton class itself controls instantiation.
- A
- 11
Why is thread safety important in a singleton pattern?
- A
To improve the performance of the singleton by avoiding locks
- B
To ensure that the singleton instance is created only once in a multi-threaded environment
- C
To allow multiple threads to access the instance simultaneously without blocking
- D
To enable the singleton to be used in a single-threaded environment only
Correct answer
BTo ensure that the singleton instance is created only once in a multi-threaded environment
Explanation
In a multi-threaded environment, without thread safety, two threads might create separate instances or partially initialize the object, breaking the singleton guarantee.
- A
- 12
In the double null check pattern for singleton, what is the purpose of the outer null check?
- A
To perform lazy loading
- B
To avoid unnecessary locking for performance
- C
To ensure thread safety
- D
To enforce the private constructor
Correct answer
BTo avoid unnecessary locking for performance
Explanation
The outer check avoids entering the lock block if the instance is already created, saving the overhead of acquiring and releasing a lock.
- A
- 13
What is the difference between a static class and a singleton pattern?
- A
A static class can implement interfaces, but a singleton cannot
- B
A static class is a design pattern, while singleton is a programming keyword
- C
There is no difference; they are exactly the same
- D
A singleton pattern includes thread safety, lazy loading, and performance considerations beyond just using the static keyword
Correct answer
DA singleton pattern includes thread safety, lazy loading, and performance considerations beyond just using the static keyword
Explanation
Static is a keyword; singleton is a pattern that uses static but also adds thread safety, lazy loading, and supports OOP features like inheritance and interfaces.
- A
- 14
Which C# keyword can simplify singleton implementation by providing built-in lazy loading and thread safety?
- A
Lazy
- B
lock
- C
volatile
- D
readonly
Correct answer
ALazy
Explanation
The
Lazy<T>class handles lazy initialization and thread safety, reducing the singleton code to a single line for property access. - A
- 15
What is the term for a view in MVP that does nothing except forward requests to the presenter and respond to callbacks?
- A
Smart view
- B
Active view
- C
Passive view
- D
Dumb view
Correct answer
CPassive view
Explanation
In MVP, the view is passive because it submits itself to the presenter and the presenter does all the work; the view only updates when told.
- A
- 16
In MVC, which component is hit first when a user makes a request?
- A
Model
- B
Presenter
- C
Controller
- D
View
Correct answer
CController
Explanation
In MVC, the controller receives the user input first, then loads the model, and finally passes the data to the view.
- A
- 17
In MVP, how does the presenter update the view?
- A
Through automated bindings defined in XAML
- B
Directly by calling methods on the view object
- C
By returning a new view instance
- D
By raising events that the view listens to
Correct answer
BDirectly by calling methods on the view object
Explanation
The presenter holds a reference to the view (often via an interface) and calls methods on it to update the UI.
- A
- 18
What is the role of the interface in MVP?
- A
To handle dependency injection
- B
To act as a mediator for callbacks between the view and the presenter
- C
To define the data model structure
- D
To implement automated bindings
Correct answer
BTo act as a mediator for callbacks between the view and the presenter
Explanation
The interface defines the operations the view can perform, and the presenter uses it to call back the view without depending on a concrete view class.
- A
- 19
What key feature enables MVVM to reduce code-behind compared to MVP?
- A
Removal of the model layer
- B
Automated bindings and commands
- C
Use of a separate presenter class
- D
Direct manipulation of UI elements from the model
Correct answer
BAutomated bindings and commands
Explanation
Automated bindings (e.g., in WPF or Angular) allow the view model to update the view without explicit code, unlike MVP where the presenter must call methods on the view.
- A
- 20
According to the video, what primarily determines whether to use MVC, MVP, or MVVM?
- A
The technology stack used (e.g., view-first vs controller-first, presence of bindings)
- B
The programming language (Java vs C#)
- C
The size of the project
- D
The number of developers on the team
Correct answer
AThe technology stack used (e.g., view-first vs controller-first, presence of bindings)
Explanation
The choice is mostly dictated by the technology: if the view loads first and has bindings, MVVM; if view loads first but no bindings, MVP; if controller loads first, MVC.
- A
- 21
What is the difference between a layer and a tier?
- A
They are synonyms with no difference
- B
A layer is physical deployment, a tier is logical separation
- C
A layer includes only the database, a tier includes everything
- D
A layer is logical separation, a tier is physical deployment
Correct answer
DA layer is logical separation, a tier is physical deployment
Explanation
A layer refers to logical organization (e.g., presentation, business, data) while a tier refers to how those layers are deployed on different machines or servers.
- A
- 22
What happens when you move from a three-layer architecture to a three-tier architecture?
- A
Communication complexity increases due to network calls between tiers
- B
The database is no longer needed
- C
The number of layers decreases
- D
The project becomes simpler to develop
Correct answer
ACommunication complexity increases due to network calls between tiers
Explanation
Three-tier means deploying layers on separate servers, which adds network communication overhead and requires handling HTTP, TCP/IP, or queues.
- A
- 23
Which of the following is an example of a structural design pattern?
- A
Singleton
- B
Observer
- C
Factory
- D
Adapter
Correct answer
DAdapter
Explanation
Adapter pattern deals with the composition and structure of classes to make incompatible interfaces work together, so it is structural.
- A
- 24
What is the term for a class that encapsulates a model and provides everything needed for the view (data and aesthetics)?
- A
Service
- B
Presenter
- C
Controller
- D
View Model
Correct answer
DView Model
Explanation
A view model class wraps the model and provides data, colors, enabling/disabling, etc., exactly as described for MVVM and also generally in other patterns.
- A
- 25
According to the video, non-GOF patterns are also important to mention. Which of the following is a non-GOF pattern?
- A
Repository
- B
Singleton
- C
Adapter
- D
Decorator
Correct answer
ARepository
Explanation
Repository pattern is not part of the original Gang of Four patterns; it is a newer pattern commonly used in data access.
- A

Ask anything
We've read this whole study set, so questions about it get the best answers.