Coding Round
1. Maximum Number of Active Loans
Every funded loan is active from its disbursal day to its closure day. This represents a time window [start, end), where:
startis inclusiveendis exclusive
Given a list of loan windows, return the maximum number of loans that are active at the same time.
Example
Input:
loans = [[1,5], [2,6], [4,8], [7,9]]
Output:
3Explanation
- At day
4, the loans[1,5],[2,6], and[4,8]are all active, so the maximum number of active loans is3. - At day
7, the loan[7,9]starts, but[1,5]and[2,6]have already closed.
Constraints
1 <= loans.length <= 10^50 <= start < end <= 10^9- A loan ending on day
5and another starting on day5do not overlap because the end day is exclusive.
2. Best Time to Buy and Sell Stocks with at Most K Transactions
You operate an orchard and have a list of apple prices over consecutive days.
You can make at most K trading transactions. Each transaction consists of:
- Buying one batch of apples.
- Selling that batch later.
Rules
- You must sell before buying again.
- You can hold at most one batch at a time.
- You can complete at most
Ktransactions. - One transaction is defined as one complete buy + sell pair.
Given an array prices, where prices[i] represents the apple price on day i, and an integer K, return the maximum profit you can achieve.
Example
Input:
prices = [3,2,6,5,0,3]
k = 2
Output:
7Explanation
Make two transactions:
- Buy at
2, sell at6→ profit =4 - Buy at
0, sell at3→ profit =3
Total maximum profit:
4 + 3 = 7Result
I was able to solve both coding questions within the given time, with only minimal handholding on the second question. The interviewer seemed satisfied with my approach and solutions. I also answered the typical project-related and AI-focused questions confidently.
Despite this, I was rejected without any detailed feedback or explanation. Given the overall interview experience and the lack of constructive feedback, this was honestly one of the worst interview experiences I’ve had.


