randomized
randomized is one of the most repeated interview dimensions. Start with edge-safe fundamentals, then move into pattern-level trade-offs.
Interview Signal
Frequently tests problem modeling, edge handling, and verbal clarity.
Common Pitfall
Template-only answers break under follow-up questioning.
Practice Strategy
Practice in 3-5 problem rounds and always review complexity alternatives.
Recommended Progression
Foundation
High-Pressure Round
Insert Delete GetRandom O(1)
Implement a data structure supporting insert, delete, and getRandom in average O(1) using array plus hash mapping.
Insert Delete GetRandom O(1) - Duplicates allowed
This problem challenges you to design a data structure that supports insertion, removal, and random access with O(1) tim…
Linked List Random Node
Select a random node from a singly linked list ensuring uniform probability using efficient pointer techniques and reser…
Shuffle an Array
Shuffle an Array requires designing a class to randomly permute an integer array while ensuring all permutations are equ…
Random Pick Index
Random Pick Index involves selecting a random index of a target number in an array with possible duplicates.
Implement Rand10() Using Rand7()
Generate uniform random numbers from 1 to 10 using only rand7(), applying rejection sampling for consistent probability …
Generate Random Point in a Circle
Generate Random Point in a Circle requires creating a uniform random point inside a circle using math and geometry princ…
Random Point in Non-overlapping Rectangles
Design an algorithm to pick random points within non-overlapping rectangles using binary search and reservoir sampling.
Random Flip Matrix
Design an optimized algorithm to randomly flip an index in a matrix, using hash tables and math for efficient random sel…
Random Pick with Weight
Random Pick with Weight requires implementing a probabilistic index picker using prefix sums and binary search efficient…
Random Pick with Blacklist
Random Pick with Blacklist requires designing a method to uniformly pick integers while excluding blacklisted values eff…
Best Position for a Service Centre
Find the optimal service center position in a city by minimizing the sum of Euclidean distances to all customers.