Panda Guru LogoPanda
Guru

PhonePe Machine Coding Round..What's the best way to implement it on production systems?

Coding Round

Questions: You need to design a system that is able to track pending entities. An entity is identified using a unique ID and a list of hierarchical tags. There are 3 parts to this problem statement: startTracking, endTracking, and getCounts.

Sample Usage:

startTracking(1112, ["UPI", "Karnataka", "Bangalore"]); startTracking(2451, ["UPI", "Karnataka", "Mysore"]); startTracking(3421, ["UPI", "Rajasthan", "Jaipur"]); startTracking(1221, ["Wallet", "Karnataka", "Bangalore"]); getCounts(["UPI"]); // Output: 3 getCounts(["UPI", "Karnataka"]); // Output: 2 getCounts(["UPI", "Karnataka", "Bangalore"]); // Output: 1 getCounts(["Bangalore"]); // Output: 0 startTracking(4221, ["Wallet", "Karnataka", "Bangalore"]); stopTracking(1112); stopTracking(2451); getCounts(["UPI"]); // Output: 1 getCounts(["Wallet"]); // Output: 2 getCounts(["UPI", "Karnataka", "Bangalore"]); // Output: 0

Requirements:

Candidate's Approach

No approach provided.

Interviewer's Feedback

Interviewers are not impressed by the solution provided.