@tanguatlay,
1. Do you mind if I ask you what do you write for a living?
2. Do you mind if I ask what you write for a living?
Both are correct, Ms Tan. The normal neutral is #2, without the second 'do' as it's not needed to mark a question, the first 'do' does that.
But we
do sometimes
use the style in #1 just as we sometimes use 'do' with a verb as I've done here with 'do' and 'use'.
Number 1 is kinda like this;
Do you mind if I ask you ... what do you write for a living?