r/OfferEngineering • • 2d ago

Interview Experience Paypal SWE Intern OA - 3 Easy Coding Problems

This interview experience is sourced from Chill Interview

Interview Summary

The PayPal online assessment consisted of three relatively easy coding problems covering greedy algorithms, sliding-window rate limiting, and array traversal. Each problem focused on a common algorithmic pattern and could be handled efficiently using standard data structures such as heaps, hash maps, and queues.

Interview Details

Question 1 — Minimum Cost to Merge Array Elements

Given an integer array A, repeatedly select any two elements a and b, remove them from the array, and insert their sum a + b. Each operation incurs a cost equal to a + b, and the process continues until only one element remains.

The objective is to determine the minimum total cost required to merge the entire array into a single value. The key challenge is choosing the order of merges efficiently, making this a classic greedy problem involving a min-heap.

Question 2 — Per-User Sliding Window Rate Limiter

Given four inputs, users[], times[], k, and t, each request i is associated with user users[i] and timestamp times[i]. The timestamps are provided in sorted order, and each user is allowed at most k accepted requests within any sliding window of t seconds.

The task is to return an integer array results[], where results[i] = 1 if request i is accepted and results[i] = 0 if it is rejected. Each user's request history must be tracked independently, and timestamps outside the current window should no longer count toward the limit.

The main challenge is efficiently maintaining the relevant timestamps for each user as new requests arrive. The problem naturally involves a hash map combined with per-user queues.

Want to learn more questions / follow-ups asked in this interview? 

I've put up the full version at here.

Interviewed recently?

Your interview experience could be incredibly valuable to others preparing for their next opportunity. Share your experience and help the community at here.

3 Upvotes

0 comments sorted by