Panda Guru LogoPanda
Guru

Amazon OA

Round 1

Questions: Specific question not provided.

Follow-up Question

image image

Test Cases:

Candidate's Approach

The candidate implemented a function getMaxNegativePnL that attempts to calculate the maximum number of negative counts based on a cumulative sum. However, they noted that the code does not cover all test cases.

def getMaxNegativePnL(PnL): cumulative_sum = 0 negative_count = 0 for num in PnL: cumulative_sum += num if cumulative_sum - 2*num > 0: negative_count += 1 cumulative_sum -= 2*num return negative_count
Interviewer's Feedback

No feedback provided.