Skip to main content
Published / updated

The Question Bank

Before you start

You need: a finished project. Every model answer here ends with evidence from your own work, and without that you are memorising — which is exactly what the follow-up question exposes.

Time: two to three hours to work through properly. Say each answer aloud before reading the model.

How to use this

Cover the answer. Say yours out loud. Then compare.

Reading the answers is close to useless. The gap between knowing something and being able to say it under pressure is the whole difficulty, and only speaking closes it.

Notice the shape of every model answer:

1. The direct answer, in one sentence
2. Why it is that way
3. Evidence from your project

Part 3 is what separates you. Every other candidate can say decimal is for money. Almost none can say "I hit this in my fee module — I can show you the two totals side by side."

Replace the project details with your own. Do not use these verbatim; an interviewer who has read this page will notice, and it is not yours anyway.

C# and .NET

Q: What is the difference between C# and .NET?

"C# is the language — the syntax I write. .NET is the platform: the compiler, the runtime that executes it, and the class library. VB.NET and F# also run on .NET, which is why the platform and the language have different names."

Q: Value types and reference types?

"A value type holds the data; a reference type holds an address. So assigning one int to another copies the value, but assigning one Student to another gives you two names for one object — change it through either and both see it. That caught me early: I assigned a Student to a second variable, changed the name, and the original changed too."

Q: Why is money decimal and not double?

"double stores base-2 fractions, and 0.1 has no exact base-2 representation — so 0.1 + 0.2 comes out as 0.30000000000000004. Summing a thousand fee payments drifts by paise. decimal is base-10 and sums exactly. I tested it in my fee module: a thousand payments as double and as decimal gave different totals. Every money field in my project is decimal, and DECIMAL(18,2) in SQL."

Q: First versus FirstOrDefault?

"First throws if nothing matches; FirstOrDefault returns null. I default to FirstOrDefault with a null check, because 'not found' is usually a normal outcome, not an exception. It also matters that First without an OrderBy returns an arbitrary row when several match — that caused a real bug in my project, which I can describe."

Q: What is a delegate?

"A variable that holds a method. Func<Student, bool> means 'takes a Student, returns a bool' — so I can pass a test into a method rather than writing a separate method per search. A lambda is just an unnamed way of writing one. It is also the whole mechanism behind LINQ: Where takes a delegate and applies it to each item."

Q: What does async/await actually improve?

"Not speed for a single call — the same file read takes the same time. It frees the thread while waiting, so the server can serve other requests instead of sitting blocked. In a console app you barely notice; in a Web API it is the difference between handling fifty concurrent requests and thousands."

Q: What happens if you forget await?

"Three things, all silent. The method returns before the work finishes, any exception inside it is discarded entirely, and the order of operations stops matching what the code reads like. It is only warning CS4014, so it compiles. I turned on treat-warnings-as-errors because of it."

SQL and databases

Q: Difference between INNER JOIN and LEFT JOIN?

"INNER returns only rows with a match on both sides; LEFT keeps every row from the left table and fills nulls where there is no match. It matters more than it sounds: my fee report used an inner join and silently dropped twenty students who had no fee account yet. I now compare the row count before and after every join — down means it dropped rows, up means it multiplied them."

Q: What is a primary key, and why a surrogate one?

"A primary key uniquely identifies a row. I use a surrogate identity column rather than a natural key like roll number, because natural keys change — a school can reissue or correct a roll number, and if it is the primary key that change cascades everywhere."

Q: How would you enforce that roll numbers are unique?

"A unique constraint — but composite, UNIQUE (SchoolId, RollNumber), not on RollNumber alone. The system is multi-tenant, and two schools may legitimately both issue NCA-2024-0012. A single-column constraint makes that impossible, and the failure looks like a bug in the second school's data entry."

Q: What does NULL do in a WHERE clause?

"Any comparison with NULL is unknown, not true — so WHERE MarksObtained <> 0 excludes null rows as well as zeros, which is rarely what you meant. You need IS NULL. This is directly why absent students are stored as NULL in my project rather than 0: AVG ignores nulls, so absentees are correctly excluded from the class average."

