Filter by the role you are applying for, open a question, and practise explaining the answer out loud. Mark it practised when you can.
Why they ask this: Closures power callbacks, React hooks, module patterns and data privacy, so they show how well you know the language.
Answer
A closure is a function together with the variables from the scope where it was created. The inner function keeps access to those variables even after the outer function has returned.
function makeCounter() {
let count = 0; // private to the closure
return {
increment: () => ++count,
current: () => count,
};
}
const
Why they ask this: Software is built in teams; interviewers look for respect, communication and a focus on the outcome.
How to answer
Sample answer · STAR
Why they ask this: The most common Eloquent performance bug; it shows you think about the queries your code runs.
Answer
Why they ask this: An open-ended classic that shows how broad your understanding of the web is.
Answer
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: 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: 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
Why they ask this: A classic dynamic programming problem that shows whether you can improve an O(n²) idea to O(n).
Given an integer array nums with at least one element, find the contiguous subarray with the largest sum and return that sum. Example 1 Example 2
Why they ask this: Almost every app calls APIs; interviewers check you can write and handle async code correctly.
Answer
Why they ask this: Tests your understanding of DOM event bubbling and performance with dynamic lists.
Answer
Practical uses:
count cannot be changed from outside.const add5 = makeAdder(5).Use STAR and focus on your actions. Show that you listened, kept it about the work (not the person), found a fair solution, and that the project benefited.
Avoid: blaming a teammate, a story where you "won" the argument, or saying you have never had a conflict.
Situation: In our final-year project, two teammates and I were building a college attendance app. One teammate wanted to switch from React to Vue three weeks before our internal demo because he was more comfortable with it.
Task: As the person handling the frontend integration, I needed us to agree quickly without hurting the team.
Action: I asked to talk one to one first and listened to his reasons. He was struggling with React state and felt behind. I suggested we keep React because two of us already had working screens, and I offered to pair-program with him for an hour each evening that week. I also split the tasks so he owned the reports screen, which used simpler components.
Result: We finished the demo on time, he became confident with React hooks, and our supervisor rated the project "excellent". I learnt that many technical disagreements are really about confidence or workload, and that solving the real issue works better than arguing about tools.
The N+1 problem happens when you load a list (1 query) and then run one more query per item to load a relationship (N queries).
// 1 query for posts + 1 query per post for its author = N+1
$posts = Post::all();
foreach ($posts as $post) {
echo $post->author->name;
}Fix it with eager loading, which loads the relationship for all rows in one extra query:
$posts = Post::with('author')->get(); // 2 queries in total
$posts = Post::with(['author', 'comments'])->get();
$count = Post::withCount('comments')->get(); // comments_count without loading themFind N+1 problems with Laravel Debugbar or Telescope, or make them fail loudly in development with Model::preventLazyLoading(! app()->isProduction());.
https), host and path.GET /jobs with headers and cookies.Go deeper on whichever part matches the role you are applying for.
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."
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).
A Promise represents a value that will be available later (pending, then fulfilled or rejected). async/await is syntax on top of promises that makes async code read like synchronous code.
// Promise chain
fetch('/api/jobs')
.then((res) => res.json())
.then((jobs) => console.log(jobs))
.catch((err) => console.error(err));
// async/await
async function loadJobs() {
try {
const res = await fetch('/api/jobs');
if (!res.ok) throw new Error(`HTTP ${res.status}`);
return await res.json();
} catch (err) {
console.error(err);
}
}Points worth mentioning:
async function always returns a promise.try/catch for errors with await.await Promise.all([...]) instead of awaiting one after another.Most DOM events bubble up from the target element to its ancestors. Event delegation puts one listener on a parent and uses event.target to work out which child was clicked.
document.querySelector('#todo-list').addEventListener('click', (event) => {
const button = event.target.closest('button.delete');
if (!button) return;
button.closest('li').remove();
});Benefits:
Use event.stopPropagation() carefully, because it breaks delegation for listeners higher up.