Round 1: Machine Coding Round (90 mins)
Give a brief about your projects.
Problem Statement: Digital Wallet Implementation
Several functionalities need to be implemented. All test cases should pass.
Functionalities to implement:
create_wallet(account_holder, amount): Creates a wallet and initializes the balance.
transfer_money(account1, account2, amount): Transfers money from account1 to account2.
statement(account): Shows the transaction history (type of transfer: credit/debit, from/to account, amount).
offer1: If, after a transaction, both accounts have equal balances, both are credited with 10/-
offer2: Top 3 customers based on priority (number of transactions, account balance, creation time) receive 10/-, 5/-, and 2/- respectively.
overview(accounts): Displays the account holder and balance for all customers.
After execution, the interviewer asks for a code walkthrough.
PFA my answer for the above problem.
Round 2: PSDS Round (60 mins)
Problem 1: Given a set of unique elements, print the power set.
For example: {1, 2, 3}
Power set will be: {{}, {1}, {2}, {3}, {1,2}, {2,3}, {1,3}, {1,2,3}}
- Coded using recursion.
- Need to dry run the code for the above test case.
Problem 2: Given a tree where each node has some coins, collect the maximum number of coins such that you do not collect coins from any alternate nodes. That is, if you collect coins from a node, you cannot collect from any of its adjacent nodes.
Example:
1
/ \
5 6
/ /
2 1 9 4
/
3 1
Maximum coins: (5 + 3 + 9 + 4) = 21
- Given a DFS approach.
- DP on trees.
Problem 3: Given a string, find the maximum length substring having at most k unique characters.
Example: abcaacabcabcaa
k=2, Answer = 5 (caaca)
- Given a two-pointer approach and a hashmap.
- Sliding window.
Round 3: Hiring Manager Round (45 mins)
- Tell me about yourself.
- About projects.
- Challenges faced.
- Why are you looking for a change?