Development Flashcards

(17 cards)

1
Q

What are the SOLID principles?

A

A set of five design guidelines for maintainable software: Single Responsibility, Open/Closed, Liskov Substitution, Interface Segregation, and Dependency Inversion.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

What is the Single Responsibility Principle?

A

A class should have only one reason to change — it should handle one job or concern.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

What is the Open/Closed Principle?

A

Classes should be open for extension but closed for modification — you extend behavior via inheritance or composition.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

What is the Liskov Substitution Principle?

A

Objects of a subclass should be usable wherever the base class is expected, without breaking functionality.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

What is the Interface Segregation Principle?

A

Many small, specific interfaces are better than one large, general one.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

What is the Dependency Inversion Principle?

A

Depend on abstractions (interfaces), not concrete implementations.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

Why is separation of concerns important in MVVM?

A

It reduces coupling between layers, making the app easier to test, extend, and maintain.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

What is the role of a service class in MVVM?

A

To handle operations like data access, file I/O, or API calls — keeping ViewModels clean and focused.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

What is the Dispatcher used for in WPF threading?

A

It ensures UI updates run on the main UI thread safely from background threads.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

How do you update the UI from a background thread?

A

Use Application.Current.Dispatcher.Invoke() or Dispatcher.BeginInvoke().

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

Why use async/await in WPF apps?

A

To keep the UI responsive during long operations (e.g., database or API calls).

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

What is the difference between synchronous and asynchronous code?

A

Synchronous code blocks execution; asynchronous code continues running while awaiting completion.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

What is unit testing in MVVM?

A

Testing ViewModels and Models independently to verify logic without launching the UI.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
14
Q

What is mocking in testing?

A

Creating fake implementations of dependencies (e.g., data services) to isolate tests.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
15
Q

Why is Dependency Injection helpful for testing?

A

It allows replacing real services with mocks or stubs during unit tests.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
16
Q

How should you organize folders in an MVVM project?

A

Typically: Models, Views, ViewModels, Services, and Resources.

17
Q

What is the benefit of Commanding over code-behind event handlers?

A

Commands maintain MVVM separation, are reusable, and allow automatic UI enable/disable logic.