I'd extend the question to the later stages of the Warring States period too.
The Kingdom and later Empire of Qin was organized along the theories of Legalism with an extensive code of law that was theoretically to apply equally to all citizens. But how were these laws enforced? Who was responsible for investigating crimes and bringing the guilty (or suspect) to court?
The highest criminal court in the land was the Tingwei (廷尉), whose highest official was also called the Tingwei, and was one of the Three Lords and Nine Officials which formed the Qin court's highest offices. His duties were twofold: 1) the investigation of any cases relating to the King, and 2) as the Supreme Court and highest court of appeal in the Kingdom.
Beneath him was an entire system of regional judges led by the various Commandary Magistrates (郡守) and Provincial Magistrates (縣令). Day-to-day cases were trialled there, while complex cases were referred up to the Tingwei. Enforcement of these were subordinated to the Provincial Captains (縣尉) or Commandary Captains (郡尉). The numbers of these captains were not fixed, and larger provinces like Luoyang had 2-4 at the same time. The captains commanded the regional militia (armies were commanded by the military, which was seperate from the judiciary), and were also responsible for putting down revolts, capturing bandits, and patrolling borders.
The Tingwei was subordinate only to the King, who theoretically still held absolute authority to overturn any decision. In practice, the Legalist system was established precisely to discourage kings from exercising their authority, incentivising them to delegate their authority to more qualified officials. Han Feizi, one of the developers of the Legalist philosophy, worried about the variance in quality of rulers, and sought to create a system which would allow even a mediocre ruler to govern well. The Legalist system is precisely that, a series of codes which if followed limit the probability that kings would do stupid things.