In a large pot, heat the vegetable oil over medium-high heat.
Add the grated ginger and minced garlic to the pot and cook for 1-2 minutes, or until fragrant.
Add the bamboo shoots and shiitake mushrooms to the pot and cook for an additional 2-3 minutes.
In a separate bowl, whisk together the chicken or vegetable broth, rice vinegar, soy sauce, cornstarch, white pepper, and cayenne pepper until the cornstarch is dissolved.
Pour the broth mixture into the pot and bring it to a boil.
Reduce the heat to medium-low and simmer for 10-15 minutes, or until the soup has thickened.
Add the sesame oil, lightly beaten egg, diced tofu, and green onions to the pot and stir gently.
Cook for an additional 2-3 minutes, or until the egg is cooked through.