r/codinginterview • u/Samayra990 • Aug 11 '18
VmWare sde 3 interview question- java
* You will have to write a main program to take snapshots of VMs
Input: List of VMs(vmId: String), list of SLAs -> there is one-to-one mapping from VM to SLA
class SLA {
int freq_in_mins;
}
vm1 -> sla1{30 mins}
vm2 -> sla2{60 mins}
Constraints:
You can use takeSnapshot(vmId: String) -> Synchronous - I/O
If you start a snapshot of VM(with sla1) at time t0 and if it finishes at time t1, then the next snapshot should be scheduled at t1+sla1.freq_in_mins
vm1 at 00:00 and vm2 at 00:00
00:10 and 00:15
vm1 -> 00:10 + 30 = 00:40
Can someone code this up in Java?
0
Upvotes