Arrays and Running Sums
Twilio's HackerRank assessment often includes an array problem or two, and the clock is tight. The four problems below look different from each other, but each one keeps a small piece of state and updates it once per element as you scan the array.
The set covers running sums, a queue simulation, a prefix-sum count and a small route-cost dynamic program.
Before you write the loop, decide what the state is and what value it starts at. A wrong seed can pass the samples and still fail a hidden case. The usual one is an all-negative array, where a best sum seeded at zero returns zero instead of the largest negative value. The first element is the other case the hidden tests check.
TwilioPremium lesson · Coding round
The 4 Twilio problems are below.
- A Premium questionCoding · Easy
- A Premium questionCoding · Medium
- A Premium questionCoding · Medium
+ 1 more in this lesson
Each with hints, the follow-up and a tested solution.
Get the Twilio questions$49 a year · all 100 companies · cancel anytime
From 197 Twilio reports, forum threads behind logins and write-ups in Chinese.
Twilio interview guideKnow what Twilio asks before you walk in.
31 coding · 3 system design · 18 behavioral questions
Get their questions first.
InterviewLegend is independent and not affiliated with or endorsed by any company it covers.