public static void Main()
var inputValues = new[] { 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15 };
for (var i = 0; i < inputValues.Length; i++)
Console.WriteLine(ReconnectionStrategy.GetRetryTime(15, inputValues[i]));
internal class ReconnectionStrategy
static Random _random = new Random();
public static double GetBackoffCoefficient(int retryCount)
return Math.Min((retryCount + 2) / 3, 2);
public static double GetJitterCoefficient()
return 1 - (_random.NextDouble() * 0.2);
public static double GetRetryTime(double initValue, int retryCount)
return initValue * GetBackoffCoefficient(retryCount) * GetJitterCoefficient();