Longest Substring Without Repeating Characters
https://leetcode.com/problems/longest-substring-without-repeating-characters/
Input: s = "abcabcbb"
Output: 3
Explanation: The answer is "abc", with the length of 3.
/**
Sorting:
https://leetcode.com/problems/sort-an-array/
Quick Sort:
:::info
Divide and Conquer Algorithm.
In-Place Sorting Algorithm (No extra auxilary space needed)
It picks an element as pivot and partitions the given array around the picked pivot.
Advantages of HTTPS(Secure) over HTTP
Data is encrypted before sending in HTTPs (Prevents Man In The Middle Attacks i.e Reading sniffed packtes).
HTTPS does not have any separate protocol. It operates using HTTP but uses encrypted TLS/SSL connection and HTTP is build on top of TCP protocol.
:::info
TCP works on Application Layer but in addition to this, in HTTPS SSL/TLS works on the Transport Layer. More about OSI model is here
:::
HTTPs requires SSL certificate and it should be signed by trusted Certificate Authority(CA) (Prevents Phishing,MITM Attacks).
HTTPS connection(SSL/TLS Handshake)
You have applied the Microservice architecture pattern. Sometimes a service instance can be incapable of handling requests yet still be running. For example, it might have run out of database connections. When this occurs, the monitoring system should generate an alert.
How to detect that a running service instance or HTTP server is unable to handle requests?
In a microservice MYSQL, Redis, and RabbitMq is used, then how to make sure MYSQL, Redis, and RabbitMQ are alive.
Create an API for the health check of the server. In which we are checking the connection of MYSQL, Redis, and RabbitMQ.
How to check MySQL Health?
MySQL Health check code in NodeJs with TypeScript.
amir khan changed 5 years agoView mode Like Bookmark
JWT and Server-side sessions are different from each other as JWT provides a means of maintaining the session on the client side, while Server-side sessions are maintained on the server.Both of these are ways to do session management.
JWT
==JWT: JSON Web Token==
JWTs are JSON data, encoded(not encrypted) as a string, and cryptograhically signed.
There are two ways to sign JWT cryptograhically:
Symmetric: using shared secret key -HMAC
Asymmetric: using public/private key pair - RSA
Tabish Mohammed changed 5 years agoView mode Like 1 Bookmark
StateLess vs Stateful Protocol
The state of an application whether it is stateless or stateful depends on how the state of interaction with the application is managed/stored.
StateLess
In stateless applications no reference to the past transactions is stored.Each request/transaction is completely isolated.
It does not save or reference information about previous operations. Every time it carries each operation from the scratch just like the first time. No session info is stored in the application Memory but is rather stored in Database. These apps are highly scalable(horizontal) as API requests can be forwared to any servers running behind a load balancer without knowing the state of the session.
REST is a stateless architecture in itself,but it doesn't means all REST applications are stateless.If application stores the state in session then it is stateful.
Server Processes each request on the basis of information passed to that request i.e requests are self contained and does not rely on previous requests.
Tabish Mohammed changed 5 years agoView mode Like 3 Bookmark