🌐
DEV Community
dev.to › tomeraitz › tricky-javascript-questions-7nk
Tricky JavaScript Questions - DEV Community
October 7, 2020 - Thanks for Sharing. Also learn top JavaScript Tricky Interview questions
🌐
Codinn
codinn.dev › tricky-javascript › es6789-code-snippets-interview-questions
Tricky Javascript Code Snippets Questions Asked in the Interview (es6/es7/es8/es9)
Prepare for your next 2025 Javascript Coding Interview Questions with these tricky code snippets. Covering ES6/ES7/ES8/ES9 syntax and features, this article provides examples and explanations to help you ace your interview.
Discussions

7 Simple but Tricky JavaScript Interview Questions
Do people really ask questions like this? These are all weird esoteric JS things that happen when you write stuff in weird ways. More on reddit.com
🌐 r/javascript
100
264
October 16, 2019
JavaScript Tricky Interview Questions 2023

When i was younger, I always wanted to interview people, and I thought to myself 'Ill find the best candidates " "I'll expose the frauds with some special whiteboard question".

When I finally was asked to do so, it was so soo different than what i thought it was going to be like. First of all, it's really hard to get a qualified person in front of you, especially post code bootcamp boom.

Then, you actually empathize with these people being put on the spot and freezing up, on some basic stuff which in the back of your mind you know they know.

I went from trying to catch people being bad, to now helping people get through an interview if the need presents itself. Watching someone crash and burn in an interview is extremely painful.

An interview to me now, is to gauge if they are being truthful about their background and knowledge, and establish if they are junior, intermediate or senior.

I actually give some incredibly easy white boarding questions for a front end dev, but I leave implementation very ambiguous.

Within code sandbox, and you can google anything you want, use the most modern implementations for the following questions :

  1. Show me a usecase and example of array.map, array.filter, array.reduce

  2. Reproduce this 3 column layout with a header and footer, handle it's responsiveness through pure CSS, do not use a framework or library

  3. Connect to an outside API, and display the returned data

The scary thing, is less than 10% get to the 3rd question within 30 minutes. But that doesn't mean they aren't a good candidate. If I see people using arrow functions, chaining functions, using const/let, using the array methods in a good usecase (that they can explain), using flexbox or grid these candidates are up on some modern patterns, and are viable for further look.

Sidenote : at least 2 times we caught someone cheating and have someone else typing their code on a zoom session during covid interviews

More on reddit.com
🌐 r/learnjavascript
1
2
August 26, 2023
Tricky Javascript Interview Questions ( Hoisting ) - Scoping, Shadowing, ( Var, Let, Const ) & more
Namaste! Thanks for submitting to r/developersIndia . Make sure to follow the subreddit Code of Conduct while participating in this thread. Recent Announcements Join Hoppscotch's Founder & CEO Liyas Thomas for An AMA on Open-Source, Software Engineering, Tech, and more! - September 8, 5:00 PM IST! I am a bot, and this action was performed automatically. Please contact the moderators of this subreddit if you have any questions or concerns. More on reddit.com
🌐 r/developersIndia
1
1
September 13, 2023
Tricky Javascript Interview Questions : r/javascript
🌐 r/javascript
People also ask

