Place the green beans on a large baking sheet and drizzle with olive oil. Add the garlic, shallot, and lemon juice. Toss, using tongs or clean hands, until beans are well coated. Make sure the beans are in an even layer and season with salt and black pepper.
Roast the green beans for 10-15 minutes, shaking the pan once halfway through, until the beans are tender, but still slightly crisp.
Remove from the oven and sprinkle beans with Parmesan cheese, if using. Serve warm.