我被问到以下问题
There are X number of compressed files of different sizes in a single folder.
Where X is 1 to 250.
File size ranges from 1MB to 65MB. The compression ratio varies from 9 to 11.
There are Y number of parser threads. Where Y is between 1 to 8.
Write an application that distributes the files so each thread receives the same amount of data ( or as close as possible ).
Please follow all best coding practices and standards you are familiar with.
For example
If X is 5 and Y is 3 and the files are
File 1 is 1MB, File 2 is 2MB, File 3 is 3MB, File 4 = 4MB, File 5 = 5MB.
Uncompressed File 1,2,5 = compressed file * 9. Files 3,4 = compressed file * 10
Output
Thread <thread number> = Files <file number...> = <total size of all files uncompressed>
...
Data skew = ((max size - min size) / max size ) * 100
我是否认为这是一个不可能回答的问题,它似乎很模糊。在我看来,这是一个很难在 1 小时内回答的问题。
我认为分布并非微不足道。
编辑
我所知道的问题就是上面所说的。
对我来说,这似乎是一个非常模糊的问题。