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

50 questions

12345
  • 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: 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: 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: Every team project uses migrations; this checks you can work safely with a shared database schema.

    Answer

    Open full page
  • Why they ask this: Shows you understand the core of the framework and can write testable, loosely coupled code.

    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
  • Why they ask this: Checks that your PHP knowledge is current and not stuck in PHP 5-era habits.

    Answer

    Open full page
  • Why they ask this: Core relational design knowledge for any backend role.

    Answer

    Open full page
  • Why they ask this: Indexes are the first tool for slow queries; this checks real-world database thinking.

    Answer

    Open full page
  • Why they ask this: A favourite academic and interview topic in Nepal; it also shows you can design clean schemas.

    Answer

    Open full page

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

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);
});

Migrations are version control for the database schema. Each migration is a PHP class with an up() method that makes a change and a down() method that reverses it.

php
Schema::create('jobs', function (Blueprint $table) {
    $table->id();
    $table->foreignId('company_id')->constrained()->cascadeOnDelete();
    $table->string('title');
    $table->unsignedInteger('salary_min')->nullable();
    $table->timestamps();
});

Useful commands: php artisan make:migration, migrate, migrate:rollback, migrate:status.

Why they are useful:

  • Every developer and server gets the same schema by running php artisan migrate.
  • Changes are reviewed in Git like any other code.
  • Changes can be rolled back.

Never edit a migration that has already run in production. Create a new one instead.

Dependency injection (DI) means a class receives the objects it needs (its dependencies) from outside, usually through the constructor, instead of creating them itself. This makes code easier to test and swap.

The service container is Laravel's tool for building objects and their dependencies. It uses reflection on type hints to auto-resolve concrete classes, so this works with no configuration:

php
class InvoiceController
{
    public function __construct(private InvoiceService $invoices) {}
}

For interfaces, you tell the container which implementation to use, usually in a service provider:

php
$this->app->bind(PaymentGateway::class, KhaltiGateway::class);
$this->app->singleton(ExchangeRates::class, fn () => new ExchangeRates(config('services.nrb.url')));

Benefits:

  • In tests you can replace an implementation with a fake: $this->app->instance(PaymentGateway::class, new FakeGateway).
  • Switching from eSewa to Khalti only changes one binding, not every class that uses the gateway.
  • 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.

  • Typed properties, union types and return types: public function find(int $id): ?User.
  • Constructor property promotion: public function __construct(private UserRepository $users) {}.
  • Named arguments: str_pad(string: $code, length: 6, pad_string: '0', pad_type: STR_PAD_LEFT).
  • match expression: strict comparison and returns a value, unlike switch.
  • Nullsafe operator: $user?->profile?->phone.
  • Enums (8.1): enum Status: string { case Active = 'active'; }.
  • readonly properties (8.1) and readonly classes (8.2) for immutable value objects and DTOs.
  • First-class callable syntax (8.1): array_map($this->format(...), $rows).
  • Property hooks (8.4): get/set logic declared on a property.
php
enum JobType: string
{
    case FullTime = 'full_time';
    case Internship = 'internship';

    public function label(): string
    {
        return match ($this) {
            self::FullTime => 'Full time',
            self::Internship => 'Internship',
        };
    }
}
  • Primary key: uniquely identifies each row. It cannot be NULL, and a table has only one (it can span several columns, a composite key).
  • Foreign key: a column that references the primary key of another table. It enforces referential integrity, so you cannot add a job for a company that does not exist. Use ON DELETE CASCADE or SET NULL to decide what happens when the parent row is deleted.
  • Unique key: guarantees no duplicate values in a column, such as email. A table can have many. In MySQL and PostgreSQL a unique column can hold several NULLs.
sql
CREATE TABLE jobs (
  id BIGINT PRIMARY KEY AUTO_INCREMENT,
  company_id BIGINT NOT NULL,
  slug VARCHAR(255) NOT NULL UNIQUE,
  FOREIGN KEY (company_id) REFERENCES companies(id) ON DELETE CASCADE
);

An index is a separate data structure (usually a B-tree) that lets the database find rows without scanning the whole table, much like the index at the back of a book.

Benefits: much faster WHERE, JOIN, ORDER BY and lookups on the indexed columns.

Trade-offs:

  • Writes (INSERT, UPDATE, DELETE) get slower because every index must be updated too.
  • Indexes use extra disk space and memory.
  • Indexes on columns with few distinct values (such as a boolean) rarely help on their own.

Composite indexes follow the leftmost-prefix rule: an index on (status, created_at) helps WHERE status = ? and WHERE status = ? ORDER BY created_at, but not WHERE created_at > ? alone.

sql
CREATE INDEX jobs_status_created_at_index ON jobs (status, created_at);
EXPLAIN SELECT * FROM jobs WHERE status = 'open' ORDER BY created_at DESC;

Use EXPLAIN to check whether a query actually uses an index.

Normalisation organises tables to remove duplicate data and the update problems it causes.

  • 1NF: every column holds a single (atomic) value and there are no repeating groups. Not skills = "PHP, SQL"; use a separate row per skill.
  • 2NF: 1NF, and every non-key column depends on the whole primary key. This matters for composite keys: in (student_id, course_id) → student_name, the name depends only on student_id, so move it to a students table.
  • 3NF: 2NF, and non-key columns depend only on the key, not on other non-key columns (no transitive dependency). If employees stores department_id and department_name, move the name to a departments table.

Sometimes you denormalise on purpose for read performance, for example by storing a jobs_count on companies. Do it knowingly and keep the copy in sync.