Explain the difference between `undefined` and _not defined_ in JavaScript
In JavaScript if you try to use a variable that doesn't exist and has not been declared, then JavaScript will throw an error `var name is not defined` and the script will stop execute thereafter. But If you use `typeof undeclared_variable` then it will return `undefined`. Before starting further discussion let's understand the difference between declaration and definition. `var x` is a declaration because you are not defining what value it holds yet, but you are declaring its existence and the need of memory allocation. ```javascript var x; // declaring x console.log(x); //output: undefined
🌐
fullstack.cafe
fullstack.cafe › blog › javascript-tricky-interview-questions
27 JavaScript Tricky Interview Questions (ANSWERED) For Experienced ...
Describe _Closure_ concept in JavaScript as best as you could
Consider: ```js function makeAdder(x) { // parameter `x` is an inner variable // inner function `add()` uses `x`, so // it has a "closure" over `x` function add(y) { return y + x; }; return add; } ``` Reference to inner `add` function returned is able to remember what `x` value was passed to makeAdder function call. ```js var plusOne = makeAdder( 1 ); // x is 1, plusOne has a reference to add(y) var plusTen = makeAdder( 10 ); // x is 10 plusOne(3); // 1 (x) + 3 (y) = 4 plusTen(13); // 10 (x) + 13 (y) = 23 ``` In C and most other common languages, after a function returns, all the
🌐
fullstack.cafe
fullstack.cafe › blog › javascript-tricky-interview-questions
27 JavaScript Tricky Interview Questions (ANSWERED) For Experienced ...
What is the drawback of creating true private in JavaScript?
One of the drawback of creating a true private method in JavaScript is that they are very memory inefficient because a new copy of the method would be created for each instance. ```javascript var Employee = function (name, company, salary) { this.name = name || ""; //Public attribute default value is null this.company = company || ""; //Public attribute default value is null this.salary = salary || 5000; //Public attribute default value is null // Private method var increaseSalary = function () { this.salary = this.salary + 1000; }; // Public method this.dispalyInc
🌐
fullstack.cafe
fullstack.cafe › blog › javascript-tricky-interview-questions
27 JavaScript Tricky Interview Questions (ANSWERED) For Experienced ...
🌐
LinkedIn
linkedin.com › pulse › top-10-tricky-javascript-questions-i-used-ask-interviews-amit-pal
Top 10 tricky JavaScript questions that I used to ask in interviews
August 13, 2021 - Sometimes, alongside this question, I used to ask the difference between the prototype and __proto__ and drag the conversation in detail. 6.Evaluating the max/min value from an n-array using Math.max function · This is a simple but tricky problem to resolve.
🌐
JavaScript in Plain English
javascript.plainenglish.io › javascript-tricky-questions-a-fun-conversation-6f19cfac9e62
JavaScript Tricky Questions: A Fun Conversation | by Harish Verma ( Front-End Engineer ) | JavaScript in Plain English
November 20, 2024 - JavaScript Tricky Questions: A Fun Conversation Introduction JavaScript: the language we love to hate and hate to love. It’s full of surprises that keep developers scratching their heads. Let’s …
🌐
FullStack.Cafe
fullstack.cafe › blog › javascript-tricky-interview-questions
27 JavaScript Tricky Interview Questions (ANSWERED) For Experienced JavaScript Developers | FullStack.Cafe
Check 27 JavaScript Tricky Interview Questions (ANSWERED) For Experienced JavaScript Developers and Land Your Next Six-Figure Job Offer! 100% Tech Interview Success!
🌐
Medium
brajrajagrawal.medium.com › conquering-the-javascript-interview-tricky-guess-the-output-questions-on-variable-scope-and-a85a0b70df0a
Conquering the JavaScript Interview: Tricky Guess the Output Questions (Part 1) | by Brajraj Agrawal | Medium
April 8, 2024 - Even though x is declared within the test function, JavaScript hoists all variable declarations to the top of their scope (in this case, the global scope). So, when console.log(x) is called, it sees the already declared x with a value of 5. Then, the new x with a value of 10 is assigned but doesn't affect the console output. Question 4 (Let vs.
🌐
Medium
medium.com › @brandon93.w › 10-tricky-interview-questions-javascript-59b513d54d09
10 tricky interview Questions - Javascript | by Brandon Wohlwend | Medium
May 9, 2026 - This is tricky because it involves understanding how the this keyword works and how it can be explicitly set. const obj = { x: 42, getX: function() { return this.x; } }; const unboundGetX = obj.getX; console.log(unboundGetX()); // Output: undefined const boundGetX = unboundGetX.bind(obj); console.log(boundGetX()); // Output: 42 · This expression will return false. This is because, in Javascript, arrays are objects and objects are compared by reference, not by value.
Find elsewhere
🌐
Reddit
reddit.com › r/javascript › 7 simple but tricky javascript interview questions
r/javascript on Reddit: 7 Simple but Tricky JavaScript Interview Questions
October 16, 2019 - Then just ask "what is hoisting" -- The tricky questions will just turn off solid developers from wanting to accept your offer, which is not something most places can afford to do these days. Questions like this, to me, imply "you will have to deal with this type of garbage here in our legacy code".
🌐
Dmitri Pavlutin
dmitripavlutin.com › simple-but-tricky-javascript-interview-questions
7 Simple but Tricky JavaScript Interview Questions
A compiled list of simple but tricky questions you might be asked during a JavaScript coding interview.
🌐
GreatFrontEnd
greatfrontend.com › blog › advanced-javascript-interviews-questions-for-10-years-experience
Advanced JavaScript Interview Questions for 10+ Years of Experience | Blog
April 26, 2025 - These questions cover intricate concepts like microtask queues, closures, async/await, and more, designed to showcase your deep understanding and ability to navigate complex challenges. If you're looking for additional JavaScript interview preparation materials, also check out these resources:
🌐
LinkedIn
linkedin.com › pulse › 7-tricky-javascript-interview-questions-aayush-patniya
7 Tricky JavaScript Interview Questions
September 5, 2023 - JavaScript interviews often include tricky questions that challenge your understanding of the language’s nuances. In this article, we’ll explore seven such questions, provide detailed explanations of the answers, and offer some bonus tips to help you tackle these challenges effectively.
🌐
Medium
umarfarooquekhan.medium.com › javascript-tricky-interview-question-and-answer-f140d1dfeaff
JavaScript tricky interview question and answer | by Umar Farooque Khan | Medium
November 7, 2023 - JavaScript tricky interview question and answer JavaScript interview tricky question and answer part 2 What will be the output of the following code? console.log(2 + true); Answer : The output will …
🌐
Medium
medium.com › coding-in-depth › tricky-javascript-interview-questions-4e54141f175d
Tricky JavaScript interview questions | by Coding In depth | Coding In Depth | Medium
May 30, 2020 - Answer: The first answer is 1 because 2 is at position 1, second and third is -1 because the index does not use for object and arrays. If you want to find and element in array use map and then check the index. The last line answer is 4 because the string is consider as an array of char in javascript. Question 2: What will be the output of the following code blocks
🌐
Plain English
plainenglish.io › blog › 10-tricky-javascript-coding-interview-question-with-solution
10 Tricky JavaScript Coding Interview Questions (And Solutions)
May 16, 2020 - So today I am going to show you 10 tricky questions you should see before going to a coding interview. var string = "Welcome to this Javascript Guide!"; // Output becomes !ediuG tpircsavaJ siht ot emocleW var reverseEntireSentence = reverseBySeparator(string, ""); // Output becomes emocleW ot siht tpircsavaJ !ediuG var reverseEachWord = reverseBySeparator(reverseEntireSentence, " "); function reverseBySeparator(string, separator) { return string.split(separator).reverse().join(separator); }
🌐
LinkedIn
linkedin.com › pulse › 15-tricky-javascript-interview-questions-test-your-skills-kadam-q2oaf
🌐 15 Tricky JavaScript Interview Questions 🧠 That Will Test Your Skills 💡
February 6, 2024 - In this article, we have compiled a comprehensive set of 15 tricky JavaScript interview questions that will challenge your grasp of various JavaScript concepts.
🌐
Medium
ishwar-rimal.medium.com › tricky-js-interview-questions-and-answers-bffc8cce5b45
Tricky JS Interview Questions and Answers | by Ishwar Rimal | Medium
January 28, 2024 - In this article, I will be writing about those questions that made me scratch my head and question my fundamentals of JS and the web in…
🌐
GitHub
github.com › lydiahallie › javascript-questions
GitHub - lydiahallie/javascript-questions: A long list of (advanced) JavaScript questions, and their explanations · GitHub
A long list of (advanced) JavaScript questions, and their explanations :sparkles: - lydiahallie/javascript-questions
Author   lydiahallie
🌐
Medium
umarfarooquekhan.medium.com › javascript-tricky-question-and-answer-a5d67cc74218
JavaScript tricky question and answer | by Umar Farooque Khan | Medium
July 12, 2023 - JavaScript tricky question and answer JavaScript tricky question part 1 1. What is the output of the following code? console.log(2 + '2' - 1); Answer: The output of the code is '21'. Explanation: In …
🌐
Toptal
toptal.com › javascript › interview-questions
Top 37 Technical JavaScript Interview Questions & Answers [2026] | Toptal®
As shown here, this becomes more than just a stylistic preference in JavaScript. ... What will the code below output? Explain your answer. console.log(0.1 + 0.2); console.log(0.1 + 0.2 == 0.3); ... An educated answer to this question would simply be: “You can’t be sure.
🌐
GeeksforGeeks
geeksforgeeks.org › javascript › javascript-coding-questions-and-answers
JavaScript Coding Questions and Answers - GeeksforGeeks
August 5, 2025 - We will see the Top 50 JavaScript Coding questions and answers including basic and medium JavaScript coding questions and answers. In this article, we will cover everything like JavaScript core concepts- arrays, strings, arrow functions, and classes.