Cuemath Interview Question

JavaScript Questions Basic Concepts: Explain the difference between var, let, and const. How does hoisting work in JavaScript? What are closures and how do they work? Explain the concept of promises and async/await. Functions and Scope: Write a function to reverse a string. How does the this keyword work in JavaScript? Explain the difference between function declarations and function expressions. Data Structures: How do you manipulate arrays (e.g., map, filter, reduce)? Explain how JavaScript objects work and how to manipulate them. Event Handling: How do event listeners work in JavaScript? Explain the event loop and how JavaScript handles asynchronous operations. Problem-Solving Questions Sorting: Implement common sorting algorithms (e.g., bubble sort, merge sort, quicksort). Explain the time and space complexity of different sorting algorithms. Arrays: Write a function to find the maximum/minimum element in an array. Given an array of integers, write a function to return the indices of the two numbers that add up to a specific target. Write a function to rotate an array to the right by a given number of steps.