← All questions
MediumCoding
Maximum Sum Circular Subarray
Asked at
Agoda
1Give yourself 5 minutes
2Answer out loud, not in your head
3Then compare with the answer below
0
Stuck? Show a way to structure it+
- 01Compute ordinary maximum subarray
- 02Compute ordinary minimum subarray
- 03Use total minus minimum for wrapped candidate
- 04Reject the all-negative wrapped case
- 05Return the better valid candidate
Reference answer
Then expect these follow-ups
Why is the excluded part contiguous?
Tests: correctness reasoning
How would indices be reconstructed for the wrapped case?
Tests: implementation extension
Hiring now
Agoda has 245 open roles right now
landed applies to roles like these for you, on each company’s own site, with answers written for the role.
Get 5x interviews10 free auto-applies. No card.
Customer Experience Specialist - Graveyard Shift (Kuala Lumpur)
Kuala Lumpur, Malaysia
Payment disputes coordinator (10-month contract) (Bangkok-Based, No Visa Provided)
Bangkok, Thailand
Payment Operations Coordinator (10-month contract) (Bangkok-Based, No Visa Provided)
Bangkok, Thailand
Next question