Here, we generalize the Bernstein-Vazirani algorithm beyond qubit systems. First, we review the Bernstein-Vazirani algorithm for determining a bit string. Second, we discuss the generalized Bernstein-Vazirani algorithm for determining a natural number string. The speed of determining the strings is shown to outperform the best classical case by a factor of the number of the systems in every cases.