For marinade: In a small bowl, add soy sauce, hoisin, rice wine vinegar, chili paste and sesame oil. Stir together well.
Add tofu cubes into a shallow dish with a lid or a sealable bag. Add 3 tablespoon of the marinade over tofu. Add 1 teaspoon ginger and 1 clove garlic, stir carefully, and then let marinate for 30 minutes. After 30 minutes, add cornstarch to the tofu and toss to coat. Shake off any excess.
To the remaining marinade, brown sugar, and vegetable stock. Whisk together.
Add oil over medium heat to a large skillet. Cook the tofu for about 8-9 minutes, turning every 2 minutes or so to ensure all sides are crispy and golden. Remove the tofu.
In the same skillet, add more oil if needed. Add in remaining 2 teaspoon grated ginger, 2 cloves minced garlic, and red chili flakes if adding. Saute for 30 seconds. Add remaining marinade sauce and bring to a simmer. Stir occasionally until it begins to thicken.
Add tofu and toss to coat. Immediately remove and transfer as soon as it's coated to remain crispy.
Serve over rice, quinoa, noodles etc. with steamed broccoli as a side. Top with green onions and sesame seeds if desired.