Fill a large pot with water and bring to a boil. Add the pasta and cook until al dente (tender), about 10-12 minutes, or according to the package directions.
While the pasta is cooking, heat the olive oil over medium heat in a large saucepan. Add the shrimp and cook for about 3 minutes. Turn the shrimp and cook until pink and opaque throughout, about 2 minutes longer. Transfer to a bowl and keep warm.
Add the garlic and shallots to the saucepan and cook until fragrant, about 10 seconds. Add the lemon juice, brandy or sherry (if desired), parsley, salt, and pepper. Remove the saucepan from the heat and add the margarine and cooked shrimp. Toss to coat with the sauce.
Divide the pasta among warmed individual bowls. Top each serving with shrimp sauce and serve immediately.