Scan a 1 TB File for a Virus String
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?
CitiPremium lesson · System design round
The Citi design, worked end to end.
- Requirements and scopeSystem design
- The API and data model
- The design, drawn out1 diagram
- 5 deep divesWith the tradeoffs
$49 a year · all 108 companies · instant access
20,000+ candidate reports
Citi interview guideKnow what Citi asks before you walk in.
26 coding · 6 system design · 20 behavioral questions
Get their questions first.
InterviewLegend is independent and not affiliated with or endorsed by any company it covers.