Suppose we are designing a social networking website which has over one million users.A profile JSON of a social networking website looks like:
{
"id":"siret87324sd1232",
"name":{
"first":"Aamir",
"middle":"Hussain",
"last":"Khan"
},
"dob":"14-03-1965",
"locations":[{
"name":"Mumbai",
"coords":{
"long":72.872075,
"lat":19.075606
},{
"name":"Delhi",
"coords":{
"long":23.23,
"lat":12.07
}]
},
"imageId":"siret87324sd1232.jpg"
}
A. Given that you have only 32MB of RAM available and the average profile image size is 100KB, therefore all the images can not fit in the RAM. What is the best way to store these images on the hard disk drive? (Assume that unlike RAM, hard drive has no space limitation).
B. Suppose each image has the same name as the person id, i.e., if person id is 23321123 the name of the profile image will be 23321123.jpg. What is the best way to get this image from the hard disk? Assume ids and image names are unique and ids are 8-digit numbers, and the platform takes 4 byte to store the integers.
Aucun commentaire:
Enregistrer un commentaire