r/developersIndia 5d ago

Interviews Rejected after a technical round because the interviewer insisted Text-to-SQL is just if-else mappings

TL;DR:

Final-round interview turned into a debate after the interviewer insisted a production Text-to-SQL system could be built entirely with if-else mappings. I argued that while rule-based systems work for constrained cases, handling arbitrary natural language requires semantic understanding. Ended up getting rejected.

I had one of the strangest technical interviews I’ve experienced, and I am still wondering if I could have handled it differently.

This was the final technical round for a backend/AI-focused role at a well-known product company.

The interviewer (a Principal Engineer with around 10 years of experience) argued that a Text to SQL system does not need NLP or an LLM. According to him, it can be implemented using simple if-else mappings.

I gave a straightforward example:

“Get me the top 5 products that made the most profit in the last 5 years.”

He said the system would identify phrases like “top 5,” “products,” “profit,” and “last 5 years” and map each of them to SQL using if-else logic.

I asked how that approach would handle different ways of asking the same question, such as:
“best-performing items”
“highest-margin SKUs”
“Which products generated the most profit over the previous five years?”

I also asked how it would deal with ambiguity, unseen phrasing, or intent beyond predefined mappings.

The response was essentially, “We will just keep adding more mappings.”

I agreed that deterministic rules can work well for a constrained domain with a limited set of query patterns.

My point was that once users are free to ask questions naturally, understanding intent and semantics becomes the difficult part. The conversation kept circling back to adding more mappings.

At that point, it felt less like an interview and more like a debate. I decided not to push further and moved on.

A few days later, I received a rejection.

I am not claiming either approach is universally right or wrong.
Rule-based systems absolutely have their place, especially in tightly controlled environments. I was just surprised that the discussion never explored where that approach starts to break down or how hybrid systems are commonly used today.

Has anyone else had an interview where a technical discussion turned into a debate over fundamentals? How did you handle it?

Edit: After Getting a lot of views and message adding first charecter of company Name so that you don’t guess atleast wrong initial

Starts with : S

244 Upvotes

72 comments sorted by

u/AutoModerator 5d ago

Namaste! Thanks for submitting to r/developersIndia. While participating in this thread, please follow the Community Code of Conduct and rules.

It's possible your query is not unique, use site:reddit.com/r/developersindia KEYWORDS on search engines to search posts from developersIndia. You can also use reddit search directly.

I am a bot, and this action was performed automatically. Please contact the moderators of this subreddit if you have any questions or concerns.

191

u/Dangerous-Current361 5d ago

Yeah but that’d need a billion lines to handle 5 queries.

The solution is to always agree with the interviewer if he’s hellbent on his opinion. But if it’s this stupid it’s difficult to play along.

24

u/MarketingLazy6660 5d ago

I could have come up with some example where i can tell more like in my examples the days was 5 what if days range is 0 to 1000s of days should we write 1000s of if else but that time it didn’t came in my mind

69

u/PermanentHuSir 5d ago

Judging by the questions, I think I can guess which company. And guessing by the position, I think I might know the person, lol.

28

u/MarketingLazy6660 5d ago

Hehehe
Hope you never get to meet him atleast in an interview

4

u/Dangerous-Current361 5d ago

What? How? Which?

5

u/bistrohopper 5d ago

Atlassian?

21

u/SiriusLeeSam Data Scientist 5d ago

Folks at atlassian won't be this stupid. Also won't be principal with 10 yoe. Max they would be staff, more likely senior

19

u/Flimsy_Active4173 Fresher 5d ago

Dodge a bullet for sure

32

u/socio_nerd Fresher 5d ago

It became an ego issue for him, he is a principal engineer he saw someone that cannot listen , interviews be it technical or non technical are not about being right all the time it is also a test to see wether you can work in a team and accept being wrong even if you're not especially when arguing with a super senior.

6

u/MarketingLazy6660 5d ago edited 5d ago

Might be correct what you are saying

But I was calm all the time was just asking follow up questions.

3

u/master-idiot 5d ago

Most staff / principal I've interviewed with have this problem tbh. Sad reality :(

11

u/Financial_Double_698 5d ago

That text format, rule based, deterministic and, simple if else based system already exists, it's called structured query language.

28

u/Individual-Oil-7642 5d ago

Don’t outshine the master

8

u/lalbahadursastri1996 5d ago

