Why they ask this: Loose equality causes subtle bugs; interviewers want to see that you default to strict comparison.
Answer
=== (strict equality) compares value and type. No conversion happens.== (loose equality) converts the operands to a common type first, then compares.0 == '0' // true (string converted to number)
0 === '0' // false (number vs string)
null == undefined // true
null === undefined// false
'' == 0 // trueAlways use === (and !==) unless you deliberately want conversion. A common, accepted exception is value == null, which checks for both null and undefined.
Why they ask this: A quick check of loops, indexes and the difference between bytes and characters.
Write a function that returns the reverse of a string. Try it without using a built-in reverse helper first. Example
Why they ask this: Tests whether you understand the role and can connect your skills to the company's needs with evidence.
How to answer
Sample answer · STAR
Why they ask this: Tests the two-pointer technique and careful handling of edge cases like spaces and punctuation.
A phrase is a palindrome if, after converting all letters to lowercase and removing every non-alphanumeric character, it reads the same forwards and…
Why they ask this: The company wants to know whether you fit their budget and whether you have researched the market.
How to answer
Sample answer · STAR
Why they ask this: Shows whether you understand how async code actually runs, which matters for debugging ordering and UI freezes.
Answer
Why they ask this: Filters out candidates who cannot write a simple loop with conditions; order of checks is the classic trap.
Return a list of strings for the numbers 1 to n where: multiples of 3 become "Fizz", multiples of 5 become "Buzz", multiples of both 3 and 5 become…
Why they ask this: Interviewers want to know whether you stayed active and how honestly you talk about setbacks.
How to answer
Sample answer · STAR
Why they ask this: A classic fundamentals check that also reveals whether you understand let/const and the temporal dead zone.
Answer
Why they ask this: Checks counting with a hash map and comparing frequency, a pattern used in many string problems.
Given two lowercase strings a and b, return true if b is an anagram of a (it uses exactly the same letters the same number of times), otherwise false. Example 1…
Why they ask this: Checks self-awareness and whether you actively work on improving yourself.
How to answer
Sample answer · STAR
Why they ask this: Bugs with lost this in callbacks are common, and the answer shows depth beyond syntax.
Answer
Match their needs (from the job description) to your proof. Pick the top two or three requirements and give one concrete example for each, then end with your attitude to learning.
Avoid: comparing yourself with other candidates, or vague claims ("I am a fast learner") with no example.
"Your job description asks for three things: Laravel APIs, MySQL, and working with a frontend team.
(Situation/Task) In my internship at a fintech company in Lalitpur, I was asked to build the API for a loan-application form used by their React team.
(Action) I designed the tables, wrote validation with Form Requests, documented every endpoint in Postman, and met the frontend developer daily so the JSON matched what the UI needed.
(Result) The feature went live on schedule, and the team lead asked me to write the API for the next module too.
So you would get someone who has already shipped this exact kind of work, communicates early, and is honest about what I still need to learn, which right now is writing better automated tests."
Avoid: saying "anything is fine", giving a single number far above the market, or using your personal expenses as the reason.
"Based on my research on salary data and job posts for junior React developers in Kathmandu with internship experience, I'm looking for around NPR 35,000 to 45,000 per month before tax.
That said, I'm flexible. Learning opportunities, mentorship and benefits like PF and festival allowance matter to me too. Could you share the budgeted range for this role?"
(Replace the numbers with your own research: ranges change with the role, city, company size and your skills.)
JavaScript runs your code on one thread with a call stack. Async work (timers, network, DOM events) is handled by the browser or Node.js, and their callbacks are queued.
The event loop repeats:
.then, await continuations) and queueMicrotask.setTimeout callback or an event handler, run it, and go back to step 2.console.log('1');
setTimeout(() => console.log('2'), 0);
Promise.resolve().then(() => console.log('3'));
console.log('4');
// Output: 1, 4, 3, 2Microtasks always run before the next timer, even a 0 ms one. A long synchronous loop blocks everything, including clicks and rendering.
Gaps are common, for example waiting for results, preparing for Lok Sewa, visa or family reasons, or a slow job market. Answer honestly and briefly, then move quickly to what you did to keep growing: courses, projects, freelancing, open-source work or volunteering.
Avoid: long excuses, blaming others, or pretending there was no gap.
"After my BE results in 2025, I spent about six months helping with our family business in Butwal while my father recovered from an illness.
(Task) I didn't want my skills to fall behind during that time.
(Action) I set myself a routine of two hours a day: I completed a Laravel course, built a stock-tracking app for our own shop, and published it on GitHub with a README and a live demo on Render.
(Result) The shop still uses that app, and the project taught me more about real requirements than any tutorial. Now that my family situation is stable, I'm fully focused on starting my career as a backend developer."
Hoisting means declarations are processed before code runs, so they are known in their whole scope.
var is hoisted and initialised to undefined.let, const and class are hoisted too, but stay uninitialised (the temporal dead zone) until the declaration line runs. Accessing them earlier throws a ReferenceError.greet(); // works
function greet() { console.log('Namaste'); }
console.log(a); // undefined
var a = 1;
console.log(b); // ReferenceError
let b = 2;Function expressions (const greet = () => {}) follow the rules of the variable they are assigned to.
Choose a real, non-critical weakness (not a core requirement of the job), show what you are doing about it, and give evidence of improvement.
Avoid: fake weaknesses ("I'm a perfectionist", "I work too hard"), and weaknesses that disqualify you (for example "I can't work in a team" for a team role).
"My weakness has been speaking up in meetings, especially with senior people.
(Situation) During my internship, I noticed an issue in an API response format but didn't mention it in the stand-up. It cost the team a day of rework later.
(Action) Since then I write down my points before every meeting, and I made a rule to share at least one update or question in each stand-up. I also joined a local developer meetup in Kathmandu and gave a five-minute lightning talk.
(Result) In my last two months of the internship, my mentor said my updates were among the clearest on the team. It still takes effort, but it no longer stops me from raising problems early."
this depends on how a function is called, not where it is written:
| Call style | this |
|---|---|
obj.method() | obj |
plain fn() | undefined in strict mode (the global object otherwise) |
new Fn() | the new object |
fn.call(x) / fn.apply(x) / fn.bind(x) | x |
| arrow function | this of the surrounding scope (arrows have no own this) |
const user = {
name: 'Hari',
hello() { return this.name; },
later() { setTimeout(() => console.log(this.name)); }, // arrow keeps `this`
};
const fn = user.hello;
fn(); // `this` is lost: undefined in strict modeFix lost this with an arrow function or .bind(obj).