InterviewLegend

Loops, Recursion and Lists

Alex Chen35 min readUpdated 55 real interview reports

Live rounds at Fidelity for new grads, interns and associates often start with a classic warmup on a whiteboard or a dry-erase board. India campus technical rounds use the same kind of warmup after the project discussion. The problems are easy, and the real questions start once you finish, when the interviewer asks what your code costs or how else you'd write it.

Each problem has one detail that breaks careless code, like a 1-based value stored at a 0-based index, or a sequence that outgrows a Java int. Point out the detail before you code, and you'll already have the answer when the follow-up comes.

Write each one in Java with the signature you'd use in real code. Return a collection and print it from main, and use an ArrayDeque for any stack instead of the old Stack class. Plain recursion is a fine first answer, but when it makes close to 2^n calls, offer a memo or a loop next. On a whiteboard you'll also write any small node class yourself.

FidelityPremium lesson · Coding round

The 5 Fidelity problems are below.

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

+ 2 more in this lesson

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

Get the Fidelity questions

$49 a year · all 100 companies · cancel anytime

From 20,000+ candidate reports, forum threads behind logins and write-ups in Chinese.

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

Know what Fidelity asks before you walk in.

29 coding · 1 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.