If a layperson during the Tang dynasty aspired to pass the civil examinations, where would he start? Where would he find the Confucian classics to study? Or, would he attach himself to a master? If so, where would he find a master who would be willing to take him on as a disciple?
There is always more to be said, but before someone answers this specifically, you might find this answer by /u/touchme5eva useful as it deals with a similar question, though mainly during the Ming period.