Toss the shrimp with the soy sauce and sherry in a medium bowl.
Combine the garlic, ginger, scallion whites and 1½ teaspoons of oil in a small bowl.
Heat 2 teaspoons oil in a 12-inch non-stick wok over high heat until smoking.
Add the shrimp and cook, stirring occasionally, until cooked through, 2 to 3 minutes.
Transfer the shrimp to a clean bowl.
Add the remaining 1½ teaspoons of oil to the wok and heat until shimmering.
Add the onions and cook, stirring occasionally, until lightly browned, about 2 minutes.
Add the pineapple and cook until hearted through, about 1 minute.
Clear the center of the pan and add the garlic mixture.
Cook, mashing the garlic mixture with the back of a wooden spoon, until fragrant, about 45 seconds.
Stir the garlic mixture into the vegetables.
Add the scallion greens and shrimp and toss to combine.
Whisk the sauce to recombine and add it to the skillet.
Note: You may have more sauce than you will actually need – I add just enough sauce to completely coat the shrimp and vegetables well – this is a personal preference as I like my stir fry to be well sauced so that the rice can absorb some of the sauce when serving.
Remove the pan from the heat and toss until all ingredients are well coated with sauce and sizzling hot.
Serve immediately over steamed rice
For Sweet and Sour Sauce:
Combine all the ingredients in a small bowl and set aside