1 Reverse String Write a function that reverses a string. The input string is given as an array of characters s. You must do this by modifying the input array in-place with O(1) extra memory. Example 1: Input: s = [“h”,”e”,”l”,”l”,”o”] Output: [“o”,”l”,”l”,”e”,”h”] Example 2: Input: s = [“H”,”a”,”n”,”n”,”a”,”h”] Output: [“h”,”a”,”n”,”n”,”a”,”H”] Constraints: Solution: 2 Longest Common Prefix Write a function … Read More “String related LC questions | Javascript” »
Category: Uncategorized
1 How to solve Fizz Buzz | Javascript | Java The Given an integer n, return a string array answer (1-indexed) where: Example 1: Input: n = 3 Output: [“1″,”2″,”Fizz”] Example 2: Input: n = 5 Output: [“1″,”2″,”Fizz”,”4″,”Buzz”] Example 3: Input: n = 15 Output: [“1″,”2″,”Fizz”,”4″,”Buzz”,”Fizz”,”7″,”8″,”Fizz”,”Buzz”,”11″,”Fizz”,”13″,”14″,”FizzBuzz”] Constraints: Solution: Javascript: Java 2 Palindrome Number | javascript | java Given an … Read More “Integer-related LC questions | javascript | java” »
Currying is a technique in functional programming where a function that takes multiple arguments is transformed into a series of functions that each take a single argument. This can make it easier to compose functions and create reusable code. In JavaScript, currying can be accomplished using closures and recursion. In this article, we’ll explore how … Read More “Infinite Currying in JavaScript” »
While answering this question please keep these two points in mind. 1 Make it about them first – means tell them about company goals and commitments 2 After telling them about the company share what you want Example answer As an experienced IT developer with a background in JavaScript, Java, Angular, React, and Spring Boot, … Read More “HR Interview | Why do you want to work here?” »
Understanding how the language handles memory is crucial to writing efficient and optimized code. When your code runs, JavaScript creates two main components in memory: the Call Stack and the Memory Heap. The Call Stack: The Call Stack is responsible for managing the execution of functions in your code. It is a Last In, First … Read More “Call Stack + Memory Heap: Understanding the Fundamentals of JavaScript Memory Management” »
JavaScript is a popular language known for its versatility and flexibility. However, while some features can help you write code quickly, others may have a negative impact on performance. In this article, we’ll discuss six features you should avoid using in your JavaScript code to keep it optimized. The eval() function is used to evaluate … Read More “Avoid These JavaScript Features for Optimized Code” »
When you run a JavaScript program, it goes through a series of steps to execute the code. Understanding the role of the JavaScript runtime, interpreter, compiler, and JIT compiler is essential for optimizing your code’s performance. JavaScript Runtime The JavaScript runtime is the environment in which your JavaScript code runs. It includes the browser, Node.js, … Read More “Understanding JavaScript Runtime and Its Different Compiler Types” »
JavaScript is a high-level programming language that is widely used for developing web applications. When you run JavaScript code in a web browser or on a server using Node.js, the code is executed by a JavaScript engine. A JavaScript engine is a program that reads JavaScript code and converts it into machine code that can … Read More “Javascript Engine | V8 | SpiderMonkey |JavaScriptCore“ »
In Java, operators are used to perform different operations on variables and values. These operators can be classified into four categories: arithmetic, relational, logical, and assignment. In this blog post, we will discuss these operators in detail and provide example code and commands to demonstrate their usage. Arithmetic Operators Arithmetic operators are used to perform … Read More “Java | Arithmetic, relational, logical, and assignment operators” »
JavaScript is a popular programming language used for building web applications. However, with large and complex applications, performance issues can arise. In this article, we will discuss various techniques and tools that can be used for optimizing the performance of JavaScript code. Step 1: Minify and Bundle Your Code Minification is the process of removing … Read More “JavaScript Performance Optimization: Tips and Tricks” »