Posts

Showing posts with the label interview

๐Ÿงต JavaScript Interview Prep: Single-Threaded or Multi-Threaded? Event Loop? Async Tasks?

If you’re preparing for a JavaScript interview , chances are you’ll come across questions like: Is JavaScript single-threaded or multi-threaded? How does JavaScript handle asynchronous tasks? What is the event loop, and how does it work? These are fundamental concepts that every JavaScript developer should understand — not only for interviews but also for writing efficient, non-blocking code. Let’s break them down clearly ๐Ÿ‘‡ ๐Ÿง  Question 1: Is JavaScript Single-Threaded or Multi-Threaded? The short answer is: ๐Ÿ‘‰ JavaScript is single-threaded. That means it can execute only one task at a time on a single main thread . This single thread handles: Code execution Function calls Event handling DOM updates (in browsers) So, when you run JavaScript, it processes your code line by line , synchronously . If one piece of code takes too long to finish, the rest of the program must wait — this is called blocking . ⚙️ Question 2: How Does JavaScript Handle Asynchronous Task...

Angular Ionic Interview Questions

JAVASCRIPT What is hoisting? Its mechanism Variable and function declarations are moved to the top of their scope before code execution. console.log(x) //undefined var x = 10 console.log(x) // print 10 console.log(y+z) //reference error let y = 10 const z = 10 --------------------------------------------------------------------------------------------------------------------------- Difference between let and var? --------------------------------------------------------------------------------------------------------------------------- What are let, var, and const in javascript? let - block scoped, redeclared not supported in same scope const - block scoped, redeclared or redesigned are not supported var - function scoped, redeclared and redesigned are supported function scope  function test(){ var a = 10; var a = "mani";  //redeclared and redesigned are supported with the scope } block scope if(test){ let a = 10; let b = 11; //error if(tt){ let b = 12; //working } } if(test) ...

Android Interview Questions 2022

JAVA Why String is mutable? String str1 = 10                 String str2 = 20         str1 == str2 is this true? What String Pool in java? Difference of StringBuffer vs String? Difference of StringBuilder vs StringBuffer? What is HashMap and purpose? Difference of HashMap vs HashTable? Difference of HashMap vs HashSet? What is array vs list? What is abstract class in java? What is collections in java? What is flatmap? What is array vs arraylist? What is Interface in Java? What is polymorphism ? What is singleton class? The following variable stored in which memory?                 String str = new String()  - memory?         String str = “test”;         String str1 = “test”; ...