1. Home
  2. Explore
  3. Computer Science
  4. Software Architecture Interview Questions

Study methods

Flashcards
Quiz
Fill in the blanks
Written test
Lesson
Notes
Podcast
Content

Software Architecture Interview Questions

  • 25Unfamiliar
  • 0Learning
  • 0Familiar
  • 0Mastered
Topic: Explaining Project Architecture

When explaining your project architecture, what is the recommended approach according to the video?

25 questions

  1. 1

    When explaining your project architecture, what is the recommended approach according to the video?

    1. A

      Start with design patterns, then architecture patterns, then layers

    2. B

      Start from the 50,000 ft level (layers), then 30,000 ft level (architecture patterns), then 10,000 ft level (design patterns)

    3. C

      Focus only on the cloud hosting infrastructure

    4. D

      Only talk about the MVC pattern used in the project

    Correct answer
    B

    Start 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).

  2. 2

    What does an architecture style primarily define?

    1. A

      The exact programming language to use

    2. B

      A block diagram with predefined components

    3. C

      Guidelines and principles for how a solution should be shaped

    4. D

      A specific code-level implementation with context

    Correct answer
    C

    Guidelines 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).

  3. 3

    Which of the following is considered an architecture pattern?

    1. A

      Iterator pattern

    2. B

      Singleton pattern

    3. C

      REST

    4. D

      MVC

    Correct answer
    D

    MVC

    Explanation

    MVC is an architecture pattern that defines a structure (model-view-controller). REST is an architecture style, singleton and iterator are design patterns.

  4. 4

    What is the key characteristic of a design pattern according to the video?

    1. A

      It is a block-level diagram with no code specificity

    2. B

      It defines guidelines and principles for a solution

    3. C

      It is always related to network communication

    4. D

      It has a very specific context and often clear code structure

    Correct answer
    D

    It 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).

  5. 5

    What are the three categories of design patterns from the Gang of Four?

    1. A

      Creational, Functional, and Reactive

    2. B

      Structural, Behavioral, and Concurrent

    3. C

      Creational, Structural, and Behavioral

    4. D

      Creational, Behavioral, and Architectural

    Correct answer
    C

    Creational, Structural, and Behavioral

    Explanation

    The three categories are creational (object creation), structural (object composition/structure), and behavioral (communication between objects).

  6. 6

    Which pattern is an example of a creational design pattern?

    1. A

      Mediator pattern

    2. B

      Adapter pattern

    3. C

      Iterator pattern

    4. D

      Singleton pattern

    Correct answer
    D

    Singleton pattern

    Explanation

    Singleton pattern deals with object creation (single instance), so it is creational. Adapter is structural, iterator and mediator are behavioral.

  7. 7

    Which pattern helps iterate over a collection without exposing its underlying representation?

    1. A

      Iterator pattern

    2. B

      Factory pattern

    3. C

      Composite pattern

    4. D

      Chain of Responsibility pattern

    Correct answer
    A

    Iterator pattern

    Explanation

    Iterator pattern allows sequential access to elements without knowing the internal structure (e.g., list, dictionary).

  8. 8

    What is the primary purpose of the singleton pattern?

    1. A

      To create multiple instances of a class with different configurations

    2. B

      To encapsulate object creation logic in a separate class

    3. C

      To create a single instance of an object that can be shared across the application

    4. D

      To allow incompatible interfaces to work together

    Correct answer
    C

    To 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.

  9. 9

    Which of the following is a common use case for the singleton pattern?

    1. A

      Iterating over a collection

    2. B

      Caching data like country or state masters

    3. C

      Creating objects with many optional parameters

    4. D

      Handling UI events in MVC

    Correct answer
    B

    Caching 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.

  10. 10

    What is the purpose of the private constructor in a singleton class?

    1. A

      To allow inheritance from the class

    2. B

      To prevent external instantiation of the class

    3. C

      To enable thread safety

    4. D

      To implement lazy loading

    Correct answer
    B

    To 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.

  11. 11

    Why is thread safety important in a singleton pattern?

    1. A

      To improve the performance of the singleton by avoiding locks

    2. B

      To ensure that the singleton instance is created only once in a multi-threaded environment

    3. C

      To allow multiple threads to access the instance simultaneously without blocking

    4. D

      To enable the singleton to be used in a single-threaded environment only

    Correct answer
    B

    To 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.

  12. 12

    In the double null check pattern for singleton, what is the purpose of the outer null check?

    1. A

      To perform lazy loading

    2. B

      To avoid unnecessary locking for performance

    3. C

      To ensure thread safety

    4. D

      To enforce the private constructor

    Correct answer
    B

    To 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.

  13. 13

    What is the difference between a static class and a singleton pattern?

    1. A

      A static class can implement interfaces, but a singleton cannot

    2. B

      A static class is a design pattern, while singleton is a programming keyword

    3. C

      There is no difference; they are exactly the same

    4. D

      A singleton pattern includes thread safety, lazy loading, and performance considerations beyond just using the static keyword

    Correct answer
    D

    A 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.

  14. 14

    Which C# keyword can simplify singleton implementation by providing built-in lazy loading and thread safety?

    1. A

      Lazy

    2. B

      lock

    3. C

      volatile

    4. D

      readonly

    Correct answer
    A

    Lazy

    Explanation

    The Lazy<T> class handles lazy initialization and thread safety, reducing the singleton code to a single line for property access.

  15. 15

    What is the term for a view in MVP that does nothing except forward requests to the presenter and respond to callbacks?

    1. A

      Smart view

    2. B

      Active view

    3. C

      Passive view

    4. D

      Dumb view

    Correct answer
    C

    Passive 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.

  16. 16

    In MVC, which component is hit first when a user makes a request?

    1. A

      Model

    2. B

      Presenter

    3. C

      Controller

    4. D

      View

    Correct answer
    C

    Controller

    Explanation

    In MVC, the controller receives the user input first, then loads the model, and finally passes the data to the view.

  17. 17

    In MVP, how does the presenter update the view?

    1. A

      Through automated bindings defined in XAML

    2. B

      Directly by calling methods on the view object

    3. C

      By returning a new view instance

    4. D

      By raising events that the view listens to

    Correct answer
    B

    Directly 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.

  18. 18

    What is the role of the interface in MVP?

    1. A

      To handle dependency injection

    2. B

      To act as a mediator for callbacks between the view and the presenter

    3. C

      To define the data model structure

    4. D

      To implement automated bindings

    Correct answer
    B

    To 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.

  19. 19

    What key feature enables MVVM to reduce code-behind compared to MVP?

    1. A

      Removal of the model layer

    2. B

      Automated bindings and commands

    3. C

      Use of a separate presenter class

    4. D

      Direct manipulation of UI elements from the model

    Correct answer
    B

    Automated 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.

  20. 20

    According to the video, what primarily determines whether to use MVC, MVP, or MVVM?

    1. A

      The technology stack used (e.g., view-first vs controller-first, presence of bindings)

    2. B

      The programming language (Java vs C#)

    3. C

      The size of the project

    4. D

      The number of developers on the team

    Correct answer
    A

    The 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.

  21. 21

    What is the difference between a layer and a tier?

    1. A

      They are synonyms with no difference

    2. B

      A layer is physical deployment, a tier is logical separation

    3. C

      A layer includes only the database, a tier includes everything

    4. D

      A layer is logical separation, a tier is physical deployment

    Correct answer
    D

    A 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.

  22. 22

    What happens when you move from a three-layer architecture to a three-tier architecture?

    1. A

      Communication complexity increases due to network calls between tiers

    2. B

      The database is no longer needed

    3. C

      The number of layers decreases

    4. D

      The project becomes simpler to develop

    Correct answer
    A

    Communication 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.

  23. 23

    Which of the following is an example of a structural design pattern?

    1. A

      Singleton

    2. B

      Observer

    3. C

      Factory

    4. D

      Adapter

    Correct answer
    D

    Adapter

    Explanation

    Adapter pattern deals with the composition and structure of classes to make incompatible interfaces work together, so it is structural.

  24. 24

    What is the term for a class that encapsulates a model and provides everything needed for the view (data and aesthetics)?

    1. A

      Service

    2. B

      Presenter

    3. C

      Controller

    4. D

      View Model

    Correct answer
    D

    View 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.

  25. 25

    According to the video, non-GOF patterns are also important to mention. Which of the following is a non-GOF pattern?

    1. A

      Repository

    2. B

      Singleton

    3. C

      Adapter

    4. D

      Decorator

    Correct answer
    A

    Repository

    Explanation

    Repository pattern is not part of the original Gang of Four patterns; it is a newer pattern commonly used in data access.

Question 1 of 25
Question 1 of 25

Ask anything

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

FlashcardsQuizFill in the blanksWritten testLessonNotesPodcastContent