InterviewLegend

String Problems

Alex Chen35 min readUpdated 108 real interview reports

String problems at Barclays come up in the online assessment, usually near the end of the paper. The graduate test on HackerEarth has closed on one worth 50 marks in more than one hiring cycle. The statement gives one small sample, and most of the marks are in hidden cases.

The other two come from different papers, an SHL new-grad OA and a 2022 paper. One is a search over string states, and the other hides a sliding window inside a long story and asks for a count at the end. Read each statement all the way to the output line before you start.

The Barclays angle
Check the output line against the sample twice. Barclays OA prompts wrap short string problems in long stories, and the platform marks hidden cases, so misreading the last line costs you the whole problem. On one sample here, two different readings of the output both come out as 3, so a wrong reading still passes it. Two of the problems also want -1 when no answer exists, so write that branch first.

BarclaysPremium lesson · Coding round

The 3 Barclays problems are below.

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

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.