6 ms·
It's a question I ask often in interview, how do you upload a 5GB file over the network with only 1MB of memory.
by Thaxll 5y ago
It's a question I ask often in interview, how do you upload a 5GB file over the network with only 1MB of memory.
- jhgb 5y ago> with only 1MB of memory Is that total system memory?
- deleted 5y ago[deleted]
- qaq 5y agohello world in Go is 1.9 MB
- Rapzid 5y agoWell I left Kentucky back in '49 and went to Detroit work'n on assembly line..
- _ph_ 5y agoI am even not sure what this question is aiming at - I hope you are phrasing it more detailed than put here, or it would fit in those posts about the problems with interview questions :). Assuming the file is on a disk and the 1 MB refers to the system memory - like you do with any potentially unbound data, you read and write it in chunks. Reading in data of any kind in whole is only reasonable, if you can clearly set an upper bound for its size.
- Thaxll 5y agoThis is not vague, it aims to see if the candidate has a notion of buffering, streaming ect ... the numbers don't really matter, you would be surprised at how many candidate have no idea how to load data in memory.
- krageon 5y agoTo such a vague question, the only answer can be "less than 1MB at a time". Not terribly useful.