...
/Feature #7: Divide Files Over the Network
Feature #7: Divide Files Over the Network
Implementing the "Divide Files Over the Network" feature for our "Network" project.
We'll cover the following...
Description
We need to perform multiple operations on a large number of files over our network. Each file is represented by a lowercase English letter. The complete file array will be provided to us in the form of a string like "abacdc"
. The position of each letter tells us the sequence in which the files need to be processed. If multiple instances of a file are present, it means that multiple operations will be performed on that file. The file name mapping to characters is shown below:
The number of files is so large that we deployed a high-performing cluster on the server to handle it. The cluster is supposed to divide the files among its worker nodes so more work can be done in less time. Each node must be assigned a set of contiguous file operations from the input string.
In order to minimize the communication overhead, the files will be divided so that they utilize the maximum number of worker nodes and no two nodes process the same file. This will help us remove the dependency of files resulting in communication overhead between nodes. For example, the string "abacdc"
will be divided into two worker nodes as "aba"
and "cdc"
.
We’ll be provided with a string of characters representing the number of files in the sequence they need to be processed. Our task is to ...