Answering the question: Do you mind if...?
"Do you mind..." is a polite way of asking "Can you...." For this reason, it's usually acceptable to respond to the semantic intent of the question by answering "Yes (I can do that)", rather than responding to the grammatical form with "No (I don't mind)".
Native speakers sometimes get confused by this, too.
"Sure" isn't answering the question as asked; it's answering an implied question, namely: "is it OK with you if...".
"No, not at all" is answering the question, taken literally.
I'd rather try to circumvent the problem. How about something like this:
*"Do you mind if I open the window?" "Go on."
*"Do you mind if I take a piece of cake?" "Serve yourself."
In the first case it's useful to smile if you think it sounds rude.