An interview is an important part of the hiring process. It gives insights about the skillset, knowledge, and the ability of an individual to take on challenging tasks. It’s also one of the most reliable ways for an employer to filter out unsuitable candidates for a job posting.
In the end, you’ll be a bit more prepared and confident to answer any question your interviewer may ask. So, let’s get started.
- It supports multiple programming paradigms. For example, we can make use of Object-Oriented, Functional, and Imperative programming concepts.
- It has the biggest collection of open source libraries and frameworks.
The major benefit of hoisting is our code works correctly and doesn’t display any errors like “undefined variable” or “undefined function.”
Can you predict the output of the following code?
Juan Cruz Martinez
- First of all, the variable declaration at line # 2 and line # 3 will be considered as one statement.
- Also, remember that the value stored in a variable will not be lost even if we redeclare the variable.
We can enable “Strict Mode” by using the
"use strict"; directive at the beginning of our script.
What are some alternatives to Svelte?
What are ‘Self Invoking Functions’?
Self Invoking Functions are a little different from normal functions because they are executed immediately where they were declared.
A point to be noted is that these functions do not have any name. In turn, we are unable to recall these types of functions. They are also known as “Anonymous Functions”.
Here’s an example of Self Invoking Functions:
What is the difference between ‘var,’ ‘let,’ and ‘const’?
What is the difference between ‘==’ and ‘===’?
Is there any difference between ‘null’ and ‘undefined’ keywords?
Both of these keywords represent an empty value. But, there are two basic differences between null and undefined.
Can you tell the difference between ‘function declaration’ and ‘function expression’?
Basically, ‘Function Declaration‘ is nothing but the normal process of defining a function using the keyword
function, its unique name, parameters, and the function body. Whereas, when we assign a function declaration to a variable then it becomes ‘Function Expression.’ It’s interesting to note that function expressions are not hoisted, meaning, they’ll display an error if you try to call them before defining.
What is a ‘Closure’?
Can you predict the output of these two functions? And will they return same the output or not?
Output of Function user1()
Output of Function user2()
What is ‘NaN’?
For example, what if we try to divide a string using a number (e.g. “Hello World” / 5).
Can you explain the for-in loop?
The for-in loop is specifically designed to loop through all the object’s properties in a step by step manner. It selects one property from the object in each iteration and performs the required operations on it.
Let’s try to understand it with the help of an example:
name -> Juan country -> Germany website -> livecodestream.dev
What’s ‘Event Bubbling’ and ‘Capturing’?
Now, if both parent and child elements have registered a handle for a specific event then what will be the order of event propagation?
It can be determined in two ways which are known as event bubbling and capturing.
In event bubbling, the child element will capture the event first and then propagate it to parent elements. Whereas, in event capturing, the parent element will capture the event first and then propagate it to the child elements.
Employers usually try to confuse the applicants by asking tricky questions. So, if you’re not well-prepared then chances are you’ll end up losing the opportunity.
This article was originally published on Live Code Stream by Juan Cruz Martinez (twitter: @bajcmartinez), founder and publisher of Live Code Stream, entrepreneur, developer, author, speaker, and doer of things.
Live Code Stream is also available as a free weekly newsletter. Sign up for updates on everything related to programming, AI, and computer science in general.
Get the TNW newsletter
Get the most important tech news in your inbox each week.Follow @thenextweb