Bring a large pot of water to a boil for the green beans.
While the water heats, place a large frying pan or wok over medium-low heat.
Add the coconut and toast, stirring constantly, for 2-3 minutes until fragrant and golden brown. Immediately transfer to a plate to prevent burning and set aside.
Return the same pan to medium heat and add the oil.
Once hot, add the mustard seeds.
When they begin to pop, add the sliced shallots and cook for about 8 minutes, stirring occasionally, until soft and caramelized.
Add the cashews to the pan with the shallots and continue to fry for another 2-3 minutes until the cashews are golden.
Remove the pan from the heat.
Meanwhile, add the trimmed green beans to the boiling water and cook for 4 minutes until crisp-tender. They should still have a nice bite.
Drain them well.
Place the pan with the shallots and cashews back over high heat.
Add the drained green beans, tamarind paste, sliced chile, and salt.
Toss everything together for 1-2 minutes until sizzling and well-combined.
Stir in most of the toasted coconut.
Taste and adjust seasoning if needed.
Serve immediately, garnished with the remaining toasted coconut.