Square Coding Interview Questions
27 Square coding interview problems with full optimal solutions — 18 easy, 7 medium, 2 hard. Every problem ships with multiple approaches (brute-force first, then the optimal), complexity tables for each, company-specific tips on what an Square interviewer values, and a FAQ section.
Showing 2 problems of 27
- #26hardfoundational
26. Median of Two Sorted Arrays
Find the median settlement time across two independently sorted streams of payment batches — Square's treasury team computes this real-time percentile across bank ACH and card-network queues to hit SLA commitments without merging two large sorted logs.
- #27hardfoundational
27. Trapping Rain Water
Calculate the maximum funds that can accumulate between settlement barriers in a payout timeline — Square's Banking team models daily balance troughs between large outflows exactly this way: water trapped between elevation bars mirrors cash trapped between sequential large disbursements.