Q: What is a transaction, and what goes wrong with them?

"A set of statements that all succeed or all roll back. The mistake I had to fix was passing the transaction to the first command and not the second — so the second committed independently, and a rollback left the payment recorded with the balance unchanged. Nothing errors; the data is just inconsistent."

Q: How would you speed up a slow query?

"Read the execution plan first rather than guessing. A table scan on a large table usually means a missing index. But I would also check the query is sargable — WHERE YEAR(PaidOn) = 2024 cannot use an index; a date range can. And I compare logical reads rather than elapsed time, because elapsed time varies with cache and load."

ASP.NET Core and APIs

Q: What is dependency injection and why use it?

"The container supplies a class's dependencies rather than the class constructing them. It matters because my StudentService depends on IStudentRepository, not the SQL implementation — so I can test the service against an in-memory version with no database at all."

Q: Explain the middleware pipeline.

"Each middleware handles the request, calls the next, and can act on the way back. The order is behaviour, not style: UseAuthorization before UseAuthentication gives 401 on every request, and UseCors after UseAuthentication produces CORS errors only on authenticated calls. Neither produces a message naming the real cause — I hit the first one."

Q: 401 versus 403?

"401 means I do not know who you are — no token, or an expired one. 403 means I know who you are and you may not do this. A teacher getting 403 on the salary report is the system working correctly."

Q: How do you stop SQL injection?

"Parameters, always — never string concatenation. The visible symptom is that a name with an apostrophe, like O'Brien, breaks the query; the invisible one is that a crafted input runs whatever it likes. Every query in my project is parameterised, and I set parameter types explicitly rather than using AddWithValue, because a type mismatch also stops the index being used."

Q: How is multi-tenancy enforced in your project?

"SchoolId comes from the JWT claim, never from the request, and it is in the WHERE clause of every query. I can demonstrate it: sign in as School 1, request School 2's student from Postman, and you get nothing. That one is worth testing deliberately, because if you get it wrong the response is a 200 with someone else's data and nothing is logged."

Q: Why not return the entity directly from an endpoint?

"It exposes whatever the entity holds. Teacher carries Salary; Student carries the parent's phone number. I project into a DTO with only the fields that caller should see — and I check it by reading the raw JSON in the Network tab, not by looking at the UI."

Python

Q: List, tuple, set, dictionary — when each?

"List for an ordered collection that changes. Tuple when it must not change. Set for uniqueness and fast membership. Dictionary for lookup by key. In my project, students in a class are a list, roll numbers already issued are a set, and students indexed by roll number are a dictionary."

Q: What is the mutable default argument trap?

"def add(item, items=[]) creates the list once, at definition, and every call shares it — so data leaks between calls with no error. The fix is items=None and creating it inside. It is the Python trap I would warn a new team member about first."

Q: Why if marks is not None rather than if marks?

"Because 0 is falsy. if marks: treats a genuine zero as missing — the same absent-versus-zero problem as everywhere else. Anywhere zero is a real value, test for None explicitly."

Q: What is a virtual environment and why?

"An isolated set of packages per project, so two projects can need different versions of the same library without breaking each other. Related: the most common VS Code problem is having the wrong interpreter selected — the package is installed, VS Code is just looking elsewhere."

Git

Q: Difference between git fetch and git pull?

"pull is fetch followed by merge. I fetch first when I have uncommitted work, because then I can see what is coming with git log HEAD..origin/main before deciding — a pull can produce a conflict at a moment I did not choose."

Q: You committed a password. What do you do?

"Rotate the credential first — that is the only real fix. Deleting it in a later commit does not remove it from history; anyone who clones the repository still has it. Then remove it from the code, and add the file to .gitignore."

Q: How do you resolve a merge conflict?

"Read both sides and understand what each was trying to do, then write the correct combined code — usually keeping both. The dangerous resolution is taking one side wholesale, because nothing fails and a working feature quietly disappears. After resolving I search for leftover markers, then build and test both features."

