Given n vectors x 0 , x 1 , . . . , x n−1 in {0, 1} m , how to find two vectors whose pairwise Hamming distance is minimum? This problem is known as the Closest Pair Problem. If these vectors are generated uniformly at random except two of them are correlated with Pearson-correlation coefficient ρ, then the problem is called the Light Bulb Problem. In this work, we propose a novel coding-based scheme for the Closest Pair Problem. We design both randomized and deterministic algorithms, which achieve the bestknown running time when the length of input vectors m is small and the minimum distance is very small compared to m. Specifically, the running time of our randomized algorithm is O(n log 2 n·2 cm ·poly(m)) and the running time of our deterministic algorithm is O(n log n · 2 c m · poly(m)), where c and c are constants depending only on the (relative) distance of the closest pair. When applied to the Light Bulb Problem, our result yields state-of-the-art deterministic running time when the Pearson-correlation coefficient ρ is very large. Specifically, when ρ ≥ 0.9933, our deterministic algorithm runs faster than the previously best deterministic algorithm (Alman, SOSA 2019).We consider the following classic Closest Pair Problem: given n vectors x 0 , x 1 , . . . , x n−1 in {0, 1} m , how to find the two vectors with the minimum pairwise distance? Here the distance is the usual Hamming distance:Without loss of generality, we assume that d min = dist(x 0 , x 1 ) is the unique minimum distance and all other pairwise distances are greater than d min .The Closest Pair Problem is one of the most fundamental and well-studied problems in many science disciplines, having a wide spectrum of applications in computational finance, DNA detection, weather prediction, etc. For instance, the Closest Pair Problem has the following interesting application in bioinformatics. Scientists wish to find connections between Single Nucleotide Polymorphisms (SNPs) and phenotypic traits. SNPs are one of the most common types of genetic differences among people, with each SNP representing a variation in a single DNA block called nucleotide [22]. Screening for most correlated pairs of SNPs has been applied to study such connections [11,15,17,38]. As the number of SNPs in humans is estimated to be around 10 to 11 million, for problem size n of this size, any improvement in running time for solving the Closest Pair Problem would have huge impacts on genetics and computational biology [38].In theoretical computer science, the Closest Pair Problem has a long history in computational geometry, see e.g. [43] for a survey of many classic algorithms for the problem. The naive algorithm for the Closest Pair Problem takes O(mn 2 ) time. When the dimension m is a constant, either in the Euclidean space or p space, the classic divide-and-conquer based algorithm runs in O(n log n) time [14]. Rabin [42] combined the floor function with randomization to devise a linear time algorithm. In 1995, Khuller and Matias [31] simplified Rabin's algorithm to achieve ...