Google | Onsite | Word Replacement
Difficulty: EASYCategory: InterviewExperienceFrequency: 1Asked On 2025-02-10Added By Anonymous
Source:Β Link
π§ Experience: unknown
β Outcome: unknown
π° Compensation: unknown
π Location: unknown
π’ Company: Google
π Education: unknown
π Benefits: unknown
π Offer Date: unknown
**Problem Statement:**
You are given two file systems:
1. One contains a list of sensitive words along with their replacements.
2. The other consists of large files, potentially terabytes in size.
The goal is to write a program that efficiently replaces all occurrences of sensitive words with their corresponding replacements.
**Solution:**
My current approach involves splitting the large files into chunks and using `FileReader` to process and replace words. However, Iβm looking for a more optimized solutionβany suggestions?
β Outcome: unknown
π° Compensation: unknown
π Location: unknown
π’ Company: Google
π Education: unknown
π Benefits: unknown
π Offer Date: unknown
**Problem Statement:**
You are given two file systems:
1. One contains a list of sensitive words along with their replacements.
2. The other consists of large files, potentially terabytes in size.
The goal is to write a program that efficiently replaces all occurrences of sensitive words with their corresponding replacements.
**Solution:**
My current approach involves splitting the large files into chunks and using `FileReader` to process and replace words. However, Iβm looking for a more optimized solutionβany suggestions?