AI — the questions most guides do not have

Q: Do you use AI to write code?

"Yes — for boilerplate and for explaining unfamiliar code. I review everything before it goes in. On this project the generated repository method took SchoolId from the request instead of the token, which would have let one school read another's students. I caught it because I check for that specifically. I keep a log; it happened four times in six months, always the same kinds of thing."

Q: How do you know generated code is correct?

"Compiling is not working. I check four things that produce no error when they are wrong: is SchoolId from the token, is the absent check before the marks check, is money decimal, and does every command inside a transaction receive it. Then I run it against real data — including the awkward cases."

Q: Doesn't AI make developers unnecessary?

"It made boilerplate cheap, so writing CRUD is worth less than it was. It did not remove the need for someone to decide what correct means. A model will happily generate grading logic that marks an absent student as Fail, because it does not know that absences are stored as NULL in our schema. Someone has to know that and check for it."

Q: Tell me about the AI feature in your project.

"It drafts a report-card comment from a student's marks, which the teacher then edits before saving. It is an API call to a language model, not machine learning — I want to be clear about that. Two decisions worth mentioning: I send marks and a subject but never a name or roll number, because that is regulated personal data and the comment is just as good without it. And the teacher edits it, so a person stays accountable — if a comment were inappropriate, 'the AI wrote it' is not something a school can tell a parent."

Q: What did you learn using AI over six months?

"That it is very good at explaining code and very unreliable about my code. It knows ASP.NET Core; it does not know our business rules unless I tell it. And the discipline that matters is being able to explain what I accepted — if I cannot, I have not learned it, and that shows up in a conversation like this one."

Behavioural

Q: Tell me about yourself. — 90 seconds.

"I finished my degree in [year] and spent six months building a full-stack school management system — ASP.NET Core, SQL Server and React. What I found most interesting was the debugging: I spent a full day on a bug where fee receipts showed a zero balance, and the cause was a student with two fee accounts and a query with no year filter. I am looking for a junior developer role where I can work on a real codebase with people who will review my work."

Q: What was the hardest problem you faced?

Use your real bug story from Article 10. Method, not luck.

Q: What do you do when you are stuck?

"I try to reproduce it reliably first, then narrow it down — check the browser, then the API log, then the SQL, rather than reading code hoping to spot it. If I am still stuck after about two hours I ask, and I bring what I have ruled out so it is a short conversation rather than someone starting from nothing."

Q: Where do you see yourself in three years?

"Solid as a developer — trusted with a feature end to end and reviewing other people's code. I am not trying to skip that; I would rather be genuinely good at the fundamentals first."

Q: Do you have any questions for us? — Always yes.

"What does the first month look like for a fresher here?" "How does code review work on your team?" "What is the codebase like — mostly new, or is there older code to maintain?" "What would make you glad you hired me, six months in?"

Common mistakes

  • Reading the answers instead of saying them aloud
  • Memorising these word for word, including the project details
  • Giving the definition and stopping, with no evidence
  • Claiming to have built a model when you called an API
  • Bluffing on a topic you have not used
  • No questions at the end
  • Talking for five minutes on "tell me about yourself"
  • Saying you never get stuck

Practice

  1. Cover every answer. Say yours aloud. Compare. Mark the ones you could not do.
  2. Rewrite each model answer with evidence from your project.
  3. Record yourself answering ten questions. Listen back — it is uncomfortable and useful.
  4. Have someone non-technical ask you five. If they cannot follow, simplify.
  5. For every question you failed, go back to the track that teaches it.
  6. Write your 90-second introduction and rehearse it.
  7. Write your four questions for them.
  8. Practise the four AI answers specifically — most candidates have not thought about them.

You can now

  • Answer the common fresher questions aloud, not just recognise them
  • End each answer with evidence from your own project
  • Answer the AI questions honestly and specifically
  • Give a 90-second introduction
  • Ask good questions at the end
  • Identify which track to revisit for anything you could not answer

Next: Mock interview rounds