TechHire NepalConnecting Talent, Building Careers
Find JobsCompaniesCourses
Find Talents
Sign inGet Started →
Find JobsCompaniesCourses
Find Talents
Sign inGet StartedHire Talent
TechHire Nepal

Nepal's #1 tech job platform. Connecting top talent with the best companies.

For Job Seekers

  • Browse Jobs
  • Companies
  • Tech Salaries
  • Interview Prep
  • Courses
  • Career Advice

For Employers

  • Post a Job
  • Talent Search
  • Pricing
  • Employer Dashboard

Company

  • About
  • Blog
  • Careers
  • Contact

Resources

  • Training Institutes
  • Projects
  • Tutorials
  • Roadmaps
  • Notes
  • Open Sources

Community

  • Discussions
  • Tech Events
  • Hackathons
  • Developer Meetups
  • Tech News

More

  • Help & Support
  • Salary Tax Calculator
  • Company Registration Guide
  • Labour Act

Stay in the loop

A weekly digest of the best tech articles and jobs in Nepal.

© 2026 TechHire Nepal. All rights reserved.

Privacy PolicyTerms of ServiceCookie Policy
HomeInterview PrepQuestion bank
Question bank

Interview Questions, Answered Clearly

Filter by the role you are applying for, open a question, and practise explaining the answer out loud. Mark it practised when you can.

Type
TechnicalCodingHR / BehaviouralAll types
Role
All rolesFrontend DeveloperBackend DeveloperFull-Stack DeveloperMobile Developer
Topic
All topicsJavaScript10React7HTML & CSS7PHP & Laravel9SQL & Databases6HTTP & REST APIs6Git4OOP & Design4Flutter5React Native5Arrays & Hashing4Strings3Searching & Stacks2Logic Basics1HR Basics
Level
AnyEasyMediumHard

27 questions

123
9
Behavioural (STAR)3
  • 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.

    js
    function makeCounter() {
      let count = 0; // private to the closure
      return {
        increment: () => ++count,
        current: () => count,
      };
    }
    
    const
    
    
    
    Open full page
  • 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

    Open full page
  • Why they ask this: The most common Eloquent performance bug; it shows you think about the queries your code runs.

    Answer

    Open full page
  • Why they ask this: An open-ended classic that shows how broad your understanding of the web is.

    Answer

    Open full page
  • 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

    Open full page
  • Why they ask this: Shows whether you understand how async code actually runs, which matters for debugging ordering and UI freezes.

    Answer

    Open full page
  • 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

    Open full page
  • Why they ask this: Checks self-awareness and whether you actively work on improving yourself.

    How to answer

    Sample answer · STAR

    Open full page
  • Why they ask this: Bugs with lost this in callbacks are common, and the answer shows depth beyond syntax.

    Answer

    Open full page
  • 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

    Open full page
  • Why they ask this: Almost every app calls APIs; interviewers check you can write and handle async code correctly.

    Answer

    Open full page
  • Why they ask this: Tests your understanding of DOM event bubbling and performance with dynamic lists.

    Answer

    Open full page
counter
=
makeCounter
();
counter.increment();
counter.increment();
console.log(counter.current()); // 2

Practical uses:

  • Data privacy: count cannot be changed from outside.
  • Function factories, for example const add5 = makeAdder(5).
  • Callbacks and event handlers that remember values.
  • React hooks: every render's handlers close over that render's state, which is why stale state bugs happen.

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).

php
// 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:

php
$posts = Post::with('author')->get();           // 2 queries in total
$posts = Post::with(['author', 'comments'])->get();
$count = Post::withCount('comments')->get();     // comments_count without loading them

Find N+1 problems with Laravel Debugbar or Telescope, or make them fail loudly in development with Model::preventLazyLoading(! app()->isProduction());.

  1. URL parsing: the browser works out the scheme (https), host and path.
  2. DNS lookup: the hostname is resolved to an IP address (browser cache → OS cache → resolver → root, TLD and authoritative name servers).
  3. TCP connection to the server on port 443 (a three-way handshake). HTTP/3 uses QUIC over UDP instead.
  4. TLS handshake: the server proves its identity with a certificate and both sides agree on encryption keys.
  5. HTTP request: for example GET /jobs with headers and cookies.
  6. Server side: a load balancer or web server (Nginx) passes the request to the app (Laravel or Node), which may query the database and returns a response, often via a CDN cache.
  7. Rendering: the browser parses HTML into the DOM and CSS into the CSSOM, runs JavaScript, builds the render tree, then does layout and paint.
  8. Extra requests load images, scripts and fonts, and caching headers decide what is reused next time.

Go deeper on whichever part matches the role you are applying for.

  • Research first: check salary data for your role and experience level in Nepal (for example TechHire salary insights), ask seniors, and read job posts that show salary bands.
  • Give a realistic monthly range in NPR, with the lower end being an amount you would genuinely accept.
  • Mention that you are flexible depending on the full package: festival bonus (Dashain allowance), provident fund (PF) and citizen investment trust (CIT) contributions, insurance, learning budget, and work-from-home days.
  • Ask whether the figure is gross or net of tax if it is unclear.
  • If asked very early, it is fine to ask about the role's budgeted range first.

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:

  1. Run the current script until the call stack is empty.
  2. Run all microtasks: promise callbacks (.then, await continuations) and queueMicrotask.
  3. Let the browser render if needed.
  4. Take one macrotask (task) such as a setTimeout callback or an event handler, run it, and go back to step 2.
js
console.log('1');
setTimeout(() => console.log('2'), 0);
Promise.resolve().then(() => console.log('3'));
console.log('4');
// Output: 1, 4, 3, 2

Microtasks 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 stylethis
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 functionthis of the surrounding scope (arrows have no own this)
js
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 mode

Fix 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.

js
// 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:

  • An async function always returns a promise.
  • Use try/catch for errors with await.
  • Run independent requests in parallel with 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.

js
document.querySelector('#todo-list').addEventListener('click', (event) => {
  const button = event.target.closest('button.delete');
  if (!button) return;
  button.closest('li').remove();
});

Benefits:

  • One listener instead of hundreds, which uses less memory.
  • Works for elements added later, with no need to re-attach listeners.

Use event.stopPropagation() carefully, because it breaks delegation for listeners higher up.