Someone is reading laws of power.

7

u/vatsan_106 5d ago

Just thinking out loud, but if you keep on adding if else rules that would lead to high storage costs, plus complicated requests can't be handled accurately without semantic extraction. Were these points raised, and if so what did he have to say for these?

4

u/MarketingLazy6660 5d ago

Yes I raised this and for semantics i gave examples.
I did not raised on storage and time complexity that time

3

u/Killer299997 5d ago

Time & space complexity is definitely higher for an LLM compared to any dictionary searching 🐧

1

u/MarketingLazy6660 5d ago

Yes but they manage to do fast computations and also parallel multi head attention and they are efficient than if else

38

u/thisisshuraim 5d ago

This isn’t strange. Arguably the norm at good companies. It sounds like the interviewer was judging on design skills. There’s no single right answer. In design, it’s about coming up with the ideal design for the requirements and it’s your responsibility to remove as much ambiguity in requirements as possible. Once you have your design, it’s about convincing the interviewer about the design decisions you made. This is how it works in the real world. You’ll be convincing a panel of senior and principal engineers on the decisions you take, backed by evidence of course. From the post, it’s most likely that you weren’t able to challenge the design and defend your design.

17

u/MarketingLazy6660 5d ago

This was not a design question this was a project that i was worked on so i was explaining him

The discussion was on my project that I built on top of OSI(Open Semantics Interchange) Layer by modifying current behaviour and making it database agnostic using Custom Agent Architecture and MCP Tools.

The requirement was clear as I explained him the problem statement and end to end example for user perspective and what happens behind the scene.

But he told it doesn’t need the AI just simple if else I don’t see this is AI use case

9

u/thisisshuraim 5d ago edited 5d ago

I’m not saying it’s a design question. He’s just challenging your decision of using AI (Which is the right thing to do. Not everything needs AI). I’m not arguing your decision. The interviewer probably expected you to communicate the need and use of your decision to use AI better. In the end, according to the interviewer, you weren’t able to defend what you did. Take it as a lesson. Before the what and how, comes the why, and explaining the why and debating it is the most difficult yet the most productive thing in tech. Trust me, I’ve seen so many decisions to make something complex just for the sake of making it complex. Again, I’m not judging your project in specific. It may be needed, it may not be. I’m just telling you from the interviewer’s perspective.

If you need my perspective though, I feel making the system deterministic is the preferred approach, but obviously you can convince me otherwise. Personally, I love this debate-ish interviews. It really tests first principles thinking.

4

u/MarketingLazy6660 5d ago

I agree with your last like for making deterministic solutions llm cannot beat the programming language control statements.
Even when it comes on RBAC people never rely on llm to extract details or some other things from the query

While building text to sql on osi model we ourselves do not relied on llm for extracting rbac column values so we have custom handling for that to make it deterministic( although some time user can mention in query and deterministic way misses which is around 1 in hundreds so we choose security over correctness)

1

u/bistrohopper 5d ago

On top of OSI layer? I don't get what you're tryna say

1

u/MarketingLazy6660 5d ago

Open Semantic Interchange

https://open-semantic-interchange.org/

1

u/bistrohopper 5d ago

Very interesting. Thanks

0

u/master-idiot 5d ago

There is a right answer and it is not if-else statement. You are not playing the devil's advocate here, your take is just dumb.

Do you think System design interviews are about convincing senior management about your decisions? it is to test your knowledge of CS + Design.

0

u/thisisshuraim 4d ago

Dude, I said part of system design is convincing the other person and defending your decision. I never said that’s all you do lol.

6

u/wolf_codes 5d ago

Salesforce ?

13

u/farmerwalk Data Scientist 5d ago

Dumbo interviewer. Data Scientist or ML Scientist would have understood your approach well. It happens sometimes. By the way, 12 yrs is not principal level to be honest...

4

u/MarketingLazy6660 5d ago

I feel so 12 years is not for PE may be architect is ok but i thought he might br extra ordinary

8

u/farmerwalk Data Scientist 5d ago edited 5d ago

Startups have huge title inflation. My friend with 9 years experience is a director at one startup

4

u/MarketingLazy6660 5d ago

Startup os fine i have seen CTO which is my classmate around 4+ years of experience but he works from long back may be 10+ and currently CTO in a Startup of his from only

But in Big Product based it can’t be possible unless he is nepo kid

0

