InterviewLegend

Scan a 1 TB File for a Virus String

Commonly asked
Alex Chen22 min readGuide updated 60 real interview reports

This came up in the third round of a June 2026 loop for a senior Java developer in Pune, with the hiring manager. The candidate went on to get the offer. They started with chunking, to avoid running out of memory. The interviewer cut in with the case of a pattern that overlaps two chunks. The candidate then added an early exit once the count was reached. That's the path the candidate described, and it maps the hour well. It looks like a coding question and grows into a design one. A string search on a small file is a one-liner. At 1 TB, nothing fits in memory, the read takes minutes to hours, and every shortcut that works on a test string breaks somewhere. The real work sits at the edges. Where does one chunk end and the next begin? When is it safe to stop? And what does "delete" mean when you might be wrong?

The Citi angle
Citi hiring-manager rounds are mostly talk. In this one, the file scan came after an org-tree coding question in the same hour. Expect to describe the loop out loud, maybe write it, and be interrupted partway. Build the answer in small steps you can pause on and extend.

CitiPremium lesson · System design round

The Citi design, worked end to end.

  1. Requirements and scopeSystem design
  2. The API and data model
  3. The design, drawn out1 diagram
  4. 5 deep divesWith the tradeoffs
Get the Citi questions

$49 a year · all 108 companies · instant access

20,000+ candidate reports

Citi interview guide

Know what Citi asks before you walk in.

26 coding · 6 system design · 20 behavioral questions

Get Premium$49 a year · Instant access
Or start freeNo card.

Get their questions first.

Had your Citi interview?How we research

InterviewLegend is independent and not affiliated with or endorsed by any company it covers.