InterviewLegend

Prefix Sums & Greedy

Alex Chen22 min readUpdated 309 real interview reports

Several of the array problems Intuit asks share one habit. Each walks the array once or twice and carries a single value forward, like a running product or the most times the next letter may still appear. The product problem, where each slot gets the product of every other value, has come up in an SDE-2 Assessor round, an intern first round and two campus drives. The best contiguous sum came up on a Software Engineer 2 phone screen as Kadane's algorithm followed by a variation. In one SDE-2 interview, the craft coding round opened with a letter-frequency puzzle framed as a musical play.

The hard part usually comes after the first answer runs. On the product problem, division gets banned. On the contiguous-sum problem, the sum alone isn't enough, and you also have to give back where the best run starts and ends. None of these needs a clever data structure, so you're scored on whether the scan handles its edge cases and whether you can explain why each line is correct, including the greedy sort.

The Intuit angle
Expect the constraint to move once your first version works, and shape the code so the change is small. In one round on the product problem, a candidate divided the total product by each value with a guard for zero, and the interviewer took division away with a remark about a very poor compiler. A campus panel walked the same problem through four approaches, from quadratic down to constant extra space, and another asked about overflow and zeros. In Java, have long results from int inputs ready, and give the overflow reason before the Assessor asks for it.

IntuitPremium lesson · Coding round

The 3 Intuit problems are below.

  1. A Premium questionCoding · Medium · Frequently asked
  2. A Premium questionCoding · Medium
  3. A Premium questionCoding · Medium

Each with hints, the follow-up and a tested solution.

Get the Intuit questions

$49 a year · all 100 companies · cancel anytime

From 309 Intuit reports, forum threads behind logins and write-ups in Chinese.

Had your Intuit interview?Tell us what they asked. Reviewed before it goes in, never with your name.
Intuit interview guide

Know what Intuit asks before you walk in.

28 coding · 5 system design · 21 behavioral questions

Get Premium$49 a year · Cancel anytime
Or start freeNo card.

Get their questions first.

InterviewLegend is independent and not affiliated with or endorsed by any company it covers.