Melt the butter in a frying pan over a medium heat. Add the shallots and garlic, and cook for 3-4 minutes until softened but not coloured.
Add the walnuts and toast for 2 minutes. Remove from the heat.
Place a saucepan of water over a high heat and bring to a boil. Add the green beans and cook for 5 minutes, until just cooked and tender.
Drain the beans and tip them directly into the shallot pan, tossing in the buttery sauce. Season and add a squeeze of lemon. Tip onto a serving platter and top with the grated Cheddar.