Slice the ampalaya in half lengthwise and remove the seeds. Slice thinly and gently press to reduce some of the bitter juices. Set aside.
Peel and chop the shrimp. Reserve the shrimp shells.
Heat enough cooking oil in a pan over medium heat.
Add the chopped garlic and saute until lightly golden brown.
Add the chopped onions and cook until translucent.
Add the chopped tomatoes. Cover the pan and cook until the tomatoes become soft.
Mash the softened tomatoes using the back of a spoon to create a flavorful sauce.
Add the chopped shrimp.
Season with fish sauce, ground black pepper, a pinch of salt, and a pinch of sugar.
Cover and cook for about one minute.
Place the reserved shrimp shells in a bowl.
Pour 1 cup of boiling water over the shrimp shells.
Press the shells gently using a spoon to extract as much shrimp flavor as possible.
Strain the shrimp broth directly into the pan.
Cover and bring everything to a gentle boil.
Add the sliced ampalaya on top.
Do not stir immediately. Let it cook for several minutes without disturbing it to help prevent excessive bitterness.
Pour the beaten eggs evenly over the ampalaya.
Cover the pan for about one minute until the eggs begin to set.
Using a spatula, gently fold everything together. Avoid overmixing.
Taste and adjust the seasoning if needed.
Serve immediately with hot steamed rice.