File transfer Question

A file is transferred from one location to another in ,buckets,. The size of the bucket is 10 kilobytes. The bucket gets filled at the rate of 0.0001 kilobytes per millisecond. The transmission time from sender to receiver is 10 milliseconds per bucket. After the receipt of the bucket the receiver sends an acknowledgement that reaches sender in 100 milliseconds. Assuming no error during transmission, write a formula to calculate the time taken in seconds to successfully complete the transfer of a file of size N kilobytes.
This question is related to TCS Interview

Questions by abhijit_de2000   answers by abhijit_de2000

Showing Answers 1 - 21 of 21 Answers

amitsha

  • Aug 7th, 2008
 

rate=1 ms -> .0001kb
    or 1 kb  -> 10000ms
       N kb  -> N*10000ms
10ms(to reciver)+N*10000ms(to fill)+100ms(for recipent)=(110+N*10000)ms

arsi_mars

  • Aug 17th, 2008
 

(i) total time to fill Nkb=10000N 
10 kb=>1bkt
 N kb=> N/10 bucket
(ii)To send 10 ms per bucket so for N/10 bucket it is =N ms
 (iii) Now acknowledge for 1 bkt= 100ms
Acknowledge for N/10 bkt= (N/10)*100=10N
Total time-== 10000N+N+10N=10011N answer

  Was this answer useful?  Yes

Raze2dust

  • Nov 8th, 2008
 

Bucket is filled at 0.1 kbps. So each bucket takes 100 s. There are N/10 buckets.
Each bucket takes 0.01 s to transmit, and 0.1 s more to get the acknowledgement.

Let there be k full buckets...Time taken to fill them= 100k
Remaining N%10 kbs will take [(N%10)/10]*100 s = (N%10)*10 s

Transmission+acknowledment needs further 0.01+0.1 s

So total time=10N+(N%10)*10+0.11=10[N+N%10+0.011]

  Was this answer useful?  Yes

prasadude

  • Dec 13th, 2008
 

the speed at which a bucket filled is is 0.0001 kilobytes per millisecond
this is re-written as 0.1 kilobytes per second
i.e 100 seconds to fill a bucket which is 10kb in size
transmission time is 10 milliseconds or .01 sec
reception time is 100 milliseconds or .1 sec
the total time is 100+.01+.1=100.11 sec

the size of a file is N kb
it must thus contain N/10 buckets
thus the total time required is N/10 * (100.11)= N*10.011 seconds

The speed at which a bucket filled is is 0.0001 kilobytes per millisecond
i.e 0.1 kilobytes per second
for Nkb time is 10N seconds
No. of buckets k=N/10 where k is the higher intiger(i.e if N/10=2.2 then k=3)

Since the extra ).2 bucket is actually another partially empty bucket and will take the same time as any other bucket to travel.

Transmission time from sender to receiver is 10 milliseconds or .01 sec per bucket
=.01*k sec for k bucket
Acknowledgement time is 100 milliseconds or .1 sec per bucket
=.1*k sec for k bucket

Therefore,
Total time T=10*N+.01*k+.1*k
or, T=10*N+0.11*k

  Was this answer useful?  Yes

Give your answer:

If you think the above answer is not correct, Please select a reason and add your answer below.

 

Related Answered Questions

 

Related Open Questions