SE Notes
Comprehensive collection of general software engineering interview questions covering core concepts.
This comprehensive guide covers the most frequently asked software engineering interview questions, organized by topic and difficulty level. Each answer provides the depth interviewers expect while demonstrating both theoretical knowledge and practical understanding.
Fundamental Concepts
Q: What is software engineering and how does it differ from programming?
A: Software engineering is the systematic, disciplined, and quantifiable approach to developing, operating, and maintaining software. Programming is writing code to solve specific problems. The key differences are scope (programming focuses on code, SE covers the entire lifecycle), scale (programming handles individual modules, SE manages complex systems), process (programming can be ad-hoc, SE requires methodology), team coordination (programming can be solo, SE involves large teams), and longevity (programs may be disposable, engineered software must be maintainable for years or decades).
Q: What is the software crisis and is it still relevant?
A: The software crisis refers to the chronic inability of the software industry to deliver projects on time, within budget, and meeting quality expectations. Identified in the 1960s, its symptoms included massive cost overruns, late delivery, unreliable software, and unmaintainable code. While modern practices (Agile, DevOps, automated testing) have improved success rates significantly, studies like the Standish Group CHAOS Report still show that roughly 30% of projects fail and another 50% are "challenged." The crisis has evolved rather than been fully resolved — today's challenges involve complexity management, security, and scaling rather than basic delivery.
Q: What are software characteristics?
A: Software has unique characteristics distinguishing it from other engineering products: it does not wear out (no physical degradation, but it degrades through accumulated changes); it is not manufactured in the traditional sense (development is the creative process, reproduction is trivial copying); it is inherently complex (no two meaningful components are identical); it is malleable (easy to change, which is both advantage and curse); it is invisible (no physical form to inspect); and it is conformist (must conform to interfaces of hardware, organizations, and other systems it connects to).
Design and Architecture Questions
Q: Explain the SOLID principles with examples.
A: SOLID principles guide object-oriented design: Single Responsibility — a class should have one reason to change (a User class handles user data, not email sending). Open/Closed — classes should be extendable without modifying existing code (use strategy pattern for new payment methods instead of modifying a PaymentProcessor class). Liskov Substitution — subtypes must be usable wherever their parent type is expected (a Square should behave correctly wherever a Rectangle is used). Interface Segregation — prefer specific interfaces to general ones (separate Printable, Scannable, Faxable instead of one MultifunctionDevice interface). Dependency Inversion — high-level modules should depend on abstractions (a NotificationService depends on a MessageSender interface, not directly on EmailClient or SMSClient).
Q: What is the difference between cohesion and coupling?
A: Cohesion measures how strongly related elements within a module are — high cohesion means a module does one thing well (a DateFormatter class only handles date formatting). Coupling measures how dependent modules are on each other — low coupling means modules interact through minimal, well-defined interfaces. Good design maximizes cohesion and minimizes coupling. High cohesion makes modules easier to understand and test. Low coupling makes modules easier to modify without rippling changes through the system. They are complementary — improving one typically improves the other.
Q: Describe three architectural styles and when to use each.
A: Layered Architecture separates concerns into horizontal layers (presentation, business logic, data access). Each layer communicates only with adjacent layers. Best for enterprise applications with clear separation between UI, business rules, and data storage. Microservices Architecture decomposes the system into small, independently deployable services communicating via APIs. Best for large systems requiring independent scaling, team autonomy, and frequent deployment of individual components. Event-Driven Architecture uses asynchronous event communication between loosely coupled components. Best for real-time systems, IoT platforms, and scenarios requiring high scalability and loose coupling between producers and consumers of information.
Testing Questions
Q: What is the testing pyramid and why does it matter?
A: The testing pyramid suggests maintaining many unit tests (fast, focused, cheap), fewer integration tests (medium speed, test component interactions), and minimal end-to-end tests (slow, brittle, expensive). The pyramid matters because: unit tests provide fastest feedback and are cheapest to maintain; integration tests catch interface mismatches between components; E2E tests verify complete user workflows but break easily with UI changes. Inverting the pyramid (many E2E, few unit tests) creates slow feedback, brittle test suites, and expensive maintenance — the "ice cream cone anti-pattern."
Q: Explain the difference between black-box and white-box testing.
A: Black-box testing examines functionality without knowledge of internal code structure. Testers focus on inputs and expected outputs based on specifications. Techniques include equivalence partitioning (dividing inputs into groups that should behave similarly) and boundary value analysis (testing at edges of input ranges). White-box testing examines internal logic and code paths. Testers design tests to exercise specific branches, conditions, and paths. Techniques include statement coverage, branch coverage, and path coverage. Black-box tests validate what the software does; white-box tests validate how it does it.
Process and Methodology Questions
Q: How do you estimate software project effort?
A: Multiple techniques exist: Expert Judgment — experienced practitioners estimate based on similar past projects. Function Point Analysis — count system inputs, outputs, inquiries, files, and interfaces, then adjust for complexity. COCOMO — mathematical model relating effort to code size (KLOC) with complexity multipliers. Planning Poker — team consensus estimation using relative sizing. Three-Point Estimation — average of optimistic, most likely, and pessimistic estimates (O + 4M + P) / 6. Best practice combines multiple techniques and uses historical data from completed projects for calibration.
Q: What is risk management in software projects?
A: Risk management systematically identifies, analyzes, and mitigates potential problems before they become crises. The process includes: risk identification (brainstorming potential threats — technical complexity, resource availability, requirement changes), risk analysis (assessing probability and impact of each risk), risk prioritization (focusing on high-probability, high-impact risks), risk mitigation (developing strategies — avoidance, reduction, transfer, or acceptance), and risk monitoring (tracking identified risks and watching for new ones throughout the project). Common software risks include unclear requirements, technology immaturity, key personnel leaving, and scope creep.
Practical Scenario Questions
Q: You inherit a legacy system with no documentation and no tests. How do you approach it?
A: First, understand the system through exploration: run it, use it as a user would, read the code, map dependencies, and talk to anyone with institutional knowledge. Second, stabilize: add monitoring and logging to understand runtime behavior, write characterization tests (tests that document current behavior, right or wrong), and establish a CI pipeline. Third, improve incrementally: refactor small sections at a time with characterization tests as safety nets, add documentation as you learn, and replace problematic components gradually. Never attempt a complete rewrite without extremely compelling justification — rewrites almost always take longer than expected and lose embedded business logic.
Q: How do you handle technical debt in a project?
A: Track technical debt explicitly (maintain a tech debt backlog with business impact assessment). Make it visible to stakeholders by relating it to business consequences ("this shortcut means new features take 3x longer to implement in the payments module"). Allocate consistent capacity for reduction — typically 15-20% of sprint capacity. Prioritize by impact: debt that slows daily development or increases defect risk gets addressed first. Prevent accumulation through code reviews, testing standards, and architectural decision records. Never let "we'll fix it later" become "we never fixed it."
Exam Focus
Revise definitions, diagrams, examples, and short-answer points for Software Engineering Interview Questions.
Interview Use
Prepare one clear explanation, one practical example, and one common mistake for this Software Engineering topic.
Search Terms
software-engineering, software engineering, software, engineering, interview, preparation, questions, software engineering interview questions
Related Software Engineering Topics