We discuss the properties of the residence time in presence of moving defects or obstacles for a particle performing a one dimensional random walk. More precisely, for a particle conditioned to exit through the right endpoint, we measure the typical time needed to cross the entire lattice in presence of defects. We find explicit formulae for the residence time and discuss several models of moving obstacles. The presence of a stochastic updating rule for the motion of the obstacle smoothens the local residence time profiles found in the case of a static obstacle. We finally discuss connections with applicative problems, such as the pedestrian motion in presence of queues and the residence time of water flows in runoff ponds.