Skip to content
Interview prep

Software Engineer interview questions & answers — India 2026

The most commonly asked software engineer interview questions in India, with detailed model answers. Covers technical, behavioural, and situational questions asked by Indian recruiters.

TechnicalBehaviouralSituational— question type tags throughout this page
01

Explain the difference between a process and a thread.

Technical

Model answer

A process is an independent program with its own memory space. A thread is a lightweight unit of execution within a process that shares the process's memory. Multiple threads within a process can run concurrently and share data, but context switching between threads is faster than between processes. In Java, threads are managed via the Thread class or Runnable interface; in Python, the GIL limits true CPU parallelism for threads.

02

What is the time complexity of binary search, and when should you use it?

Technical

Model answer

Binary search is O(log n) time and O(1) space. Use it on sorted arrays or sorted data structures when you need to find an element quickly. It halves the search space on each comparison. Prefer linear search for unsorted or very small arrays where sorting overhead isn't worth it.

03

How does a HashMap work internally in Java?

Technical

Model answer

A HashMap uses an array of buckets. When you call put(key, value), it computes the hash of the key, maps it to a bucket index (hash % array_size), and stores the entry. Hash collisions are handled via chaining (linked list in Java 7, balanced tree in Java 8+ when chain length > 8). Retrieval is O(1) average, O(n) worst case with poor hash distribution. Load factor (default 0.75) triggers resizing.

04

What is the CAP theorem?

Technical

Model answer

CAP states that a distributed system can only guarantee two of three properties simultaneously: Consistency (all nodes see the same data), Availability (every request gets a response), and Partition Tolerance (system works despite network partitions). Since partitions are unavoidable in practice, you choose between CP (consistent but may be unavailable under partition — e.g., HBase, ZooKeeper) and AP (available but eventually consistent — e.g., Cassandra, DynamoDB).

05

Walk me through how you would design a URL shortener like bit.ly.

Technical

Model answer

Key components: (1) Hash function to generate a 6-8 character short code from the long URL — use base62 encoding of a counter or MD5 truncated; (2) Database to store short→long mapping — Redis for cache, PostgreSQL for persistence; (3) 301 vs 302 redirect — 301 is permanent (browser caches, reduces server load), 302 is temporary (better for analytics); (4) Scale with CDN, read replicas, and horizontal scaling of the redirect service. Address collisions with retry logic on hash generation.

06

Tell me about a time you had a major production incident. What did you do?

Behavioural

Model answer

Structure your answer using STAR: Situation (describe the incident and its impact), Task (your role — were you on-call, lead, contributor?), Action (how you diagnosed — logs, metrics, distributed tracing; what you did to mitigate — rollback, feature flag, hotfix), Result (how quickly you restored service, and what post-mortem actions prevented recurrence). Recruiters want to see calmness under pressure, clear communication, and a bias toward mitigation first, root cause second.

07

What is the difference between SQL and NoSQL databases? When would you choose each?

Technical

Model answer

SQL databases (PostgreSQL, MySQL) are relational, schema-defined, ACID-compliant, and excel at complex joins and transactions. NoSQL (MongoDB, Cassandra, Redis) are schema-flexible, horizontally scalable, and optimised for specific access patterns. Choose SQL for financial transactions, complex reporting, and structured data with relationships. Choose NoSQL for high-write-throughput, flexible/evolving schemas, time-series data, or when you need horizontal scale beyond what a single SQL instance handles.

08

Your team is debating between two technical approaches. You strongly prefer one. How do you handle it?

Situational

Model answer

Acknowledge both approaches have merits. Present your preference with data: performance benchmarks, maintainability trade-offs, team familiarity, and long-term cost. Use an RFC (Request for Comments) document for significant decisions. If the team disagrees after full discussion, support the majority decision and commit fully — unless the disagreement is about correctness or security, in which case escalate appropriately.

Interview tips for Software Engineer roles in India

  • Prepare to whiteboard: data structures, sorting algorithms, and system design are all fair game
  • For Indian product companies (Razorpay, CRED, Swiggy), expect system design from SDE-2 level
  • For IT services (TCS, Infosys), expect more Java/framework-specific questions
  • Always clarify constraints before coding — interviewers want to see your thought process
  • Practice on LeetCode with Indian company-specific question lists (available on Glassdoor India)

Got the interview? Now get your CV ready.

Use CV Prime to build an ATS-optimised Software Engineer CV tailored to the exact job description — so you pass the automated screen before the interview even happens.

CV Prime is a free CV maker and free AI CV builder for India. No credit card required.

Help us improve CV Prime

We use privacy-conscious product analytics only after consent. No CV text or API keys are tracked.