I got this opportunity through LinkedIn.
The round covered a mix of puzzles, database concepts, and data structures & algorithms.
Puzzle Question
The interviewer started with a classic puzzle:
Two trains A and B are moving towards each other at 50 km/h each, with an initial distance of D km. A bee starts from Train A towards B at 70 km/h and keeps flying back and forth until the trains meet. Find the total distance traveled by the bee. The interviewer was checking for observation and simplification rather than brute force.
DB / SQL Concepts
Next, I was asked theoretical + practical database questions:
What is Normalization? I explained normalization as the process of organizing data to reduce redundancy and improve data integrity, using normal forms (1NF, 2NF, 3NF).
JOIN Question Given:
Students table (3 records) Marks table (10 records)
I was asked to explain LEFT JOIN and RIGHT JOIN.
LEFT JOIN (Students LEFT JOIN Marks) Returns all students and matching marks → unmatched rows in Marks are ignored Result: 8 records (only matching entries + possible NULLs) RIGHT JOIN (Students RIGHT JOIN Marks) Returns all marks and matching students → unmatched students replaced with NULL Result: 10 records (all rows from Marks)
I explained that the difference comes from which table is preserved in the join.
DSA Questions
Two Sum Problem I explained the optimal approach using a hash map to store visited elements and check complements in O(n) time.
Detect Loop in Linked List I used Floyd’s Cycle Detection Algo (Tortoise and Hare- slow and fast pointer), which detects a loop in O(n) time and O(1) space.
In the second round, the focus shifted towards system design and building scalable applications.
The interviewer first asked how to design a scalable chatbot system.
I explained that the system should be stateless, meaning:
Each request should be independent No user session or chat history should be stored in server memory
Instead, I suggested storing session data externally using:
Redis / Memcached (for fast access) Databases like MongoDB or DynamoDB
This allows multiple servers to handle requests interchangeably without dependency on a specific instance.
Next, I discussed scaling strategies:
Place a load balancer (like NGINX, AWS ALB, or Envoy) in front of servers Deploy multiple instances of the application Use auto-scaling based on CPU usage or latency
For Kubernetes-based systems:
Use Horizontal Pod Autoscaler (HPA) to dynamically scale pods under high traffic
To improve reliability:
The discussion was more practical and focused on how systems behave under high traffic and how to handle scaling efficiently.