Technical Test: Difference between revisions
| Line 2: | Line 2: | ||
====REST vs GraphQL==== | ====REST vs GraphQL==== | ||
No more Over- and Underfetching. In GraphQL, you specify exactly what you need. REST, requires multiple requests and API reflects UI. When UI changes, over/under fetching the API occurs. | =====GraphQL===== | ||
No more Over- and Underfetching. In GraphQL, you specify exactly what you need. REST, requires multiple requests and API reflects UI. When UI changes, over/under fetching the API occurs. | |||
* It is statically typed, so you do not need to define variable before using it. | |||
* GraphQL can decouple frontend from backend. | |||
* No over or under fetching of data. | |||
* It is language and HTTP agnostic. | |||
* Documentation of GraqphQL comes with no extra cost. | |||
* It helps you to save bandwidth. | |||
=====REST===== | |||
industry standard for companies deploying APIs | |||
* REST has a uniform interface. | |||
* Services of REST can be scaled to achieve high performance to span client demand. | |||
* Resources can be easily accessed by name. | |||
* The REST API enables systems to transmit and send or receive data in an easy way. | |||
* Database resource in an application can be quickly mapped with a REST API endpoint. | |||
* REST allows you to store frequently used information in the memory. | |||
* It has a simple architecture and pattern. | |||
* The API of REST can be served from more than one server. | |||
====What is CI/CD?==== | ====What is CI/CD?==== | ||
Revision as of 01:32, 18 April 2022
Technical Test
REST vs GraphQL
GraphQL
No more Over- and Underfetching. In GraphQL, you specify exactly what you need. REST, requires multiple requests and API reflects UI. When UI changes, over/under fetching the API occurs.
- It is statically typed, so you do not need to define variable before using it.
- GraphQL can decouple frontend from backend.
- No over or under fetching of data.
- It is language and HTTP agnostic.
- Documentation of GraqphQL comes with no extra cost.
- It helps you to save bandwidth.
REST
industry standard for companies deploying APIs
- REST has a uniform interface.
- Services of REST can be scaled to achieve high performance to span client demand.
- Resources can be easily accessed by name.
- The REST API enables systems to transmit and send or receive data in an easy way.
- Database resource in an application can be quickly mapped with a REST API endpoint.
- REST allows you to store frequently used information in the memory.
- It has a simple architecture and pattern.
- The API of REST can be served from more than one server.
What is CI/CD?
CICD is the combined practices of continuous integration and continuous delivery or continuous deployment. CI/CD bridges the gaps between development and operation activities and teams by enforcing automation in building, testing and deployment of applications.
What is a dependency injection?
DI is a pattern where, instead of creating or requiring dependencies directly inside a module, we pass them as parameters or reference.
MEAN Stack
MEAN (MongoDB, Express.js, AngularJS (or Angular), and Node.js)
Box Model
The CSS box model is essentially a box that wraps around every HTML element. It consists of: margins, borders, padding, and the actual content.
Types of Tests
- Unit Tests - small. quick. Jest/NUnit/PHPUnit
- Integration Tests - connect components to see how they work together. Slower to write/run.
- Automation Tests - UI test/end-to-end tests. simulate user behavior. Nightmare (https://github.com/segmentio/nightmare).
TDD/Unit Tests/FIRST
FIRST properties of Unit Tests. http://agileinaflash.blogspot.com/2009/02/red-green-refactor.html
- Fast: unit test must be fast - A software project will eventually have tens of thousands of unit tests, and team members need to run them all every minute or so without guilt.
- Isolated: Tests isolate failures. A good unit test has a laser-tight focus on a single effect or decision. Good tests interferes with no other tests in any way. They impose their initial state without aid from other tests. They clean up after themselves.
- Repeatable: Tests must be able to be run repeatedly without intervention.
- Self-validating: Tests are pass-fail.
- Timely: Tests are written at the right time, immediately before the code that makes the tests pass.
TDD: Red/Green/Refactor
http://agileinaflash.blogspot.com/2009/02/red-green-refactor.html
- Red: Failed test
- Green: Passed test
- Refactor: Clean up. Remove code. make into smaller units. performance.