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

3 questions

  • Why they ask this: Asked in almost every fresher interview in Nepal; a clear answer with examples stands out.

    Answer

    1. Encapsulation: keep data and the methods that use it together, and hide internal state behind a public interface (private properties, public methods).
    2. Abstraction: expose what an object does and hide how it does it, for example a PaymentGateway interface with a charge() method.
    3. Inheritance: a class reuses and extends another class (class Admin extends User).
    4. Polymorphism: different classes are used through the same interface, and each behaves in its own way.
    php
    interface PaymentGateway
    {
        public function charge(int $amountInPaisa): bool;
    }
    
    final
    
    
    
    
    
    
    
    
    
    
    
    
    
    Open full page
  • Why they ask this: Tests whether you can design flexible code rather than only reciting definitions.

    Answer

    Open full page
  • Why they ask this: Checks design maturity; deep inheritance trees are a common source of rigid code.

    Answer

    Open full page
class
EsewaGateway
implements
PaymentGateway
{
public function charge(int $amountInPaisa): bool { /* call eSewa */ return true; }
}
final class KhaltiGateway implements PaymentGateway
{
public function charge(int $amountInPaisa): bool { /* call Khalti */ return true; }
}
function checkout(PaymentGateway $gateway): void
{
$gateway->charge(150000); // polymorphism: works with either gateway
}
InterfaceAbstract class
Containsmethod signatures (and constants)abstract and implemented methods, plus properties
A class can usemany interfacesonly one parent class (in PHP, Java and Dart)
Constructor and statenoyes
Meaning"can do" (a capability)"is a" (a shared base)
  • Use an interface to define a contract that unrelated classes can implement: Cacheable, PaymentGateway.
  • Use an abstract class to share code between closely related classes that differ in a few steps, for example a Report base class with an abstract rows() method.

In PHP you can combine both, and use traits to share code horizontally. Dart has no interface keyword in older versions: every class can be implemented with implements, and Dart 3 adds interface class.

  • Inheritance ("is a") ties a child class tightly to its parent. A change in the parent can break every child, and deep hierarchies become hard to change.
  • Composition ("has a") builds behaviour by holding other objects and delegating to them. Parts can be swapped, tested alone and combined freely.
php
// Inheritance: every new notification channel needs a new subclass
class SmsOrderNotifier extends OrderNotifier { /* ... */ }

// Composition: inject the channel
final class OrderNotifier
{
    public function __construct(private NotificationChannel $channel) {}

    public function notify(Order $order): void
    {
        $this->channel->send($order->customer, "Order #{$order->id} confirmed");
    }
}

Inheritance is still fine for a true, stable "is a" relationship with shared behaviour. Flutter is a good example of composition: UIs are built by nesting small widgets rather than extending big ones.