Deduplicating beyond memory
You have a 1TB log file with one URL per line and need to remove duplicate URLs, but you only have 1GB of memory. How do you do it?
You have a 1TB log file with one URL per line and need to remove duplicate URLs, but you only have 1GB of memory. How do you do it?
Partition the file by URL hash into chunks that fit in memory (say 2000), so identical URLs always land in the same chunk, then deduplicate each chunk with an in-memory Set and merge. If approximation is acceptable a Bloom filter does it in one pass, and external sort followed by adjacent comparison also works.
CS fundamentals and algorithmsShort answerBasics
Chat messages sit in an array sorted by id ascending. When the user taps a push…
#dedupe
CS fundamentals and algorithmsShort answerBasics
Your app writes a network log file. Each line has the format userID(4 digits) pageName…
#streaming
PersistenceShort answerBasics
Which requirements push you to Core Data (or SwiftData) instead of UserDefaults or a…
#sqlite
PersistenceShort answerBasics
A teammate says "Core Data is heavy and hard to understand, let's use SQLite directly (or…
#sqlite