⬆️ is for array of buckets .Now let’s look at how linked list turns into tree after it hits certain threshold .
Treeify threshold: When number of elements in linked list hits this index it will convert LL into binary search tree (red black tree) , giving us searching in 0(logN)
The default size of Hashmap is 16 with default load factor of 0.75 that means if Hashmap has 12 key value pair it will do rehash and will double the size of Hashmap .
Mike Tyson vs. Jake Paul was live-streamed on Netflix yesterday.
Let’s break down the typical tech stack of a live-streaming system.
Live streaming is challenging because the video content is sent over the internet in near real-time. Video processing is compute-intensive. Sending a large volume of video content over the internet takes time. These factors make live streaming challenging.
The diagram below explains what happens behind the scenes to make this possible.
Step 1: The streamer starts their stream. The source could be any video and audio source wired up to an encoder
Step 2: To provide the best upload condition for the streamer, most live streaming platforms provide point-of-presence servers worldwide. The streamer connects to a point-of-presence server closest to them.
Step 3: The incoming video stream is transcoded to different resolutions, and divided into smaller video segments a few seconds in length.
Step 4: The video segments are packaged into different live streaming formats that video players can understand. The most common live-streaming format is HLS, or HTTP Live Streaming.
Step 5: The resulting HLS manifest and video chunks from the packaging step are cached by the CDN.
Step 6: Finally, the video starts to arrive at the viewer’s video player.
Step 7-8: To support replay, videos can be optionally stored in storage such as Amazon S3.
This year’s Maharashtra Vidhan Sabha elections is an extremely fascinating contest, marked by intense close encounters, controversies, and insane unpredictability.
Startup idea : website/app to bet on the election candidate and coalition forming the government.
#AssemblyElections
Common Java interview questions, regardless of experience level:
1.Internal working of HashMap
2.Features of Java 8/11/17/21 (depending on the version you use)
3.Functional interface (often related to interfaces)
4.String-related question(immutability or memory management)
Loose coupling vs tight coupling in spring
Spring boot prefers loose coupling over tight coupling(creation of object with new keyword) .Loose coupling brings easiness of changes without affecting each other . It allows the code to be modular and less dependent on each other.
Since most modern applications are multi-threaded, each new request or thread will have its own instance of RequestContext. This ensures that data specific to one request doesn’t interfere with or get shared with another, as each thread accesses its own separate RequestContext.
A simple way to track request-specific data, such as IP addresses or user information, is to use a context class with a ThreadLocal variable which can also be inner class to store request specific data.
This allows you to create fields in the context class that capture data unique to each request. For example, if you want to capture an IP address, you can add a field for it in the RequestContext and set this value in an interceptor when the request starts.
@tejastweets_ webSecurityConfigurer method Mai with credential allow karna pada authorization also securityconfig acknowledge nhi karta agar http.cors() nhi hai to
http.cors() in your security config file if your authentication header is going into preflight provisional headers. Also allow header in corsfilter method .It costed me day and half to figure this small bug but satisfaction after solving it is what we live for as SDE.Cheers !!