If you format your phone with hard reset or through factory reset, that does not mean that some files has been removed from the phone memory.
Before you do hard resetting or factory reset, you will need a tool, like data eraser, like shreddit to first erase the data so that it will no longer be recoverable.
Do not see it surprising if a file you have deleted on your phone is recovered by special tools called data recovery tools unless you have deleted the data using data eraser, then reset your phone to become like new using hard reset or using factory setting.
Then what about when we take the phone for repair. What measure can we take because even if you are there to monitor the technician, you might not understand what he is doing. I'm talking from experience. I remember those time were SIM cards were left in a faulty phone with a technician and the SIM card gets missing either for fraud, like a post I saw yesterday about a governor's phone that was cloned and used to perpetrate fraud (soliciting for fund) until it cut the attention of the governor and a disclaimer was raised.