Just finished the Squarepoint OA, sharing the two coding questions.
The first question was about maximizing store revenue. Given n items, each with quantity[i] representing the remaining stock, the price equals the quantity. There are m customers, each buying one item, and the goal is to maximize revenue. I solved it with a max heap — each time popping the largest, selling it, then pushing it back with quantity minus 1.
The second question was word frequency counting. Given a string, count how many times each word appears, case insensitive. Sort by frequency, and for ties, sort alphabetically. Return at most 3 words. I'd practiced this problem before, but the "at most 3 words" constraint took me a moment to understand — it's a total limit, not a per-group limit.
Overall the questions weren't super hard, but you had to pay attention to the details. I heard Squarepoint's OA requires getting everything correct to move on to the phone screen, so there was some pressure.
Giving back to the community, hope this helps everyone!
Discussion
Loading comments…