No, and don't accept an offer from this company.
There's an expression used when hiring people - "A" quality people hire "A" quality people, "B" quality people hire "C" quality people. The explanation behind this is that people who are really good want to keep learning and hire people they can learn from, while people who are insecure in their positions will pass on someone better then they are.
The interviewer wasn't looking to find out how good you were at the interview - he was looking to find out how good he was. He's not interested in hiring for diversity of thought, he's only interested in hiring people who think about problems and look at problems and solve problems exactly the same way he does, no better.
After an interview like this, if he recommends to hire you, it's only because he thinks you're worse then he is and you're walking into an already toxic work environment that allows people to rank themselves, and where the hierarchy clearly matters (or someone wouldn't be interviewing this way).
Interviews are a Two Way Street
This is not just about them getting to know you, this is about you getting to know them and finding out if this is a place you want to work. How they interview - and how they treat the answers you give them, speaks volumes about what's important at the company. From this interview, you can glean that outside of the box thinking probably isn't welcome.
Factor into this the interviewers position at the company. If this was the tech lead for the team you would be reporting to, you can expect any different in opinion to get squashed if you take this job. He's not looking for proposals or new ideas, just a code monkey to bang away slavish at the computer all day.
The Problem with Gotcha Questions
Most jobs (and you specifically mention Technology, and I've been in the technology field for almost 20 years and its especially true there) are entirely situational. You will find over the course of a career that people will use the same technology and the same tech stacks and they same tools in vastly different ways. Exposure to as many of these things as you can is key to a good career.
However, most interview questions are equally situational and based on the interviewers experience. (This is why I strongly recommend doing 'opposition research' on your interviewer if you are afforded the name and the time - understanding what their background is can help your interview prep to match their likely questions).
These sorts of situation questions are helpful ONLY If you're dealing with a rare, unique, and specific piece of (usually legacy) technology that a candidate has proposed to have a skillset in. Asking questions with only a single solution or with a loop hole that makes the question a trap doesn't help you evaluate how smart a candidate is. It's frustrating to the candidate, and it makes you come across as being extremely arrogant. It's literal gatekeeping in the IT industry.
If your response to this is "Everyone whose worked in tech should know that." you're part of the problem and so is whatever question you are asking. If you hear that at an interview it's a huge red flag.
Telegraphing Feelings at an Interview is a Bad Idea
When interviewing a candidate you should never provide any sort of feedback during the interview. It will alter the candidates state of mind and change how he responds to you. Interviewees who are nervous will have trouble answering questions, and if they think you are looking for a specific thing they will try to give you the answer they think you want to get the job. This is bad because it doesn't give you an opportunity to properly interview the candidate.
One of the most surefire ways to tell a Candidate how they are doing at an interview is to tell them what the 'right' (and I use this term loosely) answer is. Broadcasting to a candidate that they are unlikely to get the job will at best unconsciously cause them to do worse, and at worst intentionally cause them to check out. That someone would do this in an interview shows that they lack the sort of people skills necessary to be evaluating candidates to begin with.
What Should Have Happened
In this case, assuming your answer was technically correct (and perhaps the interviewer legitimately believed it was not) he should have followed up with more questions. "Why would you take that approach?" "What advantages does this solution bring that other solutions don't?" "What's a potential weakness of this approach?"
If indeed there is only one right answer, the answer should be presented instead of asked for and then the question should be posed as follows: "What problems do you see with this approach, and what approach would you take instead?"
However, as I mentioned previously, that requires a candidate to divorce themselves from their tricky 'gotcha' question that they came up with on their own and most people have a hard time doing that.
An Example, In Practice
Recently, during an interview process I asked someone a question (How would you rename a file in Git?). This question has many answers, and none of them are inherently right or wrong, but some have more benefits then others (Using the move command in Git preserves history attached to that file, versus renaming the file and recommitting it). This question was designed to tease out the skill level of someone interviewing at the company. An advanced user will understand the subtleties involved and someone at a more intermediate stage will not understand the disadvantage of the approach that they choose to take.
When the candidate answered with the 'wrong' (for the purposes of this conversation) answer, I then followed up with asking them about the pitfall of their solution as compared to the other one (In this case, "You would lose the file history if you did that, though. Wouldn't you?").
This doesn't tell them what the right answer is or that they necessary got it wrong, just expands the conversation to convey back to me how they think about the problem, which as other answers have better alluded to and explained, is the goal of the interview:
The purpose of an interview is to evaluate a candidates skill level to assess if they can perform the duties as described.
Gotcha Questions need not apply.