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 Native5
Level
AnyEasyMediumHard

4 questions

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

    Answer

    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.

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

    Answer

    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.

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

    Answer

    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.
    Open full page
  • Why they ask this: The most basic React concept; a weak answer is a red flag for any React role.

    Answer

    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.

    Open full page