Moiz's Dev Blog
themoizqureshi.hashnode.dev › javascript-string-coding-interview-questions
JavaScript String Coding Interview Questions - Moiz's Dev Blog
January 28, 2024 - Here are 15 coding interview questions related to strings in JavaScript, along with sample solutions: Reverse a String: Write a function to reverse a string in-place. function reverseString(str) { return str.split('').reverse().join(''); } ...
GeeksforGeeks
geeksforgeeks.org › javascript › javascript-string-interview-questions-and-answers
JavaScript String Interview Questions and Answers - GeeksforGeeks
The match() method checks if a string fits a pattern (regular expression) and returns the matching parts in an array. If there’s no match, it returns null. This is useful for finding specific text patterns. ... JavaScript provides multiple ways to reverse a string, but the most common method is by converting the string into an array, reversing it, and then joining it back into a string.
Published September 12, 2025
[AskJS] What are the interview questions you have faced as a JavaScript developer?
I've also struggled with these tech interviews, but I finally managed to memorise tons of questions they like to ask on tech interviews after playing with JS Interview Hell - https://www.javascript-interview-hell.com/ . More on reddit.com
[deleted by user]
Soft questions: How do you deal with conflicts? What role(s) do you take in a team? Strengths/weaknesses (in some form) Tell me about a stressful situation you experienced, what did you learn from it? React questions (junior to senior): Describe how to use useState. What happens with a component when it receives new props? How can you share a state between multiple components? Do you have to use React with JSX? What is the difference between a controlled and uncontrolled component/input/element/form? What is the VDOM (Virtual DOM)? What are some common pitfalls when doing data fetching? Describe the usage and pitfalls of useEffect (open discussion). JS Questions (junior to senior): What is the difference between let and const? What is a callback, when would you use one? What is the difference between == and ===? What is hoisting? What is a closure? What is the event loop? When is it a good idea to use a class (open discussion). These are some from the top of my head, questions I have been asked or asked candidates during interviews. More on reddit.com
What html and css questions can I expect in an interview?
While you can go super deep into HTML and CSS specs, in interviews I've mostly only seen everyday working knowledge stuff being asked in FE interviews. Here are some concepts I've seen. For HTML: What does semantic HTML mean to you? Stuff like don't style an to look like a button Performance related questions, prefetch vs preconnect, etc. But usually it's ok to just know that resource hints exist. Also would be bonus points if you know stuff about image srcset and why you might want to use them. Accessibility topics related to ARIA roles. Again, just know they exist and can name a few off the top of your head is usually sufficient. For CSS: Layout related questions, how would you vertically center an item, basic knowledge of flexbox and grid. If you mention you use CSS tricks article on flexbox , that's probably enough. Basic knowledge of responsive design and how to use media queries. How would you go about building a responsive site (from desktop to mobile vs mobile first). Some understanding that browser technology is constantly evolving and you are aware can i use exists and are aware of @supports. Some sort of preprocessor experience, Sass or less, if it's a css heavy role, maybe some knowledge of postcss Hope that helps! More on reddit.com
How to empty an array in JavaScript?
**Method 1**
```javascript
arrayList = [];
```
Above code will set the variable `arrayList` to a new empty array. This is recommended if you don't have **references to the original array** `arrayList` anywhere else because It will actually create a new empty array. You should be careful with this way of empty the array, because if you have referenced this array from another variable, then the original reference array will remain unchanged, Only use this way if you have only referenced the array by its original variable `arrayList`.
For Instance:
```javascript
var arrayList = ['a', 'b', 'c'
fullstack.cafe
fullstack.cafe › home › blog › 25+ javascript coding interview questions (solved with code)
25+ JavaScript Coding Interview Questions (SOLVED with CODE) | ...
What is _Closure_ in JavaScript? Provide an example
A *closure* is a function defined inside another function (called parent function) and has access to the variable which is declared and defined in parent function scope.
The closure has access to variable in three scopes:
- Variable declared in his own scope
- Variable declared in parent function scope
- Variable declared in global namespace
```javascript
var globalVar = "abc";
// Parent self invoking function
(function outerFunction (outerArg) { // begin of scope outerFunction
// Variable declared in outerFunction function scope
var outerFuncVar = 'x';
// Closure self-invoking fu
fullstack.cafe
fullstack.cafe › home › blog › 25+ javascript coding interview questions (solved with code)
25+ JavaScript Coding Interview Questions (SOLVED with CODE) | ...
How does the `this` keyword work? Provide some code examples
In JavaScript *this* always refers to the “owner” of the function we're executing, or rather, to the object that a function is a method of.
Consider:
```js
function foo() {
console.log( this.bar );
}
var bar = "global";
var obj1 = {
bar: "obj1",
foo: foo
};
var obj2 = {
bar: "obj2"
};
foo(); // "global"
obj1.foo(); // "obj1"
foo.call( obj2 ); // "obj2"
new foo(); // undefined
```
fullstack.cafe
fullstack.cafe › home › blog › 25+ javascript coding interview questions (solved with code)
25+ JavaScript Coding Interview Questions (SOLVED with CODE) | ...
FullStack.Cafe
fullstack.cafe › home › blog › 25+ javascript coding interview questions (solved with code)
25+ JavaScript Coding Interview Questions (SOLVED with CODE) | FullStack.Cafe
November 10, 2019 - Having a JavaScript Coding Interview Session on this week? Fear not, we got your covered! Check that ultimate list of 25 advanced and tricky JavaScript Coding Interview Questions and Challenges to crack on your next senior web developer interview and got your next six-figure job offer in no time!
Medium
medium.com › javarevisited › top-21-string-programming-interview-questions-for-beginners-and-experienced-developers-56037048de45
Top 21 String Programming Interview Questions for Beginners and Experienced Developers | by javinpaul | Javarevisited | Medium
February 16, 2026 - JavaScript Algorithms and Data Structures Masterclass by Colt Steele for JavaScript programmers · Mastering Data Structures & Algorithms using C and C++ for those who are good at C/C++ 5. Grokking the Coding Interview: Patterns for Coding Questions Forget about the hundreds of Leetcode problems. Master these 15 underlying patterns to interview questions, and you’ll be able to tackle anything you face on the interview ... A good thing about the string data structure is that if you know the array data structure, you can easily solve string-based problems because strings are nothing but a character array.
Better Programming
betterprogramming.pub › the-technical-interview-guide-to-string-manipulation-92f4c4649cd
The Technical Interview Guide to String Manipulation | by Jennifer Fu | Better Programming
June 18, 2023 - In this article, we focus on JavaScript string manipulation. However, the principle and algorithms can be applied to other languages as well. When you are presented with a technical interview, the interviewer is looking for a few things: ... This interview series prepares you for a successful technical interview, but it is also useful for daily coding. In the code gist format, we list important features of a JavaScript string, which is the foundation of programming skill.
Medium
medium.com › @mohitkaushal91 › 5-javascript-coding-interview-questions-27856898b167
5 JavaScript Coding Interview Questions | by Mohit Kumar | Medium
November 28, 2023 - In this blog post, we will explore a selection of coding interview questions in JavaScript and unravel their solutions. Let’s dive in! Question: Write a function that reverses a given string. function reverseString(str) { return str.split('').reverse().join(''); } console.log(reverseString('Hello')); // Output: 'olleH' 2. Question: Write a function that finds the longest word in a sentence. function findLongestWord(sentence) { const words = sentence.split(' '); let longestWord = ''; for (let i = 0; i < words.length; i++) { if (words[i].length > longestWord.length) { longestWord = words[i]; } } return longestWord; } console.log(findLongestWord('The quick brown fox jumps over the lazy dog')); // Output: 'quick'
Keka
keka.com › hr toolkit › interview questions › top 50 javascript coding interview questions and answers
JavaScript Coding Interview Questions and Answers List | Keka
They also look for the ability to think of and execute a correct solution. I can implement a function that can efficiently merge two sorted arrays. ... Interviewers analyze the interviewee’s approach to execute code and demonstrate familiarity with handling case-sensitive and alphanumeric checks, regular expressions, and JavaScript string methods.
Substack
reactjava.substack.com › p › 21-string-interview-questions-that
The Only 21 String Problems You Need to Prepare for Coding Interviews in 2026
May 17, 2026 - JavaScript Algorithms and Data Structures Masterclass by Colt Steele for JavaScript programmers · Mastering Data Structures & Algorithms using C and C++ for those who are good at C/C++ 5. Grokking the Coding Interview: Patterns for Coding Questions Forget about the hundreds of Leetcode problems. Master these 15 underlying patterns in interview questions, and you’ll be able to tackle anything you face in an interview · A good thing about the string data structure is that if you know the array data structure, you can easily solve string-based problems because strings are nothing but a character array.
Medium
medium.com › swlh › 10-javascript-coding-interview-questions-solve-with-code-3d0a22393a69
10 JavaScript Coding Interview Questions Solve With Code | by Iqbal Mahmud | The Startup | Medium
June 13, 2020 - For example, “racecar” and “Anna” are palindromes. “Table” and “John” aren’t palindromes, because they don’t read the same from left to right and from right to left. The problem can be stated along the following lines: given a string, return true if the string is a palindrome and false if it isn’t.
Roadmap
roadmap.sh › questions › javascript-coding
Top 80 JavaScript Coding Interview Questions and Answers
In JavaScript coding, this can mean writing a function to sort an array, search for an item in a list, or traverse a tree. Interviewers ask about this to see how you think about problem-solving and efficiency. They want to know if you can write code that not only works but also performs well.
GitHub
github.com › RecursiveSharma › StringCodingQuestions
GitHub - RecursiveSharma/StringCodingQuestions: Mostly Asked String Coding Interview Questions | String Programs (Problems) for Practice 🚀
Mostly Asked String Coding Interview Questions | String Programs (Problems) for Practice 🚀 - RecursiveSharma/StringCodingQuestions
Starred by 10 users
Forked by 4 users
GitHub
github.com › sudheerj › javascript-interview-questions
GitHub - sudheerj/javascript-interview-questions: List of 1000 JavaScript Interview Questions · GitHub
List of 1000 JavaScript Interview Questions. Contribute to sudheerj/javascript-interview-questions development by creating an account on GitHub.
Author sudheerj
GeeksforGeeks
geeksforgeeks.org › javascript › javascript-coding-questions-and-answers
JavaScript Coding Questions and Answers - GeeksforGeeks
August 5, 2025 - The countChar() function counts how many times a specified character (char) appears in a string (str). It splits the string into an array using the character, then returns the length of the array (length-1), which gives the count of the character.