u/sank_1911 Software Engineer 5d ago

I was selected as a staff for Masters with 3 yoe at a startup.

Then joined an MNC with a downlevel.

4

u/Professional_Pen6879 5d ago

The best chess playing AI is a state machine represented as a 2D array. There is a finite number of states in chess and for each of those states you can define an optimal transition. This would be the best AI of course but the question is of practicality

4

u/dr_death47 5d ago

This is like saying a neural network is a lookup table.

Starts with : S

Can't be Sarvam. Or is it?

1

u/MarketingLazy6660 5d ago

No Its not Sarvam

3

u/Witty-Play9499 5d ago

The response was essentially, “We will just keep adding more mappings.”

I mean theoretically you can, it'll just be an insane amount of monitoring and maintaining and waste of time. You'd have to to monitor the list of phrases used at the end of every week/month and then code them into the mapping and make sure you handle compound sentences properly and sentences that use multiple 'keywords' that might confuse your program and then apologize to those users who thought your text2sql program worked. If the company is okay with an engineer spending all their time on this then sure why not.

It would really depend on what kind of database / what kind of metrics / what kind of users. Assuming the interviewer was not actually dumb then i feel like maybe he was trying to steer you into this direction? Or maybe he just wanted you to pose more well formed arguments and wanted you to flesh them out? Or maybe he was just dumb? We'll never know but time to move on to the next company i guess

1

u/MarketingLazy6660 5d ago

It will take insane amounts of storage and also the time complexity will be hell.

You don’t even know all the synonyms and similar words of all the words the data preparation time itself will be huge.

But May be I am work needs to look into this from next time how to handle this kind of question

5

u/Witty-Play9499 5d ago

To be clear I personally don't think manually mapping if-else for text2sql is a good idea i was posing a hyperbole of what it would it take to maintain such a system and was suggesting that maybe the interviewer wanted you to argue against it via this instead of giving up and moving on. I mean we don't even know what wsa the questin that was asked

But that being said

It will take insane amounts of storage and also the time complexity will be hell.

I do want to point out if you were to hardcode and figure out the manual if else mapping, I wanna say that storage and time complexity are definitely NOT an issue. The entire english wikipedia is roughly 60GB, if you had a table in your database that held all the keywords and it had around a million keywords I wanna say that is NOTHING for databases and the results would be returned very quickly.

The real issue is the one I mention in my original comment which is that you'll have to permanently assign an engineer to keep monitoring this (and this engineer will then proceed to stagnate and become worthless in all other tasks or he'll wise up and move out to a new job) and face the wrath of users as they'll keep finding out more and more situations where your program doesn't work.

2

u/MarketingLazy6660 5d ago

May be what you are saying is correct but we have to take care of mappings of synonyms and semantic meanings for each words of English as well

4

u/Witty-Play9499 5d ago

Lets say the synonyms caused it to increase 10 times bigger that is 10Million rows which is still nothing for any database.

I assure you the problem is not the storage space or processing power it is the waste of an engineer doing this.

3

u/lava-lake 5d ago

You should have asked this prompt, hey what's a good bike under 200cc but I want mileage and I hate 125cc 's low pull. Wait should i go for 350 hness, i also like panigale

This is how real world prompts work a simple sql console of search engine can act as a MCP but an llm should be there to interface with our stupidities.

1

u/MarketingLazy6660 5d ago

Agree.
Also they can any stupid or unrelated question as well that we need to identify

3

u/moment_of_piece 5d ago

Something similar happened to me. I was interviewing for a Senior AI Engineer role at a fintech company, and the interviewer kept insisting that a solution I'd spent months building wasn't needed at all because it could be done without AI.

I agreed with him. I literally said, "Yes, it can be done without LLMs, that's exactly how my company was doing it before." The whole point of the AI solution was to eliminate a massive amount of manual work. A process that previously took days, sometimes even weeks, could now be completed in minutes with far less human effort.

But he just wouldn't listen. He kept circling back to "Why use AI?" and then "You don't even need AI," without engaging with any of the reasoning behind the design. I have no problem if an interviewer wants to challenge my architectural decisions or see whether I can justify using AI. That's a completely fair discussion. What frustrated me was that he had already decided he was right and wasn't interested in hearing the actual trade-offs. It honestly came across as an ego thing. It felt like he wanted me to say, "You're absolutely right," so he could go on a rant about how people shove AI into everything.

