Skip to content
Tutorials Center
My learning

Topics

Lesson 49 of 50 ยท Practice and Interview

Software Engineering Interview Questions

Prepare for software engineering interviews with short, accurate answers on fundamentals, SDLC, agile, UML, design, testing, estimation and behavioral questions.

Interviewers rarely want a recitation of definitions. They want to see that you understand why practices exist, can name trade-offs, and can connect an idea to a real situation. This lesson collects the questions that come up most often in software engineering interviews and exams, with short answers you can say aloud in under a minute, and a pointer to the full lesson for each topic.

Use the answers as a skeleton, not a script. Add an example from your own experience wherever you can: a bug you found in review, a deadline you renegotiated, a design you changed. Two small JavaScript stand-ins at the end let you try the calculations that interviewers like to ask for, cyclomatic complexity and earned value. They use invented data and simplified rules.

What interviewers look for

Understanding Why a practice exists.
Trade-offs No option is free.
Examples Real situations you handled.
Clarity Short, structured answers.

Say the answer, give a reason, then an example.

1 / 2

Fundamentals

What is the difference between programming and software engineering? Programming is writing code that works. Software engineering is building and maintaining software that stays correct, affordable and changeable over years and across many people. It adds requirements, design, testing, teamwork, estimation and maintenance. See What Is Software Engineering?.

What makes software "good"? It does what users need (correctness), keeps doing it (reliability), can be changed safely (maintainability), and meets goals for speed, security and usability. These qualities conflict, for example strong security can reduce usability, so the engineer's job is to choose the right balance for the context. See Qualities of Good Software.

Why do software projects fail? Common causes are unclear or changing requirements, unrealistic estimates, poor communication, ignoring risks, late testing and scope creep. Most are management and communication problems rather than coding problems.

