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 Basics9Behavioural (STAR)3
Level
AnyEasyMediumHard

85 questions

23456
  • Why they ask this: Asked at the end of almost every interview. Good questions show genuine interest and help you judge the company.

    How to answer

    Always have two or three questions ready. Saying "No, everything is clear" is a missed opportunity. Good questions are about the work, the team and growth:

    • "What would a typical first month look like for this role?"
    • "How do junior developers get feedback: code reviews, mentoring, one-to-ones?"
    • "What does the tech stack look like, and what are you planning to change?"
    • "How do you measure success for this position after six months?"
    • "What are the next steps in the hiring process, and when can I expect to hear back?"

    Ask about salary and leave after an offer or when HR raises it, unless they ask you first.

    Sample answer · STAR

    "Yes, thank you. I have two questions.

    First, what would success look like for someone in this role after the first three months?

    Second, how does the team review code? I'd like to understand how juniors get feedback so I can improve quickly.

    And finally, what are the next steps in the process?"

    Open full page
  • Why they ask this: Hooks are how modern React is written; breaking the rules causes hard-to-find bugs.

    Answer

    Open full page
  • Why they ask this: Many companies are in Kathmandu Valley, while others are remote or hybrid; HR needs to know whether the arrangement works for you.

    How to answer

    Sample answer · STAR

    Open full page
  • Why they ask this: Most React bugs (infinite loops, stale data, memory leaks) come from misusing useEffect.

    Answer

    Open full page
  • Why they ask this: Wrong keys cause subtle UI bugs, so this checks practical experience.

    Answer

    Open full page
  • Why they ask this: Forms are in every app; this shows how you handle user input and validation.

    Answer

    Open full page
  • Why they ask this: The most basic React concept; a weak answer is a red flag for any React role.

    Answer

    Open full page
  • Why they ask this: Separates candidates who understand rendering performance from those who memoise everything by habit.

    Answer

    Open full page
  • Why they ask this: Shows you care about accessibility and SEO, not only how a page looks.

    Answer

    Open full page
  • Why they ask this: Layout bugs often come from misunderstanding widths, padding and borders.

    Answer

    Open full page
  • Why they ask this: Checks you can choose the right layout tool instead of fighting CSS.

    Answer

    Open full page
  • Why they ask this: Explains "why is my style not applying?" problems that every frontend developer hits.

    Answer

    Open full page

Hooks are functions that let function components use React features: useState (state), useEffect (side effects), useContext, useRef, useMemo, useCallback, and your own custom hooks (useSomething).

Rules of hooks:

  1. Call hooks only at the top level of a component or custom hook, never inside conditions, loops or nested functions. React identifies each hook by its call order.
  2. Call hooks only from React function components or custom hooks, not from regular functions.
jsx
function Profile({ userId }) {
  const [user, setUser] = useState(null);       // top level: OK
  // if (userId) { useEffect(...) }             // wrong: conditional hook
  useEffect(() => {
    if (!userId) return;                         // put the condition inside
    fetch(`/api/users/${userId}`).then((r) => r.json()).then(setUser);
  }, [userId]);
  return <p>{user?.name}</p>;
}

The eslint-plugin-react-hooks lint rules catch most mistakes.

Be honest and specific about what you can do: relocating to Kathmandu, Lalitpur or Pokhara, working on-site or hybrid, or remotely with a reliable internet connection and power backup. If you have constraints, explain them briefly and offer a solution.

For remote roles, show that you can work independently: a quiet workspace, a backup internet connection (or a mobile data plan), and clear communication habits.

Avoid: saying yes to something you cannot actually do. It will cause problems after you join.

"Yes. I'm currently in Chitwan, and I'm ready to move to Kathmandu within two weeks of an offer. I have relatives in Lalitpur where I can stay at first.

I'm also comfortable with a hybrid setup. During my remote internship last year I worked with a fibre connection plus a mobile data backup, posted daily written updates on Slack, and joined every stand-up on time, so I know how to stay visible and productive when working from home."

useEffect(effect, deps) runs effect after render:

  • No array: runs after every render.
  • []: runs once after the first render (mount).
  • [a, b]: runs after the first render and again whenever a or b changes (compared with Object.is).

The function you return is the cleanup. It runs before the effect runs again and when the component unmounts. Use it to remove listeners, clear timers and cancel requests.

jsx
useEffect(() => {
  const controller = new AbortController();
  fetch(`/api/jobs?q=${query}`, { signal: controller.signal })
    .then((r) => r.json())
    .then(setJobs)
    .catch(() => {});
  return () => controller.abort(); // cancel the old request when query changes
}, [query]);

Include every value from the component that the effect uses in the array. Missing dependencies cause stale values.

