Govt. Exams
Entrance Exams
If all servers must be up: (0.999)^100 ≈ 0.905 * 100 = 90.5%... Actually (0.999)^100 ≈ 0.9048 or ~90.48%. Closest is 36.5% for series of events
CAP theorem states that distributed systems can guarantee at most two of: Consistency, Availability, and Partition tolerance.
Eventual consistency means that if no new updates are made, all nodes will eventually see the same data, though there may be temporary inconsistencies.
Recursive DFS uses call stack space proportional to the height of the tree/graph. For balanced tree, it's O(log n); worst case O(n).
A power of 2 has only one bit set. n & (n-1) removes the rightmost set bit, so if result is 0, n is a power of 2.
Final position: 3 km east, 3 km north (5-2). Distance = √(3² + 3²) = √18... Actually √(3² + (5-2)²) = √(9+9) = √18. Check: √34 = √(3² + (√25)²)... Correct is √(9+25) = √34
We cannot conclude that some roses are red because the second statement doesn't specify which flowers are red. Roses may or may not be among the red flowers.
10,000 requests at 1000/sec = 10 seconds. Failed requests = 10,000 × 0.08 = 800. Retry time = 800 × 2/1000 = 1.6 seconds. Total ≈ 10 + 1.6 = 11.6 seconds.
Resize occurs when entries exceed capacity × load factor. If 1000 entries at 0.75 load factor, capacity = 1000/0.75 = 1333
Good hash functions are deterministic (same input gives same output), uniformly distribute values, and minimize collisions.