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

2 questions

  • 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: Forms are in every app; this shows how you handle user input and validation.

    Answer

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

    Open full page