L_{1 }= {d(s)mod a =x}

L_{2}={d(s)mod b =y}

L=L_{1}∩L_{2} or L_{1}∪L_{2} L will contain a*b number of states

DFA can easily be drawn like tale matrix of size 5*7 , where each row will corresponds to

d mod5=0 , d mod5=1 ,d mod5=2 , d mod 5=3 , d mod5=4

and every column will like wise d mod7=0 , d mod 7 =1,,,,,.........d mod 7 =6

Now you can easily check with this 5*7 matrix , which state will correspond to final state.

for such type of question , there is no need to make exact transitions , just we have to know , which state will correspond to what o/p.