How many d-eletrons are in the outer shell of following compounds: How many d-electrons are in the outer shell of the metals in following compounds:

$\ce{ZnS}$ and $\ce{NiS}$

So sulphur does not has any $\ce{d}$ electrons and $\ce{Zn}$ has $10\ce{d}$ electrons.

But I am pretty sure that this question is more complex to answer like that.

What is considered as the outer shell? as $\ce{Zn}$ has the electrons in the $3\ce{d}$ shell but there is still a filled $4\ce{p}$ shell?

Does it also matter that it is a compound ? ($\ce{ZnS}$ not only $\ce{Zn}$). As I see no reason why they included $\ce{S}$ but I guess it has an important reason.

I am new to transition metals, any help would be really appreciated.
Sulfur does not have any "d" electrons as you said.

Before losing two electrons from the 4s sublevel, Zinc's outer sublevel is 4s (not 4p as you mentioned).  After those two electrons are lost, the outermost sublevel becomes the 3d sublevel which contains 10 electrons.  

Yes, it does matter whether the atom forms a compound or not, so we can understand where the electrons are allocated/transferred.

Here is the general rule for how to consider electrons in atoms.  Electrons fill up an atom via the Aufbau principle (image attached).  However, after filling, they arrange themselves in the energy according to the their principle quantum number (1, 2, 3,...) and their sublevel type (s, p, d, f).  For example, 4s fills before 3d in zinc, but after filling, 4s gains a higher energy than 3d.