A key gives each list item a stable identity, so React can tell which items were added, removed or reordered between renders and keep the right state and DOM node for each one.

jsx
{todos.map((todo) => (
  <TodoItem key={todo.id} todo={todo} />
))}
  • Use a stable, unique id from your data.
  • Avoid the array index as a key when items can be inserted, deleted or reordered. React would then match state (such as an input's text) to the wrong item.
  • Keys only need to be unique among siblings.
  • Controlled: React state is the single source of truth. The input's value comes from state and every change goes through onChange.
  • Uncontrolled: the DOM keeps the value. You read it when needed with a ref or from the form data on submit.
jsx
// Controlled
const [email, setEmail] = useState('');
<input value={email} onChange={(e) => setEmail(e.target.value)} />

// Uncontrolled
const inputRef = useRef(null);
<input ref={inputRef} defaultValue="" />
// later: inputRef.current.value

Choose controlled inputs for instant validation, formatting or conditional UI. Uncontrolled inputs are simpler for basic forms and file inputs (<input type="file"> is always uncontrolled). Form libraries such as React Hook Form mostly use uncontrolled inputs for performance.

PropsState
Owned bythe parentthe component itself
Changeable by the component?No, read-onlyYes, through the setter (setX)
Purposeconfigure a component and pass data downdata that changes over time
jsx
function Counter({ step }) {          // step is a prop
  const [count, setCount] = useState(0); // count is state
  return <button onClick={() => setCount((c) => c + step)}>{count}</button>;
}

Changing either one re-renders the component. When two siblings need the same data, lift the state up to their common parent and pass it down as props.

  • useMemo(fn, deps) caches a computed value until deps change.
  • useCallback(fn, deps) caches a function reference until deps change. It is the same as useMemo(() => fn, deps).

Use them when:

  1. A calculation is genuinely expensive, such as filtering or sorting thousands of rows.
  2. You pass an object or function to a child wrapped in React.memo, and a new reference every render would defeat it.
  3. The value is a dependency of another hook (useEffect) and a new reference would re-run it every render.
jsx
const visibleJobs = useMemo(
  () => jobs.filter((j) => j.title.toLowerCase().includes(query.toLowerCase())),
  [jobs, query],
);
const handleSelect = useCallback((id) => setSelected(id), []);

Skip them for cheap calculations and for handlers passed to plain DOM elements. Memoisation itself costs memory and comparisons, so measure with the React DevTools Profiler before you optimise. (React Compiler can add this memoisation automatically in projects that use it.)

Semantic HTML uses elements that describe their meaning, not only their appearance: <header>, <nav>, <main>, <article>, <section>, <aside>, <footer>, <button>, <label>, and headings <h1>–<h6> in order.

Why it matters:

  • Accessibility: screen readers use these landmarks and roles to navigate. A <button> is keyboard-focusable and clickable with Enter or Space by default; a clickable <div> is not.
  • SEO: search engines understand the page structure better.
  • Maintainability: the markup is easier for other developers to read.
html
<main>
  <article>
    <h1>Frontend Developer at Kathmandu Tech</h1>
    <p>...</p>
    <button type="button">Apply now</button>
  </article>
</main>

Every element is a box made of four layers, from inside out: content → padding → border → margin.

  • With the default box-sizing: content-box, width sets only the content. Padding and border are added on top, so width: 200px; padding: 20px; border: 1px renders 242px wide.
  • With box-sizing: border-box, width includes padding and border, so the element stays 200px wide. This is far easier to reason about.
css
*, *::before, *::after {
  box-sizing: border-box;
}

Margins are outside the box and can collapse: vertical margins of adjacent block elements combine into the larger of the two instead of adding up.

  • Flexbox is one-dimensional: it lays items out in a row or a column. It is great for navbars, toolbars, centring, and spacing items whose size comes from their content.
  • Grid is two-dimensional: rows and columns together. It is great for page layouts, card galleries and dashboards.
css
/* Flexbox: navbar */
.nav { display: flex; justify-content: space-between; align-items: center; gap: 1rem; }

/* Grid: responsive cards */
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 1rem; }

They work well together, for example a Grid page layout with Flexbox inside each card.

When several rules target the same element, the browser picks the one with the highest specificity. If specificity is equal, the rule that appears later wins.

Specificity is compared as (IDs, classes/attributes/pseudo-classes, elements/pseudo-elements):

SelectorSpecificity
p(0, 0, 1)
.card p(0, 1, 1)
#main .card p(1, 1, 1)
inline style=""beats any selector
!importantoverrides normal declarations; avoid it

:where() adds zero specificity, while :is() and :not() take the specificity of their most specific argument.

Keep specificity low and flat (for example single classes with a BEM-style or utility approach) so styles stay easy to override.