InterviewLegend

Monotonic Stack and Greedy

Alex Chen30 min readUpdated 131 real interview reports

Outside graphs, two of the most repeated Nutanix problems use the same structure. Both keep a stack whose values stay in sorted order, and a new value pops whatever it beats.

What changes is the rule for popping, and whether the popped value or the one that popped it holds the answer. Start with the one that comes up most, and expect a follow-up that flips it to the opposite result.

The third problem is greedy too, but it needs no stack. It counts windows of reach, which makes it a BFS without a queue. It has shown up on the HackerRank online assessment and again in an onsite round.

NutanixPremium lesson · Coding round

The 3 Nutanix problems are below.

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

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

Get the Nutanix questions

$49 a year · all 100 companies · cancel anytime

From 131 Nutanix reports, forum threads behind logins and write-ups in Chinese.

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

Know what Nutanix asks before you walk in.

32 coding · 3 system design · 15 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.