1
What is microservices architecture? How does it compare to monolithic?
System Design▼Monolithic: Single deployable unit containing all application logic — UI, business logic, data access in one codebase.
Microservices: Application decomposed into small, independent services, each running its own process and communicating via APIs.
Comparison:
Microservices: Application decomposed into small, independent services, each running its own process and communicating via APIs.
Comparison:
- Deployment: Monolith = deploy everything together; Microservices = deploy independently
- Scaling: Monolith = scale entire app; Microservices = scale individual services
- Technology: Monolith = one tech stack; Microservices = polyglot (different languages/databases per service)
- Complexity: Monolith = simpler initially; Microservices = operational complexity (networking, monitoring, orchestration)
- Team Structure: Monolith = one team; Microservices = small autonomous teams per service
💡 Viva Tip
Don't dogmatically favor microservices. A good answer acknowledges trade-offs: "Start monolithic, extract microservices when needed." Mention service mesh, API gateway, and container orchestration (Kubernetes).
2
Design a URL shortener (like bit.ly). Walk me through the architecture.
System Design▼Requirements: Given a long URL, generate a short URL; when short URL is accessed, redirect to original.
Core Design:
Core Design:
- Short URL Generation: Base62 encoding (a-z, A-Z, 0-9) of a unique ID. 7 characters = 62^7 = 3.5 trillion unique URLs
- Database: store mapping {short_code → long_url, created_at, expiry, user_id}
- API: POST /shorten {url} → returns short URL; GET /{code} → 301 redirect
- Load Balancer: Distributes traffic across application servers
- Application Server: Handles URL creation and redirect logic
- Cache (Redis): Cache popular short URLs for fast lookups (~80% hit rate)
- Database (NoSQL): DynamoDB or Cassandra for high write throughput
- ID Generator: Distributed ID generation — Twitter Snowflake or pre-generated ID ranges
💡 Viva Tip
Structure your answer: Requirements → Estimation → High-level design → Deep dive → Trade-offs. Mention 301 (permanent) vs 302 (temporary) redirect and their SEO implications.
3
What is a REST API? What are the key principles?
System Design▼REST (Representational State Transfer) is an architectural style for designing networked applications using HTTP.
Key Principles:
Key Principles:
- Stateless: Each request contains all information needed — server doesn't store session state
- Resource-based: Everything is a resource identified by URI (e.g., /users/123)
- HTTP Methods: GET (read), POST (create), PUT (full update), PATCH (partial update), DELETE (remove)
- Uniform Interface: Consistent URL patterns and response formats
- Representations: Resources returned as JSON/XML
- Use nouns for URLs:
/usersnot/getUsers - Use HTTP status codes: 200 (OK), 201 (Created), 400 (Bad Request), 404 (Not Found), 500 (Server Error)
- Versioning:
/api/v1/users - Pagination:
/users?page=2&limit=20 - Filtering:
/users?role=admin&status=active
💡 Viva Tip
Know the Richardson Maturity Model (Level 0-3). Be ready to design a REST API on the whiteboard: "Design API for an e-commerce cart" — define endpoints, methods, request/response bodies.
4
Explain SOLID principles with examples.
Coding Concepts▼- S — Single Responsibility: A class should have one reason to change. Don't put email sending logic in a User class — create a separate EmailService
- O — Open/Closed: Open for extension, closed for modification. Use interfaces/abstract classes so new behavior can be added without changing existing code
- L — Liskov Substitution: Subtypes must be substitutable for their base types. If Square extends Rectangle, it shouldn't break when used as a Rectangle
- I — Interface Segregation: Many specific interfaces are better than one general interface. Don't force a Bird class to implement swim() if only Duck needs it
- D — Dependency Inversion: Depend on abstractions, not concretions. A NotificationService should depend on an IMessageSender interface, not directly on SmsSender
💡 Viva Tip
Don't just recite definitions — give concrete examples. "In our project, we violated SRP when our UserController handled authentication, profile updates, AND email sending. We refactored into separate services."
5
What are design patterns? Name and explain three commonly used ones.
Coding Concepts▼Design patterns are reusable solutions to common software design problems (Gang of Four — 23 patterns).
1. Singleton (Creational):
1. Singleton (Creational):
- Ensures only one instance of a class exists globally
- Use case: Database connection pool, configuration manager, logger
- Implementation: Private constructor, static instance method
- Caution: Can make testing difficult; avoid overuse
- Defines one-to-many dependency — when subject changes, all observers are notified
- Use case: Event systems, UI frameworks, pub/sub messaging
- Real example: YouTube subscribe — when a channel uploads, all subscribers get notifications
- Defines a family of algorithms, encapsulates each one, makes them interchangeable
- Use case: Payment processing (CreditCard, bKash, Nagad strategies), sorting algorithms
- Eliminates complex if-else chains by polymorphism
💡 Viva Tip
Connect patterns to real work: "We used Strategy pattern for our notification service — SMS, email, and push notification each implement INotifier interface." Framework knowledge helps: Spring uses Singleton, Observer; React uses Observer (state).
6
What is the difference between concurrency and parallelism?
Coding Concepts▼Concurrency: Managing multiple tasks by interleaving their execution — tasks make progress within overlapping time periods. One CPU can handle concurrency by switching between tasks.
Parallelism: Executing multiple tasks simultaneously — requires multiple CPU cores. Tasks literally run at the same time.
Analogy:
Parallelism: Executing multiple tasks simultaneously — requires multiple CPU cores. Tasks literally run at the same time.
Analogy:
- Concurrency: One chef cooking two dishes — chopping vegetables for dish A, then stirring dish B, back to A
- Parallelism: Two chefs each cooking one dish simultaneously
- Threads: Shared memory, lightweight, need synchronization (mutex, semaphore)
- Processes: Separate memory, heavier, communicate via IPC
- Async/Await: Non-blocking I/O — single thread handles many concurrent operations (Node.js, Python asyncio)
💡 Viva Tip
Know thread safety concepts. A classic follow-up: "How would you make a counter thread-safe?" → Use atomic operations, synchronized blocks, or concurrent data structures.
7
What is database indexing? How does it improve query performance?
Database▼Database Index is a data structure (usually B-tree or B+ tree) that speeds up data retrieval at the cost of additional storage and slower writes.
How it works: Without index: full table scan (O(n)). With index: B-tree lookup (O(log n)).
Types:
How it works: Without index: full table scan (O(n)). With index: B-tree lookup (O(log n)).
Types:
- Primary Index: On primary key (auto-created)
- Secondary/Non-clustered: On non-primary columns (CREATE INDEX)
- Composite: On multiple columns — column order matters!
- Unique Index: Enforces uniqueness constraint
- Full-text Index: For text search (MATCH AGAINST)
- ✅ Faster SELECT queries
- ❌ Slower INSERT/UPDATE/DELETE (index must be updated)
- ❌ Extra disk space
- ❌ Too many indexes = diminishing returns
💡 Viva Tip
Know EXPLAIN/EXPLAIN ANALYZE to check query execution plans. Common follow-up: "Your query is slow — how do you debug it?" → EXPLAIN, check indexes, optimize JOINs, avoid SELECT *.
8
SQL vs NoSQL — when would you choose each?
Database▼SQL (Relational): MySQL, PostgreSQL, Oracle
- Structured data with defined schema
- ACID transactions (Atomicity, Consistency, Isolation, Durability)
- Complex queries with JOINs
- Vertical scaling primarily
- Best for: Financial data, inventory, order management, CRM
- Document (MongoDB): Flexible JSON-like documents — content management, user profiles
- Key-Value (Redis, DynamoDB): Fast lookups — caching, session storage, leaderboards
- Column-Family (Cassandra): Wide columns — time-series data, IoT, analytics
- Graph (Neo4j): Relationships — social networks, recommendation engines
- Need ACID? → SQL
- Flexible schema? → NoSQL (Document)
- Extreme scale? → NoSQL (Cassandra, DynamoDB)
- Complex relationships? → SQL or Graph NoSQL
- Caching/speed? → Redis
💡 Viva Tip
Avoid "NoSQL is always better for scale." Many companies use both (polyglot persistence). Know CAP theorem: in a distributed system, you can only guarantee 2 of 3: Consistency, Availability, Partition tolerance.
9
What is database normalization? Explain up to 3NF.
Database▼Normalization organizes database tables to reduce redundancy and dependency.
1NF (First Normal Form):
1NF (First Normal Form):
- Each column contains atomic (indivisible) values
- Each column has a unique name
- No repeating groups or arrays
- ❌ "Skills: Java, Python, SQL" in one column → ✅ Separate rows or junction table
- Must be in 1NF
- All non-key columns depend on the entire primary key (no partial dependency)
- Relevant when composite primary key exists
- ❌ {StudentID, CourseID} → StudentName depends only on StudentID → Move to Student table
- Must be in 2NF
- No transitive dependency — non-key columns don't depend on other non-key columns
- ❌ EmployeeTable: DeptID → DeptName (DeptName depends on DeptID, not EmployeeID) → Move to Department table
💡 Viva Tip
Know when NOT to normalize: read-heavy systems, data warehouses, and analytics databases often use denormalized star/snowflake schemas for performance.
10
What is CI/CD? Explain the pipeline stages.
DevOps▼CI (Continuous Integration): Developers frequently merge code to main branch; each merge triggers automated builds and tests.
CD (Continuous Delivery/Deployment):
CD (Continuous Delivery/Deployment):
- Continuous Delivery: Code is always in a deployable state — deployment is manual approval
- Continuous Deployment: Every passing change is automatically deployed to production
- 1. Source: Code push triggers pipeline (Git push, PR merge)
- 2. Build: Compile code, resolve dependencies, create artifacts
- 3. Unit Tests: Run automated unit tests (fast, isolated)
- 4. Integration Tests: Test component interactions, API contracts
- 5. Static Analysis: Code quality, security scanning (SonarQube, Snyk)
- 6. Staging Deploy: Deploy to staging environment for acceptance testing
- 7. E2E Tests: End-to-end tests simulating user behavior
- 8. Production Deploy: Blue-green, canary, or rolling deployment
💡 Viva Tip
Mention deployment strategies: Blue-Green (two identical environments, switch traffic), Canary (gradual rollout to % of users), Rolling (replace instances one by one). Know at least one CI/CD tool well.
11
What is Docker? How does containerization work?
DevOps▼Docker packages applications and their dependencies into lightweight, portable containers that run consistently across environments.
Container vs VM:
Container vs VM:
- Container: Shares host OS kernel, lightweight (MBs), starts in seconds, less isolation
- VM: Full guest OS, heavier (GBs), starts in minutes, stronger isolation
- Dockerfile: Instructions to build an image (FROM, COPY, RUN, EXPOSE, CMD)
- Image: Read-only template — like a class definition
- Container: Running instance of an image — like an object
- Registry: Image storage (Docker Hub, AWS ECR, GitHub Container Registry)
- Docker Compose: Define multi-container apps (web + database + cache) in one YAML file
💡 Viva Tip
Know Docker commands: docker build, docker run, docker ps, docker-compose up. Mention Kubernetes for container orchestration — managing hundreds of containers across clusters.
12
What is Git branching strategy? Explain Git Flow.
DevOps▼Git Flow Branches:
- main/master: Production-ready code. All releases are tagged here
- develop: Integration branch — contains latest development changes
- feature/*: New features branched from develop, merged back via PR
- release/*: Preparation for production release — final testing, version bumps
- hotfix/*: Emergency fixes branched from main, merged to both main and develop
- GitHub Flow: main + feature branches only. PR → review → merge → deploy. Best for continuous deployment
- Trunk-Based Development: Everyone commits to main, short-lived feature branches (<1 day). Uses feature flags for incomplete features
- Meaningful branch names:
feature/user-authentication - Small, focused PRs (under 400 lines)
- Code reviews before merge
- Squash commits for clean history
💡 Viva Tip
Know the trade-offs: Git Flow suits release-based software; GitHub Flow suits web apps with continuous deployment. Most startups prefer GitHub Flow or trunk-based development.
13
Tell me about a challenging bug you fixed.
Behavioral▼Use the STAR Framework:
"In our e-commerce platform, users were intermittently getting wrong order totals. I added logging to the checkout service, discovered a race condition in the cart calculation when multiple browser tabs were open. Fixed by implementing optimistic locking on the cart object. Zero pricing errors since deployment."
- Situation: Describe the context — what system, what was happening, who was affected
- Task: What was your responsibility? What needed to be fixed?
- Action: What specific steps did YOU take? (This is the most important part)
- How did you reproduce the bug?
- What debugging tools/techniques did you use?
- What was the root cause?
- What was the fix?
- Result: What was the outcome? Quantify if possible (reduced errors by X%, saved Y hours)
"In our e-commerce platform, users were intermittently getting wrong order totals. I added logging to the checkout service, discovered a race condition in the cart calculation when multiple browser tabs were open. Fixed by implementing optimistic locking on the cart object. Zero pricing errors since deployment."
💡 Viva Tip
Prepare 3-4 STAR stories before the interview — one bug fix, one feature delivery, one conflict resolution, one learning experience. Practice telling each in under 2 minutes.
14
How do you handle disagreements with team members about technical decisions?
Behavioral▼Framework for Answering:
- 1. Listen first: "I always start by understanding the other person's perspective completely. Often, disagreements arise from different assumptions or priorities"
- 2. Data-driven discussion: "I suggest we evaluate options against objective criteria — performance benchmarks, maintenance cost, team expertise, project timeline"
- 3. Prototype/POC: "If both approaches have merit, I suggest building a small proof-of-concept for each to compare"
- 4. Escalate constructively: "If we still disagree, I involve the tech lead or architect for a tiebreaker — not because I can't decide, but because fresh eyes help"
- 5. Disagree and commit: "Once a decision is made, I fully commit to it even if it wasn't my preference. I've learned that consistent execution of a 'good enough' decision beats inconsistent execution of a 'perfect' one"
💡 Viva Tip
Always give a specific example: "We disagreed on React vs Vue for the frontend. I created a comparison matrix covering learning curve, ecosystem, team experience, and performance. We chose React because 3 of 4 team members had experience."
15
Where do you see yourself in 5 years as a software engineer?
Behavioral▼Two Valid Paths (choose based on your preference):
Path 1 — Technical Leadership (IC Track):
Path 1 — Technical Leadership (IC Track):
- "In 5 years, I want to be a Senior/Staff Engineer who designs systems end-to-end"
- "I want to mentor junior developers and establish engineering best practices"
- "Deep expertise in [specific domain] — distributed systems, ML infrastructure, or platform engineering"
- "Contributing to open source and sharing knowledge through tech talks"
- "I want to transition to engineering management — building and leading high-performing teams"
- "I believe strong technical foundation is essential for engineering managers"
- "I want to influence product decisions by bridging technical and business perspectives"
- Alignment with the company's growth
- Continuous learning — new technologies, system design
- Impact — shipping products that users love
💡 Viva Tip
Show ambition but be realistic. Don't say "I want to be CTO in 5 years" at a junior role. Good answer: "I want to be the engineer my team trusts with the most complex technical challenges."