InterviewRole

Software Engineer Interview Questions

A path for Python, databases, APIs, debugging, system design, and production engineering interviews.

Questions

How do you write maintainable Python?medium

Answer

Use simple functions, clear names, tests, typing where useful, and small modules.

Explanation

Interviewers look for readability, error handling, separation of concerns, and code that another engineer can change safely.

Follow-upWhen would you add type hints?

What are generators useful for?medium

Answer

They produce values lazily without building a full list.

Explanation

Generators are useful for streams, large files, and pipelines where memory efficiency matters.

Follow-upHow is yield different from return?

How do you handle errors in Python?medium

Answer

Catch specific exceptions and keep recovery close to the failure.

Explanation

Avoid broad except blocks unless re-raising or adding context. Good error handling makes failure modes explicit.

Follow-upWhen should you create a custom exception?

What is normalization?medium

Answer

Normalization organizes tables to reduce redundancy and update anomalies.

Explanation

Explain entities, keys, relationships, and tradeoffs. In analytics, denormalization may be acceptable for performance and usability.

Follow-upWhen would you denormalize?

What is a transaction?medium

Answer

A transaction is a unit of work that should satisfy ACID properties.

Explanation

Good answers cover atomicity, consistency, isolation, durability, plus examples like money transfer or inventory update.

Follow-upWhat problem does isolation solve?

How do indexes speed reads?medium

Answer

Indexes let the database find rows without scanning the whole table.

Explanation

They improve lookup and join performance but add write overhead and storage cost, so they should match query patterns.

Follow-upWhat is a composite index?

What makes an API reliable?medium

Answer

Clear contracts, validation, idempotency, timeouts, and useful errors.

Explanation

A reliable API is predictable for clients and observable for maintainers. Versioning and rate limits also matter.

Follow-upHow would you design retries?

How do REST and GraphQL differ?medium

Answer

REST exposes resources; GraphQL lets clients request shaped data.

Explanation

REST is simple and cache-friendly. GraphQL can reduce overfetching but adds schema and resolver complexity.

Follow-upWhen would you choose REST?

How do you secure an API?medium

Answer

Use authentication, authorization, validation, rate limits, and audit logs.

Explanation

Security also includes least privilege, secrets handling, safe error messages, and monitoring suspicious behavior.

Follow-upWhat is the difference between authn and authz?

How do you scale a read-heavy service?medium

Answer

Use caching, replicas, indexing, pagination, and careful invalidation.

Explanation

Start with requirements, traffic, data model, hot paths, bottlenecks, and failure modes before naming tools.

Follow-upWhat can go wrong with caches?

How do you design for failure?medium

Answer

Remove single points of failure and define graceful degradation.

Explanation

Reliable designs use retries with backoff, circuit breakers, redundancy, backups, and observability.

Follow-upHow do retries cause overload?

How do you estimate capacity?medium

Answer

Estimate users, requests, data volume, read/write ratio, and growth.

Explanation

Capacity estimates guide storage, bandwidth, compute, caching, and partitioning decisions.

Follow-upWhat assumptions would you state first?

How do you debug a production issue?medium

Answer

Clarify impact, inspect recent changes, check metrics, and form hypotheses.

Explanation

Good debugging narrows scope with evidence and keeps stakeholders updated while preserving rollback options.

Follow-upWhat signals do you check first?

How do logs and metrics differ?medium

Answer

Metrics show trends; logs explain specific events.

Explanation

Metrics are better for alerting and dashboards. Logs help inspect individual requests, errors, and context.

Follow-upWhere do traces fit?

How do you prevent repeat incidents?medium

Answer

Write a blameless review and fix root causes, tests, alerts, and runbooks.

Explanation

The goal is learning and system improvement, not blame. Track concrete follow-up work.

Follow-upWhat makes a postmortem useful?
Back to Home