What is the difference between verification and validation? Verification asks "are we building the product right?" (does it match the specification, checked by reviews and tests). Validation asks "are we building the right product?" (does it meet the user's real need, checked by acceptance and user feedback). See V-Model, Iterative and Incremental Models.

SDLC and process models

Name the phases of the SDLC. Requirements, design, implementation, testing, deployment and maintenance. Each produces an output (a specification, a design, code, test results, a release) that feeds the next. See The Software Development Life Cycle.

When would you use waterfall, and when agile? Waterfall fits stable, well-understood requirements, strong regulation or fixed contracts, where change is expensive and documentation is mandatory. Agile fits uncertain or changing requirements where early feedback is valuable. Many real projects mix them: a regulated product built in short iterations. See The Waterfall Model and Choosing a Process Model.

What is the spiral model? An iterative model in which every loop starts with risk analysis and often builds a prototype before committing more money. It suits large, risky projects. See Spiral Model and Risk-Driven Development.

Requirements

What is the difference between functional and non-functional requirements? Functional requirements say what the system does ("a user can reset a password"). Non-functional requirements say how well it does it or under what constraints ("the reset email arrives within 30 seconds"). Both must be testable. See Functional and Non-Functional Requirements.

What makes a good user story? It follows INVEST: independent, negotiable, valuable, estimable, small and testable. Acceptance criteria, often written as Given/When/Then, define when the story is done. See User Stories, Use Cases and Acceptance Criteria.

How do you handle changing requirements? Welcome them but control them: log each change, assess its impact on cost, schedule and risk, let the owner prioritize, and keep a traceable record. In agile teams this happens through backlog refinement; in plan-driven projects through a change control process.

UML and design

Which UML diagram would you use for X? Class diagram for static structure, sequence diagram for interactions over time, use case diagram for what users want from the system, state diagram for an object's life cycle, activity diagram for workflows and deployment diagram for hardware and runtime nodes. See UML Overview.

What is the difference between aggregation and composition? Both mean "has a". In composition the part cannot exist without the whole and is destroyed with it (a room in a house). In aggregation the part can outlive the whole (a player in a team). See Class Diagrams.

Explain cohesion and coupling. Cohesion is how strongly the parts of one module belong together; you want it high. Coupling is how much one module depends on others; you want it low. High cohesion and low coupling make modules easier to understand, test and change. See Design Principles.

What is technical debt? The future cost created by choosing a quick or messy solution now. Like financial debt, it can be a sensible trade-off if deliberate and repaid, and harmful if ignored, because the interest (slower changes, more bugs) compounds. See Technical Debt and Refactoring.

What is an architecture decision record? A short document capturing one significant decision, its context, the alternatives and the consequences, so later teams know why. See Architecture Decisions and Documentation.

Agile and teamwork

What are the Scrum roles, events and artifacts? Roles: Product Owner, Scrum Master, Developers. Events: Sprint, Sprint Planning, Daily Scrum, Sprint Review, Sprint Retrospective. Artifacts: Product Backlog, Sprint Backlog, Increment. See Scrum in Practice.

What is the difference between Scrum and Kanban? Scrum works in fixed-length sprints with planned commitments and defined roles. Kanban is continuous flow, limits work in progress and changes priorities at any time. See Kanban, Extreme Programming and Lean.

What is velocity and how do you use it? Velocity is the amount of work (usually story points) a team completes per sprint. It helps forecast, but it is a planning tool, not a performance score, and it should never be compared between teams. See Estimation and Planning.

What is a good code review? Small changes, a clear description, checks for correctness, tests, readability and security, kind and specific comments about the code (not the person), and a quick turnaround. See Working in a Team.

Testing and quality

Explain the test pyramid. Many fast unit tests at the base, fewer integration tests in the middle, and a few slow end-to-end tests at the top. This keeps feedback fast and failures easy to locate. See Testing Levels and Strategy.

What is boundary value analysis? Test at and next to the edges of each valid range, such as 17, 18 and 19 for an adult threshold of 18, because off-by-one mistakes cluster there. See Test Design Techniques.

Does 100% code coverage mean no bugs? No. Coverage only shows which lines ran, not whether the assertions were meaningful or whether missing code, bad requirements or unusual inputs were tested. It is useful for finding untested areas, not for proving quality. See TDD and Code Quality Practices.

What is cyclomatic complexity? The number of independent paths through code: one plus the number of decisions. It gives the minimum number of tests needed to cover each path and flags code that is hard to understand.

JS Estimate cyclomatic complexity

Press Run (or Ctrl + Enter) to see the console output here.

No output.

The counter is a crude stand-in: it counts keywords in text, so it would also count the letters "if" inside a longer word, and real tools read the code's structure instead. It still shows the idea: every if, loop and && adds a path.

Management and estimation

How do you estimate a project? Break the work into small pieces, estimate each with a range (optimistic, likely, pessimistic), compare with similar past work, add contingency for risk, and re-estimate as you learn. State the uncertainty rather than one number. See Cost Estimation Models.

What is earned value? A method to compare progress with plan. Planned value (PV) is the work scheduled by now, earned value (EV) is the budgeted value of work actually done, and actual cost (AC) is what you spent. EV - PV is the schedule variance, and EV - AC is the cost variance. Ratios SPI = EV / PV and CPI = EV / AC below 1 mean behind schedule or over budget. See Project Management Basics.

JS Earned value calculator

Press Run (or Ctrl + Enter) to see the console output here.

No output.

With a 100,000 budget, this project has earned only 40,000 of the 50,000 it planned by now (SPI 0.80) and spent 48,000 to earn it (CPI 0.83). If the cost trend continues, the forecast at completion is 100,000 / 0.83, about 120,000. The forecast formula assumes the same inefficiency continues; a good manager also asks why and whether it will.

How do you manage risk? Identify risks, rate each by probability and impact, plan a response (avoid, reduce, transfer or accept), assign an owner, and review the register regularly. See Risk Management.

Behavioral questions

Use the STAR shape (situation, task, action, result) and keep each story under two minutes.

  • Tell me about a time you disagreed with a teammate. Show that you listened, used evidence (a benchmark, a prototype, a customer need), and accepted the outcome.
  • Describe a bug you caused. Own it, explain how you found and fixed it, and name the process change (a test, a check, an alert) that stops it happening again. Blameless candidates sound mature.
  • How do you handle an impossible deadline? Clarify what is truly fixed, present options (cut scope, add time, add risk) with their costs, and let the decision-makers choose with open eyes.
  • How do you handle legacy code? Add tests around the part you must change, make small safe refactorings, and leave the code a little better than you found it.
  • How do you stay current? Name concrete habits: reading specifications and release notes, side projects, code review, talks. Avoid vague claims.

Check your understanding

Quick check ยท 5 questions

of 5 answered You scored / 5 ยท perfect!

  1. 1. What does verification ask, compared with validation?

    Verification checks against the specification; validation checks that the specification itself meets the user's real need.
  2. 2. A function has one loop, one if inside it, and the condition uses one &&. What is its cyclomatic complexity?

    Complexity is one plus the number of decisions: the loop, the if and the && add three, giving four.
  3. 3. A team has SPI 0.8 and CPI 0.83. What does that mean?

    Ratios below 1 mean less work has been earned than planned (behind) and less value per unit spent than budgeted (over budget).
  4. 4. Why is it risky to say 100% coverage means the software is correct?

    A test can execute a line without asserting anything useful, and coverage says nothing about missing code or wrong requirements.
  5. 5. In composition, what happens to the parts when the whole is destroyed?

    Composition is a strong ownership relation: the parts cannot exist without the whole.

Summary

  • Answer with a definition, the reason the practice exists, a trade-off and an example from your own work.
  • Know the pairs interviewers love: verification vs validation, functional vs non-functional, cohesion vs coupling, aggregation vs composition, Scrum vs Kanban.
  • Be ready to calculate: cyclomatic complexity, boundary cases, PERT means, velocity forecasts and earned value ratios.
  • Admit uncertainty in estimates and be honest about trade-offs; that signals experience.
  • Prepare four or five STAR stories that cover conflict, failure, pressure, legacy code and learning.

Next: Software Engineering Cheat Sheet.