General Dev Flashcards

1
Q

What is TDD?

A

TDD stands for Test Driven Development is the software development process relying on software requirements converted into test cases before the software is fully developed. The trigger for a new test is a requirement not a new class or method.

It focuses on writing basic test to meet the requirement that might not compile
The write the code as quickly as possible to meet the requirement
Refactor the code for readability, duplication, code smells, design patterns
You should not have to write new tests

Don’t blindly follow process for process sake. Use your experience and keep and open mind about what’s important to your products needs. __ Elliot Chance

Mocks are useful when a resource is expensive to create, people have used them to isolate classes

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

What is BDD?

A

BDD (Behaviour-driven development) Testing is a technique of agile software development and is as an extension of TDD, i.e., Test Driven Development. In BDD, test cases are written in a natural language that even non-programmers can read. Involves product, stakeholders developers writing test cases to meet the need.

Gherkin given when then

Specflow

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

What is agile / scrum

A

Agile is a philosophy which takes an iterative approach towards completion of a project. Scrum focuses on delivery business value in the shortest time.
Plan design developer test release feedback

Scrum delivers every sprint
Ceremonies, sprint planning, standups

React quickly to changes

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

What is OOP?

A

OOP implementing a solution focused on objects. An object encapsulates both data and behaviour
Behaviours are modelled through function and operate on the data.
Data is hidden from the outside world
Object is a concrete abstraction

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

What are the pillars of OOP?

A

Abstraction
Encapsulation
Inheritance
Polymorphism

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

What is abstraction?

A

Abstraction focuses on what an object does rather than how it works.
Hide the inner implementation detail. Abstract classes / interfaces
Solves the issues at design level
Show relevant information
Information contained

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

What is encapsulation?

A

Encapsulation is a putting a group of related properties and methods into a single unit.
implementation level
Hides inner detail

getters and setters

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

What is inheritance?

A

Enables you to base one object or class off another object or class.
This allows reuse, extend, modify behaviour

C# single inheritance with the base class and then the derived class. it is transitive

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

What is polymorphism?

A

takes many forms (is-a relationship)

Compile time - method overloading
Run time - overriding virtual methods

Enemy enemy = new Vampire();
Enemy enemy = new Werewolf();

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

Access modifiers?

A

protected > current and derived class
internal > same assembly

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

Solid principles

A

Single responsibility > Class should have one and only one reason to change

Open closed principle > Classes should be open for extension but closed for modification. Code that doesn’t have to change when the requirements do

Liskov substitution principle > treat a child as if it was the parent - calculator example

Interface segregation - Many client-specific interfaces are better than one general-purpose interface. As few interfaces as possible, shouldn’t create interfaces that aren’t implemented

Dependency inversion - Depend upon abstractions, [not] concretions

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

Oauth vs Open Id Connect

A

Resource owner
Resource server
Client
Authorization Server
Authorization grant
Redirect URI
Access token

Resource owner > passes response type code, scopes, redirect URI < Authorization Server > Authorization Code for access token

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

Pillars of observability

A

Metrics
Logs
Tracing

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

What is a rest API?

A

Uniform interface. All API requests for the same resource should look the same, no matter where the request comes from. The REST API should ensure that the same piece of data, such as the name or email address of a user, belongs to only one uniform resource identifier (URI). Resources shouldn’t be too large but should contain every piece of information that the client might need.
Client-server decoupling. In REST API design, client and server applications must be completely independent of each other. The only information the client application should know is the URI of the requested resource; it can’t interact with the server application in any other ways. Similarly, a server application shouldn’t modify the client application other than passing it to the requested data via HTTP.

Statelessness. REST APIs are stateless, meaning that each request needs to include all the information necessary for processing it. In other words, REST APIs do not require any server-side sessions. Server applications aren’t allowed to store any data related to a client request.

Cacheability. When possible, resources should be cacheable on the client or server side. Server responses also need to contain information about whether caching is allowed for the delivered resource. The goal is to improve performance on the client side, while increasing scalability on the server side.

Layered system architecture. In REST APIs, the calls and responses go through different layers. As a rule of thumb, don’t assume that the client and server applications connect directly to each other. There may be a number of different intermediaries in the communication loop. REST APIs need to be designed so that neither the client nor the server can tell whether it communicates with the end application or an intermediary.

Code on demand (optional). REST APIs usually send static resources, but in certain cases, responses can also contain executable code (such as Java applets). In these cases, the code should only run on-demand.

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