Skip to content

Category Archives: Randomized

Given two integers N and K representing number of trials and number of total threads in parallel processing. The task is to find the estimated… Read More
Generating Random Unweighted Binary Tree: Since this is a tree, the test data generation plan is such that no cycle gets formed. The number of… Read More
Given a positive integer N, the task is to generate a random binary string of length N. Examples: Input: N = 7Output: 1000001 Input: N… Read More
Given an integer N. A number guessing game is a simple guessing game where a user is supposed to guess a number between 0 and… Read More
Given two integers N and K, where N represents the total number of cards present when game begins and K denotes the maximum number of… Read More
Given four integers N, R, X, and Y such that it represents a circle of radius R with [X, Y] as coordinates of the center.… Read More
If we keenly observe, randomness can be effectively derived from nature. Despite being explainable by scientific phenomena, the behavior of most matter on earth is… Read More
If the receiver proclaims a large window-size, larger than what the network en-route can manage, then there will always be packet losses. So there will… Read More
Given a number N, the task is to construct a square matrix of N * N where union of elements in some ith row with… Read More
Given a string. The task is to find the maximum number P, such that a given string can be partitioned into P contiguous substrings such… Read More
Given a binary array arr[], the task is to find the length of the longest sub-array of the given array such that if the sub-array… Read More
Given an integer N, the task is to generate N non-repeating random numbers. Examples:   Input: N = 5 Output: 1 5 2 4 3 Input: N… Read More
Generate a random, unique, alpha-numeric string using PHP. Examples: EA070 aBX32gTf APPROACH 1: Brute Force The first approach is the simplest one to understand and… Read More
Now these days, OTP (one time password) is mandatory in almost each and every service. A developer can generate OTP in many ways but the… Read More