The given question and answer are in the past tense because the answer explains why the person didn't go in the past.
Option A - 'Do' is used in the present tense. Thus option A is incorrect.
Option B - 'Will' is used in the future tense. Thus option B is incorrect.
Option C - 'Did' is in past tense, but it is incorrect because it doesn't match the response to the question. If the person had no time, why would he go to the market? That's why 'did' can't be used here. Thus option C is incorrect.
Option D - 'Didn't' is correct as the person asks why the other didn't go to the market, also it matches with the response. However, we can't use 'hadn't' as the sentence is already a negative sentence. Thus option D is incorrect.
Option E - 'Why didn't you go to the market?' is in the past tense and is grammatically correct. Also, we can use 'had' here as it is in the past tense and a positive helping verb can be used in the negative sentence. Thus option E is the correct answer.
"Why didn't you go to the market?"
"I had no time."