Posts

Showing posts with the label Algorithms

Deep Dive

×

...

Tap to Open SWEETEST LOVE 9 February • Chocolate Day
Sweetness of Love
Topic
Loading...
2026

Ace Your JEE Mains

Top JavaScript Backend Interview Questions for MNCs (2026 Edition)

Image
Multinational companies (MNCs) like Google, Amazon, Netflix, and Microsoft focus less on syntax trivia and more on scalability, system design, and deep internal knowledge of the runtime. This guide covers the most high-impact topics. Part 1: Core JavaScript Deep Dives Focus: How the language actually works under the hood. 1. Explain the Event Loop in detail. How do microtasks differ from macrotasks? Answer: The Event Loop is the mechanism that allows Node.js to perform non-blocking I/O operations despite being single-threaded. It offloads operations to the system kernel whenever possible. Call Stack: Executes synchronous code. Macrotasks (Task Queue): setTimeout , setInterval , setImmediate , I/O callbacks. Microtasks (Microtask Queue): Promise callbacks ( .then / .catch ), process.nextTick . Critical Distinction: The Event Loop checks the Microtask Queue after every completed task in the Call Stack and before moving to the next Macrotask. This means process.nextTick and Prom...

Binary Search: Binary Search, Efficient Algorithms, Advanced Applications

Image
How Binary Search Works Initial Setup : Start with two pointers, low and high , which represent the bounds of the search interval. Initially, low is set to 0, and high is set to the length of the array minus one. Middle Element : Calculate the middle index mid of the current interval. The middle index is computed as mid = (low + high) // 2 . Comparison : If the middle element arr[mid] is the target value, the search is complete, and the index mid is returned. If the target value is less than arr[mid] , adjust the high pointer to mid - 1 . If the target value is greater than arr[mid] , adjust the low pointer to mid + 1 . Repeat : Repeat steps 2 and 3 until the low pointer exceeds the high pointer. If the target value is not found, return -1 to indicate that the value is not in the array. Binary Search Algorithm in Python Here is the Python implementation of binary search: python def binary_search ( arr, target ): low = 0 high = len (arr) - 1 while low ...
Atharv Gyan Splash Screen
🔍 DevTools is open. Please close it to continue reading.