Tip 1: Stay consistent with coding practice and solve problems daily.
Tip 2: Focus on understanding concepts rather than memorizing solutions.
Tip 3: Revise core CS fundamentals like DSA, OOPs, and System Design regularly.
Tip 1: Keep your resume concise and highlight key projects, skills, and achievements.
Tip 2: Use bullet points with action verbs to showcase impact and contributions.
Step 1:
I first thought of using a brute-force approach by iterating over the ppid list to find all processes that need to be killed. However, this would require multiple passes over the list, making it inefficient.
Step 2:
The interviewer asked me to optimize the approach. I realized that the problem could be represented as a tree structure, where each process is a node, and the parent-child relationships define edges.
Step 3:
I used a HashMap (Adjacency List) to store the parent-child relationships, where each ppid maps to a list of its children. This allowed efficient lookups.
Step 4:
I then performed a Breadth-First Search (BFS) or Depth-First Search (DFS) starting from the given kill process ID. This ensured that all child processes (direct and indirect) were captured.
Step 5:
The interviewer was satisfied with the optimized approach, as it efficiently retrieves all affected processes in O(N) time complexity instead of iterating multiple times over the list.
Problem Statement:
Design a Splitwise-like Expense Sharing System
Description:
You need to design a bill-splitting application similar to Splitwise, where users can create groups, add expenses, and split the amount among friends. The system should handle different types of expense splitting, such as equal, percentage-based, and custom splits.
Requirements:
User Management:
1. Users should be able to sign up, log in, and manage their profiles.
2. Each user should have a unique ID.
Expense Management:
1. Users can create expenses and add participants.
2. Expenses can be split equally, by percentage, or in a custom ratio.
3. The system should track who owes whom and how much.
Group Management:
1. Users can create groups and add members.
2. Expenses within a group should be shared among its members.
Transaction Settlement:
1. Users should be able to settle debts by making payments.
2. The system should optimize transactions to minimize the number of payments.
Scalability & Performance:
1. The system should support millions of users efficiently.
2. Efficient querying for expense history and balances.
Tip 1:Focus on low-level design patterns and object-oriented principles.
Tip 2:Practice problem-solving with real-world system design examples.
Tip 3:Understand scalability concepts like load balancing, caching, and database sharding.

Here's your problem of the day
Solving this problem will increase your chance to get selected in this company
What is recursion?