InterviewLegend

Dynamic Programming

Alex Chen40 min readUpdated 108 real interview reports

When Barclays sets dynamic programming in its OA, it's usually a short one-dimensional table. One coding round asked a classic with no story around it, and another paper wrapped a budget problem in a long story. Both fit in a page of code.

The other two come from graduate and campus papers, one worth 20 marks and one worth 50. The 50-mark one looks like DP and turns out to have a number theory shortcut, but write the memo first anyway. It's correct, and it gets the recurrence on the page.

The Barclays angle
The OA multiple choice asks you to optimise code, and so do these. Barclays assessments include "optimise this code" items, and the same skill helps here. Two of the four have a faster version than the first table you'll write. Write the slow version you trust first and test it on the sample, then speed it up.

BarclaysPremium lesson · Coding round

The 4 Barclays problems are below.

  1. A Premium questionCoding · Medium
  2. A Premium questionCoding · Hard
  3. A Premium questionCoding · Medium

+ 1 more in this lesson

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

Get the Barclays questions

$49 a year · all 100 companies · cancel anytime

From 108 Barclays reports, forum threads behind logins and write-ups in Chinese.

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

Know what Barclays asks before you walk in.

30 coding · 1 system design · 28 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.