All jobs / Backend developer / Security
Backend developer interview question · 0–1 years
The interviewer asks: “How do you put user input into SQL?” Strongest answer?
The strongest answer
Parameters / bind variables. The value never becomes SQL text. I never concatenate untrusted input into the statement.
Why it works
Exactly. Parameterised queries (and ORM bind) are the default in 2026. Concatenation is how you donate the database.
What a good answer covers
- Bind values; don't concatenate.
- Escaping is not a substitute.
- Integers aren't a free pass.
- String-built SQL with user text is unsafe.
Answers that fall short
- Close, but not the strongest: Escape quotes in the string, then concatenate.
Escaping is an arms race you will lose (encodings, comments, trailing backslashes). Parameters don't need a denylist. - Weak: Only concatenate integers — those can't inject.
Integers still become SQL if you concatenate. A crafted string in a “number” field, or a second parameter you forgot, and you're done. - Red flag: query("SELECT * FROM users WHERE name = '" + name + "'") — that's the obvious way to write SQL.
That pattern is SQL injection, textbook. It is not “obvious,” it is a red flag.
Who gets asked this
More Security questions
- The interviewer asks: “We set CORS to our frontend origin. Are we safe?” Strongest answer?
- The interviewer asks: “How do services get secrets in production?” Strongest answer?
- The interviewer asks: “What must never land in logs or traces?” Strongest answer?
- The interviewer asks: “A user asks us to delete their data. What does a backend actually do?” Strongest…
- The interviewer asks: “Threat-model this order service. Where do you start?” Strongest answer?
- The interviewer asks: “A customer requires their data stay in the EU. What do you actually implement?”…
- The interviewer asks: “The API pod's cloud role can read all buckets and impersonate other roles. What's…
- The interviewer asks: “Privacy by design — what does the backend actually ship?” Strongest answer?