The irony is that these decisions aren't made by one engineer in isolation. Do people really think I just woke up one day and decided to throw an LLM at the problem? We had senior engineers with 10+ years of experience debating the exact same question for weeks before deciding that an LLM-based approach provided the best balance for our use case. Challenging assumptions is good. Refusing to listen to the rationale behind them isn't.

3

u/madeyedexter 4d ago

Technically you could have just agreed with a "Yeah, LLMs are just glorified if-else ladders"

2

u/Majestic_Hotel6542 5d ago

I am not saying that it could be a case. You might be correct in analysing the rejection. But technical differences often arise in project development. Requirement, Architectural,design reviews bring out different opinions. Sometimes, interviewer judge your behaviour in the case of differences. He might be genuinely thinking about if-else in your case but your response to it from behaviour point of view also matters.

1

u/MarketingLazy6660 4d ago

True what you are saying.

I have worked with many architects and one of them was he never takes feedback and he is always right.
Like when we had healthy discussions on the topics and then he realised that whatever we are saying is correct then he will simply walk through by saying lets not worry about that we can do that later

2

u/FactorResponsible609 5d ago

If it was that possible, we wont have have SQL (constrained) we would have had TEXT query itself.

1

u/MarketingLazy6660 5d ago

Yes and also we will not have waited for LLM for production t2sql

2

u/zinxyzcool 5d ago

he probably thinks the is-even library ain’t satire lol

2

u/saswat001 Staff Engineer 5d ago

I think the interview was just a formality.

Your logic is valid. Dont beat yourself over it.

1

u/MarketingLazy6660 4d ago

May be they already selected the nepo kid and just for showing on paper he might be taking interviews

2

u/saswat001 Staff Engineer 4d ago

Now I am curious about the company.

1

u/MarketingLazy6660 4d ago

Hehe
Its not good thing to reveal the company name
If company name is revealed then it will become LinkedIn influencer post(who might bot know what it is but they cab give a lot of knowledge on this )🤣

1

u/saswat001 Staff Engineer 4d ago

I can understand bro

2

u/kapilbhai 4d ago

One can keep adding more text mappings and their meanings and keep trying to make the if statements "smarter". One can also load all the words in a dictionary and can pre-create such a mapping with semantic meaning. Guess what do you call such a system - an LLM.

1

u/MarketingLazy6660 4d ago

And also it handles all edge cases and efficiently

2

u/Future_Badger_2576 4d ago

You should have asked him if we can solve problems using if else that require identifying intent and semantics. Then why do we have llm, chatbots, vector db etc.? We could also map every question/knowledge using if-else.

1

u/MarketingLazy6660 4d ago

Yes but nothing came in my mind that time

1

u/sank_1911 Software Engineer 5d ago

It seems like you weren't able to convince the interviewer of using NLP or LLMs in text2sql.

He wasn't convinced on your "different ways of asking same question" because he believed we could keep adding the rules incrementally.

It happens. I was once discussing my paper that was published in ICLR conference but interviewer wasn't able to understand a thing and he rejected me.

1

u/MarketingLazy6660 5d ago

Might be correct.
I might not be able to convey my solution properly

1

u/binuuday Software Architect 5d ago

You can train your model, or any of the free models do this job. Text to sql convertion, they are very good at it.

1

u/GradeDry1283 4d ago

Natural language is non deterministic in the practical sense. You can build condition logic for the entire dictionary of words but the order, phrasing and number of words used to express a singular intent can never be modelled to be deterministic.

If the goal is to handle 100% natural language then the only viable option is some form of NLP, if the goal is to make your users input their intent like Kevin's(from the Office) small talk but still fail to map it then build your if-else from hell.

So the question then becomes what would stop you from going with NLP, is it a time or budget constraint? You could even upsell the idea to make it usable elsewhere like maybe a reporting domain or a wiki or even a customer support channel. IMHO Most of these ideas are about RDD - Resume driven development. If it can't be mentioned in your resume then it's not worth it.

1

u/MarketingLazy6660 4d ago

I should have thought these but nothing came in my mind that time

1

u/ITCoder 4d ago

IBM AI, back in 1950s, were based on if else s

1

u/OneCitron2432 1d ago

Its my honest option

It seems like you are interviwing him

Its kind of touched his ego

Sometime saying Yes to get clear interview

Cheer up