General Flashcards

1
Q

What is CORS?

A

CORS stands for Cross-Origin Resource Sharing, and is a browser mechanism that allows for controlled access to resources located outside of a given domain.

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

What is the bridge patterm?

A

The bridge patten is a design pattern that is meant to decouple an abstraction from its implementation which can be developed independently of each other. In this pattern, an interface is created that acts as a bridge.

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

What is Continuous Integration?

A

Continuous integration allows you to continuously integrate code into a single shared and easy to access repository. It also allows for the build for this integration to be automated and self-testing in a clone production environment.

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

What is the core difference between REST and GraphQL?

A

In the REST model, the type/shape of the resource and the way of retrieving it is coupled, whilst in GraphQL, these two concepts are completely independent of each other.

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

How can we optimise the speed of a website?

A

By leveraging browser caching, avoiding URL redirects, avoiding inline JavaScript and CSS.

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

Name four design patterns that you are aware of?

A

The bridge pattern, the singleton pattern, the observer pattern, and the factory method.

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

What is the singleton pattern and how do you make a singleton class?

A

The singleton pattern is used to only limit one class to one object. This is useful when there only needs to be one object to coordinate actions across the program. To make a class a singleton, make the constructor private and make a static method that returns the object instance of the class.

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

What effect does the keyword ‘static’ have on variables and methods?

A

Static variables and method mean they belong to the class rather than the instance of the class. With static variables, one copy of the variable will be created and shared across the all object instances of the class. With static methods, the method can be used without creating an object of the class. This makes them very useful in utility methods.

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

What is the observer design pattern?

A

The observer pattern is a software design pattern in which an object, named the subject, maintains a list of its dependents, called observers, and notifies them automatically of any state changes, usually by calling one of their methods.

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

What is the factory method?

A

This pattern defines an interface for creating an object, but let subclasses decide which class to instantiate. This pattern delegates the responsibility of initializing a class from the client to a particular factory class by creating a type of virtual constructor. To achieve this, we rely on a factory which provides us with the objects, hiding the actual implementation details. The created objects are accessed using a common interface.

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