How do the experimenters ensure that the interference pattern produced in the double slit experiment is not due to the interaction of the atoms at the boundary of the slit and the particle (photon/electron) undergoing the experiment?
Interactions at the slit (inelastic scattering) break the coherence between the two paths so that there is no interference.
This has been experimentally shown recently: https://www.researchgate.net/publication/273580024_Elastic_and_inelastic_electrons_in_the_double-slit_experiment_A_variant_of_Feynman%27s_which-way_set-up.
The slit material is very thin as a first step to minimize interactions. Also if the slit becomes too narrow we do get a strong interaction .. either absorption or reflection and there is no pattern.
You can think of the DSE as a 2 step process:
diffraction - the photon passes close to the material and the path is altered much the same as a scattering event. This means the travelling EM field of the photon had to modify itself to get past the material in the slit, then after the slit the EM field of the photon reforms to its original shape but the path or direction has a more random nature.
the DSE involves quite tight geometry constraints on the photon paths, so much so that certain paths are ideal (wavelength and path length are related) and some paths not ideal. In the DSE there are no photons in the dark bands, the bright ands get them all!