Remember that manager who asked:
— Hey Adrian, we have this thing the client wants. How long do you think it would take?
— I don't know. I'd have to think about it.
— Off the top of your head. Give me a number. We'll discuss it later.
— I think it would take 4 days, max.
You know that's the end of the discussion. Your only "later" discussion will be about the 2 weeks you spent on that task and how much longer do you think it would take. You were right to "think about it". Always "think about it". Knee-jerk reactions are not valuable, they are actually detrimental to your work from that oint on.
When we are asked for our "best guess" our brains start cycling through "QUICK, QUICK, QUICK". And then we give a shitty answer and we're done for the day.
The pressure is even bigger if you're seen as an expert / specialist in your field. People expect you to solve complex problems in your head, on the spot. It's like they expect you to solve problems without thinking. Although your experience could be, and should be vast, this doesn't mean that all situations are the same.
Maybe there are variables you need to take into account.
Maybe there's something specific you need to be aware of.
The accidental complication — a term I found while reading NoEstimates by Vasco Duarte — can have a huge impact on the outcome of a specific task / user story.
In a nutshell, accidental complication stems from our organizational defficiencies — how long it takes to get approval for a new environment — and from how software is written — technical debt or architectural errors that require us to rewrite an existing piece of functionality to fit our new feature.
The fact that you worked on a similar feature in the past, doesn't guarantee that a similar feature will take the same amount of time.
Take into account that the technical debt you had when implementing feature A is not the same you have now.
Maybe the team is not the same.
Be mindful that you might not be the one implementing the feature. Better yet, if you are not very invested in the project, just say that you cannot estimate and point to a different person. This way you avoid people hating you because they got a time commitment on their head they did not ask for / anticipate.
It's not bad, nor shameful to say: "I don't know." or "I need to think about it". As a manager, you should view this as a sign of courage not one of lack of commitment.