# Kafka 

### 1\. Partitioning & Ordering

*   Why same key → same partition?
    
*   What if ordering is broken?
    
*   Repartitioning impact?
    

### 2\. Consumer Groups & Rebalancing

*   What happens when a consumer dies?
    
*   Rebalance impact on latency?
    
*   Sticky vs cooperative rebalancing?
    

### 3\. Offset Management

*   Auto vs manual commit?
    
*   Duplicate processing scenarios?
    
*   Exactly-once vs at-least-once?
    

### 4\. Throughput Optimization

*   Producer batching, linger.ms
    
*   Compression tradeoffs
    
*   When Kafka becomes bottleneck
    

### 5\. Failure Handling

*   Broker crash
    
*   Leader election
    
*   ISR shrink
    

### 6\. Data Loss & Durability

*   acks=0/1/all differences
    
*   min.insync.replicas
    
*   What causes data loss?
    

### 7\. Lag & Backpressure

*   Consumer lag increasing?
    
*   Slow consumers?
    
*   How to scale?
    

### 8\. Schema Evolution

*   Backward vs forward compatibility
    
*   Breaking changes handling
    

### 9\. Exactly Once Semantics

*   Idempotent producer
    
*   Transactions
    
*   Real limitations
    

### 10\. Real System Design

*   Kafka in microservices
    
*   Event-driven architecture
    
*   Retry + DLQ patterns
