↓ Ir para o conteúdo principal

← todas as notas

📎 Webclip

Interview Question: how do you ensure you only virus scan once?

The article argues that interview questions should reflect problems developers face in practice, not just DSA or low-level algorithm drills. It uses a file-upload case to probe how a candidate thinks about repeated virus scanning, storage reuse, UX, fault tolerance, and scaling.

Reading notes
#

  • The author prefers interview questions that test reasoning about frequent real-world challenges.
  • The example asks how to avoid scanning the same uploaded file multiple times.
  • A proposed answer is to name files from their contents using a V5 GUID, check whether that name already exists in storage, and scan only when the file is new.
  • If the file already exists, the system can reuse the stored result and report whether it is infected.
  • The same approach stores the file only once and uses the generated name as a reference.
  • The method is presented as friendly to users because they can just upload files without extra work.
  • For fault tolerance, the article suggests recording the filename together with the scan version, or changing the V5 GUID namespace so future uploads are scanned again.
  • Suggested tools include a database for the file name and Redis for faster lookup.
  • The author says the lookup becomes O(1) after the name is created, while creating the name is O(N) in file size and already part of the upload work.
  • If an interviewee pushes responsibility onto users, the author recommends steering them back toward UX and cost concerns.
  • The conclusion is that interviewers should learn how candidates reason about real problems, not whether they can repeat memorized algorithms.