Filter by the role you are applying for, open a question, and practise explaining the answer out loud. Mark it practised when you can.
Why they ask this: Conflicts happen weekly in team projects; interviewers want to see you stay calm and methodical.
Answer
A conflict happens when two branches change the same lines of a file (or one deletes a file the other edits), so Git cannot combine them automatically.
git status to see the conflicted files.<<<<<<< HEAD
const API_URL = '/api/v1';
=======
const API_URL = '/api/v2';
>>>>>>> feature/new-apigit add <file>, then git commit (for a merge) or git rebase --continue (for a rebase).To give up and start again, use git merge --abort or git rebase --abort. VS Code's merge editor makes the "accept current / incoming / both" choice easier.
Why they ask this: Your GitHub history is often the first code a Nepali recruiter or tech lead looks at.
Answer
Good commits:
Add password reset email. Add a body explaining why when it is not obvious.feat: add job filters, fix: handle empty salary, docs: update README..env), node_modules or vendor. Use .gitignore.A simple branching workflow (GitHub flow):
main always deployable.feature/job-search, fix/login-redirect.Larger teams may add a develop branch or release branches (Git Flow), but GitHub flow is enough for most projects.
Why they ask this: Asked in almost every fresher interview in Nepal; a clear answer with examples stands out.
Answer
private properties, public methods).PaymentGateway interface with a charge() method.class Admin extends User).interface PaymentGateway
{
public function charge(int $amountInPaisa): bool;
}
final 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
}Why they ask this: Tests whether you can design flexible code rather than only reciting definitions.
Answer
| Interface | Abstract class | |
|---|---|---|
| Contains | method signatures (and constants) | abstract and implemented methods, plus properties |
| A class can use | many interfaces | only one parent class (in PHP, Java and Dart) |
| Constructor and state | no | yes |
| Meaning | "can do" (a capability) | "is a" (a shared base) |
Cacheable, PaymentGateway.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.
Why they ask this: Mid-level and good junior candidates are expected to know how to keep code maintainable.
Answer
KhaltiGateway class instead of adding another if to existing code.Do not just recite the list: give one real example from your own project of a principle you applied, or one you broke and later fixed.
Why they ask this: Checks design maturity; deep inheritance trees are a common source of rigid code.
Answer
// 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.
Why they ask this: A practical question that shows real hands-on Flutter experience.
Answer
main(), so all state is lost. It is still faster than a full rebuild.AndroidManifest.xml or Info.plist edits, and some asset changes.Hot reload will not pick up changes to main(), initState() logic that already ran, global or static variable initialisers, or enum and generic type changes. Use hot restart for those.
Why they ask this: There is no single right answer; interviewers want reasoning, not a favourite library.
Answer
setState: local state inside one widget. Simple and perfectly fine for small screens.InheritedWidget / ValueNotifier + ValueListenableBuilder: built into Flutter and lightweight.InheritedWidget. Good for simple app-wide state, such as the logged-in user or the theme.BuildContext. Good for async data and testing.How to choose: keep state as local as possible. Pick a shared solution when several screens need the same data. Consider the team's experience, how testable it is, and how much boilerplate you can accept. Be ready to explain one approach in depth with code from a project you built.
Why they ask this: Misusing BuildContext causes common runtime errors, so this tests deeper Flutter knowledge.
Answer
A BuildContext is a handle to a widget's location in the widget tree (it is actually the widget's Element). It is used to look up the tree for inherited data and services:
final theme = Theme.of(context);
final size = MediaQuery.sizeOf(context);
Navigator.of(context).push(MaterialPageRoute(builder: (_) => const JobScreen()));
ScaffoldMessenger.of(context).showSnackBar(const SnackBar(content: Text('Saved')));Common pitfalls:
Scaffold.of(context) fails if context belongs to a widget above the Scaffold. Wrap the child in a Builder to get a context below it.await, the widget may have been removed. Check if (!context.mounted) return; before using the context again.Why they ask this: Networking, databases and real-time features in Flutter depend on async Dart.
Answer
Future<T> delivers one value (or an error) later, such as an HTTP response. Use it with async/await or FutureBuilder.Stream<T> delivers many values over time, such as location updates, Firestore snapshots, WebSocket messages or user input. Use it with await for, listen() or StreamBuilder.Future<List<Job>> fetchJobs() async {
final res = await http.get(Uri.parse('https://api.example.com/jobs'));
if (res.statusCode != 200) throw Exception('Failed: ${res.statusCode}');
return (jsonDecode(res.body) as List).map((j) => Job.fromJson(j)).toList();
}
Stream<int> countdown(int from) async* {
for (var i = from; i >= 0; i--) {
await Future.delayed(const Duration(seconds: 1));
yield i;
}
}Always cancel stream subscriptions in dispose() to avoid memory leaks.
Why they ask this: Checks that you understand the trade-offs of the stack you are applying to work on.
Answer
<View> becomes an Android View or an iOS UIView). The New Architecture (JSI, Fabric and TurboModules) lets JavaScript call native code directly instead of through the old asynchronous bridge.How to choose: React Native suits teams that already know React and want to share logic with the web. Flutter offers very consistent UI and strong performance. Native is best for heavy platform-specific features. Both cross-platform options can call native modules when needed.
Why they ask this: Long lists are the most common performance problem in React Native apps.
Answer
ScrollView renders all of its children at once. That is fine for short, fixed content such as a settings screen.FlatList is virtualised: it renders only the items near the screen and recycles the rest. Use it for long or unknown-length lists such as feeds, job lists and chat.<FlatList
data={jobs}
keyExtractor={(job) => String(job.id)}
renderItem={({ item }) => <JobCard job={item} />}
onEndReached={loadMore} // infinite scroll
onEndReachedThreshold={0.5}
refreshing={refreshing}
onRefresh={refresh} // pull to refresh
/>Use SectionList for grouped data. For extra speed, memoise the item component, give a stable keyExtractor, and use getItemLayout when every row has the same height. FlashList (from Shopify) is a popular faster alternative.