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

37 questions

1234
  • Why they ask this: Tests recursion and how you handle data of unknown depth, which is common with JSON from APIs.

    Given an array that can contain numbers and other arrays nested to any depth, return a single flat array with all the values in their original order. Example

    Open full page
  • Why they ask this: Deadlines are constant in software jobs; interviewers want to see prioritisation and calm, not heroics.

    How to answer

    Show how you prioritised, communicated early about risks, and delivered something useful, even if that meant reducing scope.

    Avoid: stories that rely on skipping sleep for days as the main strategy, or a deadline you missed without learning anything.

    Sample answer · STAR

    Open full page
  • Why they ask this: Common in search boxes, scroll and resize handlers; shows you think about performance.

    Answer

    Open full page
  • Why they ask this: Technology changes constantly, so companies hire juniors who can learn on their own.

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

    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
  • Why they ask this: Accessibility is increasingly expected; it shows care for all users and code quality.

    Answer

    Open full page
  • Why they ask this: Middleware is how cross-cutting concerns like auth are handled; it shows you understand the request lifecycle.

    Answer

    Open full page
  • Why they ask this: Security basics are non-negotiable for backend roles.

    Answer

    Open full page
  • Why they ask this: Shows you know how to keep web requests fast and handle slow work reliably.

    Answer

    Open full page
  • Why they ask this: Most Nepali startups build an API for a React or mobile frontend, so you must know which auth fits.

    Answer

    Open full page

Situation: During my internship, a client needed an event-registration form live in three days for a conference in Kathmandu, and the developer who started it had fallen sick.

Task: I had to finish the form, the admin list and the confirmation emails.

Action: On the first morning I listed every remaining task and agreed with my supervisor which were must-haves (registration, validation, confirmation email) and which could wait (CSV export, payment integration). I posted a short progress update every evening and flagged on day two that email delivery needed the client's SMTP details, so we got them in time.

Result: The must-have features went live a day early, more than 400 people registered, and we added the CSV export the following week. I learnt that agreeing on priorities and raising blockers early matters more than working longer hours.

Both limit how often a function runs:

  • Debounce: run the function only after events stop for a given time. Typical use: a search box that calls the API 300 ms after the user stops typing.
  • Throttle: run the function at most once per interval while events keep firing. Typical use: a scroll handler that runs every 200 ms.
js
function debounce(fn, delay = 300) {
  let timer;
  return (...args) => {
    clearTimeout(timer);
    timer = setTimeout(() => fn(...args), delay);
  };
}

const onSearch = debounce((q) => fetch(`/api/search?q=${encodeURIComponent(q)}`));

Describe how you learn: official documentation, a small proof of concept, asking for help at the right moment. Then show the result of applying it.

Avoid: only listing courses or certificates without showing that you used the skill.

Situation: In my internship, the team decided to add push notifications to their Flutter app, and nobody had used Firebase Cloud Messaging before.

Task: My mentor asked me to research it and build a working prototype within one week.

Action: I read the official FlutterFire documentation first, then built a tiny separate app that only received a test notification. Once that worked, I wrote down the setup steps for Android and iOS and the problems I hit, such as notification permissions on Android 13. I asked a senior for a 20-minute review before integrating it into the main app.

Result: The prototype worked on day four, the feature shipped in the next release, and my setup notes became the team's internal guide. My approach now is always: documentation, a tiny prototype, notes, and then integration.

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.

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

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.

  • Use semantic elements (<button>, <nav>, <main>, headings in order) before reaching for ARIA.
  • Give images meaningful alt text (alt="" for decorative images).
  • Connect every form field to a <label> (for/id, or wrap the input).
  • Make everything usable with the keyboard: a logical tab order and a visible :focus-visible style.
  • Keep enough colour contrast: at least 4.5:1 for normal text (WCAG AA).
  • Use ARIA only to fill gaps, for example aria-expanded on a menu toggle or aria-live for status messages.

Check your work with Lighthouse or axe DevTools and by navigating with only the keyboard.

Middleware is a layer that every matching HTTP request passes through before it reaches the controller, and the response passes back through after. Each middleware can let the request continue ($next($request)), change it, or stop it early.

Common uses:

  • Authentication: auth / auth:sanctum reject guests.
  • Authorisation and roles: for example only admins can reach /admin.
  • Rate limiting: throttle:60,1.
  • CORS, CSRF protection, logging, setting the locale.
php
class EnsureUserIsAdmin
{
    public function handle(Request $request, Closure $next): Response
    {
        if (! $request->user()?->is_admin) {
            abort(403);
        }

        return $next($request);
    }
}

Route::middleware(['auth', EnsureUserIsAdmin::class])->group(function () {
    Route::get('/admin', AdminDashboardController::class);
});
  • SQL injection: the query builder and Eloquent use PDO parameter binding, so user input is never pasted into SQL. Stay safe with raw SQL by passing bindings: DB::select('select * from users where email = ?', [$email]). Never concatenate input into whereRaw.
  • XSS (cross-site scripting): Blade's {{ $value }} escapes output with htmlspecialchars. Only use {!! $value !!} for HTML you have sanitised.
  • CSRF (cross-site request forgery): web routes check a CSRF token on POST, PUT, PATCH and DELETE requests. Add @csrf inside Blade forms. Token-authenticated APIs (for example Sanctum tokens) are not exposed to CSRF in the same way.

Also mention: mass assignment protection with $fillable, validation with Form Requests, hashing passwords with Hash::make (bcrypt or argon2), and authorisation with policies.

A job is a class that does one piece of work. A queue stores jobs so that a separate worker process (php artisan queue:work) runs them in the background.

Use queues for anything slow or unreliable that the user should not wait for:

  • sending emails and SMS,
  • generating PDFs or resizing images,
  • calling third-party APIs (payment verification, AI),
  • importing large CSV files.
php
class SendWelcomeEmail implements ShouldQueue
{
    use Queueable;

    public int $tries = 3;

    public function __construct(public User $user) {}

    public function handle(): void
    {
        Mail::to($this->user)->send(new WelcomeMail($this->user));
    }
}

SendWelcomeEmail::dispatch($user);

Queue drivers include database, redis and Amazon SQS. Failed jobs are stored and can be retried with php artisan queue:retry. In production, keep the worker running with Supervisor (or a platform's worker process) and restart it after each deploy.

  • Session-based: after login the server stores the session (in files, the database or Redis) and sends the browser a session cookie. Each request sends the cookie and the server looks up the session. This is stateful and works best for same-domain web apps. Protect it with CSRF tokens.
  • Token-based: after login the server returns a token that the client sends in the Authorization: Bearer <token> header. This suits mobile apps and third-party clients.
    • Opaque tokens (such as Laravel Sanctum personal access tokens) are stored in the database and are easy to revoke.
    • JWTs are signed and self-contained, so the server does not need a lookup, but they are harder to revoke before they expire.

In Laravel, Sanctum handles both: cookie-based SPA authentication for your own frontend and API tokens for mobile apps. Never store tokens where scripts can read them (such as localStorage) if you can use an httpOnly cookie instead.