Swiggy Interview Questions
Real-time order management and logistics demand strong system design skills. Backend interviews focus on Java, distributed systems, and MySQL.
#1Explain the SOLID principles.
#2How does HashMap work internally?
#3What is the difference between HashMap and ConcurrentHashMap?
#4Explain Java Memory Model: Heap, Stack, and Metaspace.
#5What is the volatile keyword in Java?
#6What is the difference between synchronized and ReentrantLock?
#7What is a deadlock and how do you prevent it?
#8Explain the Stream API and intermediate vs terminal operations.
#9What is garbage collection? How does G1 differ from ZGC?
#10What is the Java ClassLoader hierarchy?
#11What are Java records (Java 16+)?
#12What is the Executor framework and when would you use it over raw Threads?
#13What is the difference between composition and inheritance?
#14What is a marker interface? Give examples.
#15What are the design patterns most commonly asked in Java interviews?
#16How do you implement a Singleton in Java correctly?
#17What is the contract between equals() and hashCode()?
#18What is the difference between fail-fast and fail-safe iterators?
#19What is CopyOnWriteArrayList and when should you use it?
#20How does PriorityQueue work and when would you use it?
#21What is the happens-before relationship in Java Memory Model?
#22What is the difference between sleep(), wait(), and yield()?
#23What are atomic classes (AtomicInteger, AtomicReference)? How do they work?
#24What is a CountDownLatch vs CyclicBarrier?
#25What is a ThreadLocal and what are its dangers?
#26What is a CompletableFuture and how does it improve async programming?
#27What are virtual threads (Project Loom, Java 21)?
#28How does the JIT (Just-In-Time) compiler work?
#29What is the difference between minor GC, major GC, and full GC?
#30What tools do you use to diagnose JVM memory issues?
#31What is the String pool and how does string interning work?
#32What is type erasure in Java generics?
#33What is the difference between <? extends T> and <? super T>?
#34What are sealed classes (Java 17)?
#35What is pattern matching for instanceof (Java 16)?
#36What is the difference between map() and flatMap() in streams?
#37What is the difference between Comparable and Comparator?
#38What is Stream.collect() and what are common Collectors?
#39What is try-with-resources and how does it work?
#40What is exception chaining and why is it important?
#41What is the difference between Java IO and NIO?
#42What is Java Serialization and what are its pitfalls?
#43What is reflection in Java and when is it used?
#44What is the difference between deep copy and shallow copy?
#45What is autoboxing and unboxing? What are the performance implications?
#46What are enums in Java and what advanced features do they support?
#47What is the difference between static and instance initializer blocks?
#48What are Java modules (Java 9 — JPMS)?
#49What is the difference between an inner class, static nested class, and anonymous class?
#50What are the new switch expressions (Java 14)?
#51What is the difference between Runnable, Callable, and Future?
#52How do you handle NullPointerException in Java?
#53What is the difference between Deque and Queue?
#54What is a WeakHashMap and when would you use it?
#55What is the difference between checked and unchecked exceptions — best practices for APIs?
#56What is the difference between interface default methods and abstract class methods?
#57What are the best practices for writing clean Java code?
#58What is a race condition and how do you prevent it?
#59What is the difference between HashMap.computeIfAbsent() and getOrDefault()?
#60What is the purpose of the transient keyword?
#61What is method hiding in Java?
#62What are the Java 8 Date/Time APIs and why were they introduced?
#63What is the difference between HashMap.put() and HashMap.putIfAbsent()?
#64What is an immutable class and how do you create one?
#65What is the covariant return type in Java?
#66What is the difference between Predicate.and(), Predicate.or(), and Predicate.negate()?
#67What is the Observer pattern and how is it implemented in Java?
#68What is the Strategy pattern in Java?
#69What is String.intern() and when should you use it?
#70What are the key differences between Java 8, 11, 17, and 21?
#71Explain the CAP theorem.
#72What is consistent hashing and why is it used?
#73What is database sharding and how does it work?
#74Explain cache invalidation strategies.
#75How would you design a URL shortener (like bit.ly)?
#76What is the Saga pattern in microservices?
#77What is CQRS and when should you use it?
#78What are rate limiting algorithms?
#79What is the Circuit Breaker pattern?
#80How do you design for high availability?
#81What is eventual consistency?
#82What is a message queue and when should you use one?
#83What is the difference between SQL and NoSQL databases?
#84How do you handle distributed transactions without 2PC?
#85How would you design a notification system (push, email, SMS)?
#86What is the difference between REST and gRPC?
#87What is the Outbox Pattern?
#88How do you design a distributed cache layer?
#89What is the difference between synchronous and asynchronous communication in microservices?
#90How do you design a notification system that sends 100M notifications per day?
#91What are the different types of database indexes and when do you use each?
#92How would you design a URL shortener like bit.ly?
#93What is eventual consistency and how do you handle it in practice?
#94How do you design a search system at scale?
#95What is the difference between optimistic and pessimistic locking?
#96How would you design a real-time leaderboard?
#97What is a write-ahead log (WAL) and how is it used?
#98How do you handle distributed transactions across microservices?
#99How do you design a chat application like WhatsApp?
#100What is a service mesh and when should you use one?
#101How would you design a video streaming platform like YouTube?
#102What is the difference between a load balancer and an API gateway?
#103How do you prevent and handle cascading failures in distributed systems?
#104What is the difference between a message queue and a message broker?
#105How do you design a rate limiter for an API?
#106What is the difference between replication and partitioning in databases?
#107How would you design Twitter's news feed?
#108What is observability and what are its three pillars?
#109How do you implement idempotency in APIs?
#110How would you design a distributed job scheduler?
#111What is the Saga pattern vs 2PC for distributed transactions?
#112How do you design a file storage system like Dropbox?
#113What are the trade-offs of microservices vs monolithic architecture?
#114How does DNS work and how is it used in load balancing?
#115What is the strangler fig pattern?
#116How do you design an e-commerce inventory system that handles flash sales?
#117What is the difference between push and pull architectures for data?
#118How do you design a fraud detection system?
#119What is event sourcing and how does it differ from CRUD?
#120How would you design a geospatial service like Uber's nearby driver system?
#121What is API versioning and what are the different strategies?
#122What is a Bloom filter and where is it used in system design?
#123How do you implement zero-downtime deployments?
#124What is the two-generals problem and what does it tell us about distributed systems?
#125How do you design a payment processing system?
#126How would you design an autocomplete system?
#127What is backpressure and how do you handle it?
#128What is a time-series database and when should you use one?
#129What is a circuit breaker and how do you implement it?
#130How do you handle database migrations safely in production?
#131What is the CQRS pattern?
#132How do you secure an API at the architecture level?
#133What is the difference between synchronous replication and asynchronous replication?
#134How do you design a system for billions of events per day (analytics pipeline)?
#135What is chaos engineering and how do you implement it?
#136What is the database connection pool and how do you tune it?
#137How do you design an access control system?
#138How would you design an online code execution system like LeetCode?
#139How does the request flow work in a typical microservices architecture?
#140What is a hot partition problem and how do you solve it?
#141How do you design a multi-tenant SaaS architecture?
#142What is tail latency and why does it matter?
#143How do you design a global, low-latency key-value store?
#144What is the N+1 query problem and how do you fix it?
#145How would you design a booking system like Airbnb?
#146How do you design a recommendation system?
#147What is the read-your-own-writes consistency guarantee?
#148How do you design a search-as-you-type / typeahead feature?
#149What is the difference between gRPC unary, server streaming, client streaming, and bidirectional streaming?
#150How do you handle large file uploads efficiently?
#151What are the key considerations when designing for high write throughput?
#152What is the difference between monolithic and microservices deployment strategies?
#153How do you design for disaster recovery?
#154What is the thundering herd problem?
#155What is a vector clock and how does it work?
#156What is the difference between a monorepo and polyrepo?
#157How do you ensure data consistency across microservices?
#158What is the difference between a batch job and a stream processing job?
#159How do you design an API for mobile clients vs web clients?
#160What is the role of a message broker in event-driven architecture?
#161How do you approach capacity planning for a new system?
#162How does indexing work in MySQL (InnoDB)?
#163What is a covering index?
#164What are MySQL transaction isolation levels?
#165What is MVCC (Multi-Version Concurrency Control) in InnoDB?
#166How do you use EXPLAIN to analyze a query?
#167What are window functions in SQL?
#168What are CTEs (Common Table Expressions) and when should you use them?
#169What is the N+1 query problem and how do you fix it?
#170What is a deadlock in MySQL and how does it occur?
#171How do you optimize a slow MySQL query?
#172What is database normalization?
#173What is MySQL replication and how does it work?
#174What is partitioning in MySQL?
#175What is a stored procedure and when should you use it?
#176How does the InnoDB storage engine handle locking?
#177How do you design a schema for a multi-tenant SaaS application?
#178What is the difference between a clustered and a non-clustered index?
#179What are covering indexes and how do they improve performance?
#180What is the EXPLAIN output and how do you read it?
#181What are database triggers and when should you avoid them?
#182What is a foreign key constraint and what are its performance implications?
#183How do you implement full-text search in MySQL?
#184How does MySQL replication work and what are its modes?
#185What is a deadlock in MySQL and how does InnoDB handle it?
#186What are MySQL stored procedures and when should you use them?
#187How do you perform a slow query analysis in MySQL?
#188What is InnoDB buffer pool and how do you size it?
#189What is MySQL's query cache and why was it removed?
#190How do you back up a MySQL database without downtime?
#191What is the difference between optimistic and pessimistic locking in MySQL?
#192What are MySQL partitioning types and when do you use them?
#193How do you handle large data migrations in production?
#194What is the difference between IN, EXISTS, and JOIN for subqueries?
#195What is the InnoDB redo log and undo log?
#196How do you implement pagination in MySQL efficiently?
#197What is group replication and InnoDB Cluster?
#198What is the difference between a view and a materialized view?
#199How does MySQL's optimizer choose an execution plan?
#200What are common MySQL performance anti-patterns?
#201What is a generated column in MySQL?
#202What are the best practices for MySQL schema design?
#203How do you use MySQL's JSON column type?
#204What is the difference between transaction isolation levels in MySQL?
#205How do you handle hierarchical data in MySQL?
#206What is ProxySQL and how is it used?
#207What is MVCC and how does InnoDB implement it?
#208How do you detect and fix index fragmentation in MySQL?
#209What are the MySQL 8.0 improvements over MySQL 5.7?
#210How do you design a schema for audit logging?
#211What is binlog and how is it used for CDC?
#212How do you use MySQL's performance_schema?
#213What is a composite index and how should you order columns?
#214How do you implement soft delete in MySQL?
#215How does MySQL handle concurrent writes to the same row?
#216What is the difference between schema-on-write and schema-on-read?
#217How do you handle time zones in MySQL?
#218How do you monitor MySQL in production?
#219What are window functions and how do you use them?
#220How do you implement row-level security in MySQL?
#221How do you use MySQL's event scheduler?
#222What is the EXPLAIN ANALYZE command?
#223How do you handle database connection failures in application code?
#224What is the MySQL query execution order?
#225How do you scale MySQL reads?
#226What is the difference between row-based and statement-based replication?
#227How do you use CTEs (Common Table Expressions) effectively?
#228How do you implement optimistic locking with versioning in MySQL?
#229What is the purpose of the information_schema?
#230What is innodb_flush_log_at_trx_commit and how does it affect durability?
#231How do you implement full-table search across millions of rows efficiently?
#232What is the max_connections parameter and how do you tune it?
#233What is a spatial index in MySQL and how is it used?
#234What is the difference between ROLLUP and CUBE in SQL?
#235How do you handle NULL values in MySQL queries?
#236What is the difference between a read and a write transaction?
#237How do you implement a queue in MySQL?
#238What is the mysql.user table and how does MySQL authentication work?
#239What is index merge optimization?
#240How do you detect and resolve replication lag?
#241What is the difference between MyISAM and InnoDB row format?
#242How do you implement rate limiting at the database level?
#243What is the difference between REPEATABLE READ and READ COMMITTED in practice?
#244What are MySQL's data types for storing money?
#245How do you handle schema evolution in a microservices environment?
#246What is an API Gateway and what does it do?
#247How do microservices communicate?
#248What is service discovery in microservices?
#249What is the Circuit Breaker pattern and how does it prevent cascading failures?
#250What is distributed tracing and why is it important?
#251What is the Strangler Fig pattern for microservices migration?
#252What is a sidecar pattern?
#253How do you manage configuration in microservices?
#254What are the 12-Factor App principles?
#255What is event-driven architecture and when should you use it?
#256What is the difference between orchestration and choreography in Saga?
#257How do you test microservices effectively?
#258What is a service mesh and when should you use one?
#259How do you ensure data consistency across microservices?
#260What is the circuit breaker pattern?
#261What is service discovery and how does it work?
#262What is the Bulkhead pattern?
#263What is the Retry pattern and how do you implement it safely?
#264What is the difference between choreography and orchestration in Sagas?
#265What is the Backend for Frontend (BFF) pattern?
#266How do you implement distributed tracing?
#267What is the Strangler Fig pattern for migrating a monolith?
#268What is eventual consistency and how do you design for it?
#269How do you version microservice APIs?
#270What is the Sidecar pattern?
#271What is a dead letter queue and why is it important?
#272How do you implement health checks in microservices?
#273What is the Outbox pattern and how does it guarantee event delivery?
#274What is idempotency and how do you implement it in microservices?
#275What are the 12-Factor App principles?
#276How do you handle secrets management in microservices?
#277What is the Ambassador pattern in microservices?
#278How do you implement inter-service authentication?
#279What is the Throttling pattern and how does it differ from rate limiting?
#280What is CQRS and how does it apply to microservices?
#281How do you test microservices?
#282What is service isolation and why is it important?
#283What is an Event-Driven Architecture?
#284How do you handle database per service in practice?
#285What is the Role of API composition in microservices?
#286What is graceful degradation in microservices?
#287What is the Event Sourcing pattern?
#288How do you implement logging in a microservices environment?
#289What is the two-phase commit vs Saga for distributed transactions?
#290How do you handle timeouts in microservices?
#291What is the Scatter-Gather pattern?
#292What is the difference between a microservice and a nanoservice?
#293How do you implement canary deployments in microservices?
#294What is a Service Registry?
#295What is blue-green deployment and how does it work?
#296What is the Aggregator pattern?
#297How do microservices handle configuration management?
#298What is the Proxy pattern in microservices?
#299How do you implement distributed locking in microservices?
#300What is Kafka and why is it popular in microservices?
#301How do you manage service dependencies in microservices?
#302What is a bounded context?
#303How do you implement a request-reply pattern over async messaging?
#304What is the Token Bucket algorithm and how is it used for rate limiting?
#305How do you handle schema evolution in event-driven systems?
#306What is the difference between a monolith, microservices, and modular monolith?
#307What is the Choreography pattern in detail?
#308What is a composite microservice?
#309How do you deal with "chatty" microservices?
#310What is a process manager / workflow engine in microservices?
#311How do you implement zero-downtime deployments for microservices?
#312What is the Anti-Corruption Layer pattern?
#313What are the common pitfalls of microservices adoption?
#314What is the difference between orchestration and choreography?
#315How do you implement a consistent read across microservices?
#316What is load shedding?
#317What is the difference between gRPC and REST for inter-service communication?
#318What is the Gateway Aggregation pattern vs Gateway Routing?
#319What is the Inbox pattern?
#320How do you handle versioning of events in Kafka?
#321What is the Open Host Service pattern?
#322How do you implement service-level SLOs in microservices?
#323What is the Claim Check pattern?
#324What is service mesh traffic management?
#325What is the difference between horizontal and vertical scaling for microservices?
#326What is the role of a message schema registry?
#327How do you handle service discovery with Kubernetes?
#328How do you implement an API gateway from scratch?
#329What is consumer-driven contract testing (Pact)?
#330How do you use feature toggles in microservices?
#331What is polyglot persistence in microservices?
#332What are distributed caching strategies for microservices?
#333How do you design a CI/CD pipeline for microservices?
#334How do you implement observability with Micrometer, Prometheus, and Grafana?
#335What is the Retry pattern and when should you NOT retry?
#336How do you implement Saga compensation (rollback) in detail?
#337What is multi-tenancy in microservices and how do you implement it?
#338What are the steps to migrate a monolith to microservices using the Strangler Fig pattern?
#339How do you design microservices for failure?
#340What is data mesh and how does it relate to microservices data ownership?
#341What is a sidecar proxy and how does Envoy work?
#342How do you handle inter-service authorization (not just authentication)?
#343When should you NOT use microservices?