Software Development Theory Flashcards

1
Q

What is Object Orientated Programming?

A
  • OO is a programming paradigm (‘paradime’).
  • OO languages map the business model to ‘objects’, which contain related data and behaviour.
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

What are the four principals of Object Orientated programming?

A
  • Encapsulation
    • Hides internal implementation and data.
    • Only certain information is exposed.
    • Avoids data corruption (e.g. clients cannot change the engine of the car, but can interact with the car indicators).
    • C# properties enforce encapsulation (private fields, encapsulated with accessors, can add validation logic).
  • Abstraction
    • Abstract representation of the program – interfaces.
    • Only methods useful for other objects are revealed.
    • Implementation is hidden.
    • Allow users to interact with complex functionality with a simple interface.
  • Inheritance
    • Classes get data and functionality from parent class.
    • Can re-use functionality - share code.
    • Reduce development time.
  • Polymorphism
    • Override a base class method with a new implementation that is called at runtime
    • C# uses virtual and override keywords.
    • Virtual doesn’t change the default behaviour of a method, unless another implementation is provided in a derived class using the override keyword.
    • The most specific implementation will be called at runtime.
    • If a derived class does NOT implement the override method, the base class’s virtual method will be called.
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

What are the SOLID design principles?

A

Single Responsibility
- A class / code module should only have one function.

Open Closed
- Open to extension, closed to modification.
- Future developers should be able to add new functionality without changing the existing implementation of a class.

Liskov Substitution
- A derived class must be substitutable for its base class.
- The derived class should implement all the methods of the base class.

Interface Segregation
- Code to interfaces, reduce dependencies.
- No code should be forced to depend on methods it does not use.
- Split interfaces that are very large into smaller and more specific ones so that clients will only have to know about the methods that are of interest to them.

Dependency Inversion
- High-level modules should not depend on low-level modules.
- Instead, both should depend on abstractions.
- E.g. Do not directly contain classes within other classes, instead use interfaces and pass in dependencies on class construction (dependency injection).

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

What does the KISS acronym stand for?

A
  • Keep It Simple Stupid.
    • Avoid complexity.
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

What does the DRY acronym stand for?

A
  • Do Not Repeat.
    • Reduce repetitive patterns and duplicate code.
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

What does the YAGNI acronym stand for?

A
  • You Aren’t Gonna Need It.
    • Don’t add functionality until necessary.
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

Why should you favour composition (‘has a’) over inheritance (‘is a’)?

A
  • Inheritance makes code inflexible to later modifications.
  • Inheritance is tightly coupled, whereas composition is loosely coupled.
  • If you change your base class, all subclasses are also affected.
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

What are some software development project level best practices?

A
  • Obtain detailed and signed off requirements.
  • Document (including requirements, design, troubleshooting, etc).
  • Have a company coding standards for all devs to follow (naming conventions).
  • Automate (testing, deployments).
  • Multiple environments.
  • Strong release management (including rollback ability, version control).
  • Team working practices – knowledge transfer, sharing information – no knowledge silos.
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

What are some coding / programming best practices?

A
  • Have a team coding standards / style guidelines.
  • Do peer reviews on check in.
  • Unit test coverage (80% industry ‘good’ standard)
  • Use static analysis (common team configuration).
  • Seperation of concerns
    • Separate application into units with as little overlap as possible
    • Modularisation, encapsulation, multi-layer architecture (e.g. MVC, DAL)
  • Follow OO principles (encapsulation, inheritance, polymorphism, abstraction).
  • Follow SOLID principles.
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

What are the main features of an agile methodology?

A
  • Agile is an approach
    • E.g. scrum and kanban are the implementations.
  • Iterative approach, work completed in short sprints.
  • Sprints include all phases of SDLC, and should result in deliverable work.
  • Has distinct ceremonies / sessions:
    • Planning, Review, Retrospective
    • Team roles include Product Owner, Scrum Master.
    • Demonstrations (and sign-ff) to customer
  • Kanban – work is managed on kanban boards, which show state of tickets (to do, in progress, blocked, done)
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

What are the main features of a waterfall methodology?

A
  • Phased development.
  • Next phase cannot begin until the previous is completed / signed-off (and paid for).
  • A lot of planning and design before any deliverable software.
  • Thorough, but runs the risk of not delivering as expected / less flexible to change in later phases.
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

What are software design patterns?

A
  • Proven solutions to common design problems.
  • There are 23 Gang of Four patterns that are considered the foundation for all other patterns.
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

What is a creational design pattern? Can you outline one?

A

Creational design patterns deal with object creation mechanisms.

Singleton
- A class has only one instance.
- Gives simple access to that instance.

Abstract Factory
- Provides an interface for creating families of related or dependent objects without specifying their concrete classes.

Builder
- Separates the construction of a complex object from its representation so that the same construction process can create different representations.

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

What is a structural design pattern? Can you outline one?

A

Structural design patterns ease the design by identifying a simple way to realize relationships among entities.

Adapter
- Converts the interface of a class into another interface clients expect. This design pattern lets classes work together that couldn‘t otherwise because of incompatible interfaces.

Decorator
- Attach additional responsibilities to an object dynamically. This pattern provides a flexible alternative to subclassing for extending functionality.

Façade
- Provides a unified interface to a set of interfaces in a subsystem. This pattern defines a higher-level interface that makes the subsystem easier to use.

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

What is a behavioural design pattern? Can you outline one?

A
  • Behavioural design patterns identify common communication patterns among objects.

Observer
- Defines a one-to-many dependency between objects so that when one object changes state, all its dependents are notified and updated automatically.

Strategy
- Defines a family of algorithms, encapsulate each one, and make them interchangeable. This pattern lets the algorithm vary independently from clients that use it.

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

How can you optimise system performance?

A

High Level

  • Review the design, identify bottlenecks.
  • Design for scalability.
  • Performance profiling.

Low Level

  • Deep dive review areas to optimise:
    • Algorithm optimisation.
    • Caching optimisation.
    • Memory optimisation.
    • Database optimisation (e.g. review indexes, procedures)
    • Multi-threading.
17
Q

What are the advantages / disadvantages of a microservice / monolithic architecture?

A

Microservices architecture splits complex systems into more minor, more manageable services.

Advantages
- More scalable, flexible systems
- Easier to maintain (updates to small individual components)
- Independently deployable services.
- Improved monitoring / fault detection / fault isolation.
- Quicker deployment time.
- Clients only receive the data they want.
- Faster performance (calls spread across microservices, less data returned).

Disadvantages
- Initially, monolith architectures are simpler and easier to scale.
- May be increased cost due to number of services hosted / development efforts.