#1 India's Top IT Training Institute

×

About Uncodemy

Know more about who we are and what we stand for.

About Us

About Us

Discover our mission to equip individuals with essential IT skills and industry expertise.

Read More →
UnCodeMy Gallery

UnCodeMy Gallery

Explore highlights from our IT training sessions and success stories.

Read More →
×

Free Resources

Learn, practice and plan your career — bilkul free.

Tutorials

Tutorials

Step-by-step written tutorials to learn any technology at your own pace.

Read More →
Free Counselling

Free Counselling

Book a free video counselling session and pick the right course for you.

Read More →
Online Compiler

Online Compiler

Write, run and test your code online — no setup required.

Read More →

Interview Insights · API Testing

Why Confidence Without APIs Skills Still Fails

Confidence gets you through the first two minutes of an API round. After that, the interviewer asks one level deeper, and confidence without the skill underneath starts to crack. Here is where it usually cracks, and what to learn so it does not.

Tracks
One Level Deeper · Live Interactive
Question
—
What the interviewer asks
Confident only
—
Answer with no depth
Skilled
—
Answer with depth
Claim→Probe→Depth→Verdict
Click a topic to see how a confident answer and a skilled answer differ once the interviewer asks one level deeper.

Home / Tutorials / Career Guides / Why Confidence Without APIs Skills Still Fails

Interview Insights · API Testing

Why Confidence Without APIs Skills Still Fails

STEP 1STEP 2STEP 3STEP 4ClaimTested REST APIswith PostmanResumeProbeWhat did youassert on?QuestionDepthCodes, schema,auth, edge casesTestVerdictSkill shownor notDecision
Most API rounds follow the same path: a claim from the resume, a probing question, a depth check on specifics, and a verdict based on the depth, not the tone.

Quick summary — API skills

Interviewers enjoy confident candidates, but they hire the ones whose confidence survives the second question. A confident candidate says 'I have tested many REST APIs' clearly and with a smile. That is a good start. Then I ask what they checked apart from the status code, or what 401 and 403 mean, or how they handled an expiring token. If the skill is missing, the confidence turns into vague phrases. The fix is not to sound less confident. It is to build depth in the handful of API topics every interviewer probes.

In this guide you will learn:

  1. Why API rounds go one level deeper almost immediately
  2. Status code pairs interviewers use to test real understanding
  3. HTTP method behaviour including PUT, PATCH and idempotency
  4. Authentication flows and how tests should handle tokens
  5. Working REST Assured code that shows depth in a few lines

SECTION 01Status codes: where confident answers break first

Almost every API candidate knows 200, 404 and 500. That is why interviewers do not ask about them. They ask about pairs that sound similar but mean different things: 401 and 403, 400 and 422, 200 and 201, 500 and 503. A confident candidate who has only memorised the common codes tends to say 'both are errors' or 'both mean success', which reveals the gap instantly.

The deeper skill is knowing what each code tells the client to do next. That is what makes a status code assertion meaningful in a test.

Code pairShallow answerCorrect distinctionWhat your test should check
401 vs 403Both are auth errors401: not authenticated. 403: authenticated but not allowedMissing token gives 401; valid user without role gives 403
200 vs 201Both mean success201 means a resource was created, often with a Location headerPOST create returns 201 and the new resource ID
400 vs 422Both are bad request400: malformed request. 422: well-formed but fails validation (API-dependent)Broken JSON vs invalid email in valid JSON
500 vs 503Both are server errors500: unexpected failure. 503: temporarily unavailable, may include Retry-AfterRetry logic only for 503, not for 500
Interviewer: What is the difference between 401 and 403?

Candidate: Both are authentication errors. 401 is
unauthorized and 403 is forbidden, so basically when
the user is not allowed.

Interviewer: So which one would you expect if I send
a valid token for a user who is not an admin, to an
admin-only endpoint?

Candidate: ...401? Or maybe 403. It depends on the API.
AdminAccessTest.java

The second test is the interesting one. It proves the API knows who you are but refuses the action. A candidate who has written that test will never confuse 401 and 403 again, because they have seen both responses for themselves.

Key insight: When you study a status code, also learn the request that produces it in your test suite. Knowing how to trigger a code is the difference between memorising it and understanding it.

SECTION 02HTTP methods and idempotency: the follow-up nobody prepares

Candidates confidently say GET reads, POST creates, PUT updates and DELETE deletes. The follow-up is usually about behaviour: what happens if the same request is sent twice? That is idempotency. GET, PUT and DELETE are defined as idempotent, so repeating them should leave the server in the same state. POST is not, so two identical POSTs may create two records.

This matters in testing because retries, double clicks and network timeouts all cause repeated requests. A tester who understands idempotency writes tests for duplicates. A tester who does not is surprised by them in production.

MethodTypical useIdempotent?Test idea
GETRead a resourceYes (and safe)Repeated GETs return same data and change nothing
POSTCreate or trigger an actionNoSend the same order twice: are two orders created? Should they be?
PUTReplace a resource fullyYesSend same PUT twice: final state identical; missing fields may be cleared
PATCHUpdate part of a resourceNot guaranteedSend a PATCH and check untouched fields stay the same
@Test
void patchChangesOnlyOneField() {
  String id = createUser("Asha", "asha@example.test", "Pune");

  given().baseUri(BASE).auth().oauth2(adminToken)
    .contentType("application/json")
    .body("{\"city\": \"Noida\"}")
  .when().patch("/users/" + id)
  .then().statusCode(200);

  given().baseUri(BASE).auth().oauth2(adminToken)
  .when().get("/users/" + id)
  .then().statusCode(200)
    .body("city", equalTo("Noida"))
    .body("name", equalTo("Asha"))            // unchanged
    .body("email", equalTo("asha@example.test")); // unchanged
}
MethodBehaviourTest.java

Notice the comment at the end of the duplicate POST test. Idempotency keys are a design choice, not a rule of HTTP. Saying 'this depends on whether the API supports it' is a sign of real knowledge, not uncertainty.

Remember: When asked about a method, add one sentence about what happens if it is repeated. That single sentence moves your answer from definition to behaviour, which is what testers need.

SECTION 03Authentication: the topic that exposes copied frameworks

Many candidates use a framework where authentication is already handled by someone else's helper method. They are confident running tests, but cannot explain how the token is obtained, where it is stored or what happens when it expires. Interviewers know this, so they ask about it on purpose.

You do not need to be a security expert. You need to explain one auth flow you used, how your tests got a token, and how they would behave if the token became invalid during a run.

Auth typeHow it works in briefHow tests usually handle itInterview probe
API keyStatic key sent in a header or queryRead from environment variable, never hard-codedWhere do you keep the key in CI?
Basic authBase64 of username:password in a headerUse the tool's built-in basic auth helperIs Base64 encryption? (No, it is encoding)
Bearer token (OAuth2/JWT)Token from login or token endpoint, sent as Authorization headerFetch once per run, reuse, refresh on expiryWhat if the token expires mid-suite?
Session cookieServer sets a cookie after loginCapture the cookie and send it on later callsHow is this different from a bearer token?
import static io.restassured.RestAssured.given;

public class TokenHelper {

  private static String cached;

  public static synchronized String adminToken() {
    if (cached == null) {
      cached = given()
          .baseUri(System.getenv("API_BASE"))
          .contentType("application/x-www-form-urlencoded")
          .formParam("grant_type", "client_credentials")
          .formParam("client_id", System.getenv("CLIENT_ID"))
          .formParam("client_secret", System.getenv("CLIENT_SECRET"))
        .when().post("/oauth/token")
        .then().statusCode(200)
        .extract().path("access_token");
    }
    return cached;
  }

  public static synchronized void reset() {
    cached = null;   // call when a 401 shows the token expired
  }
}
TokenHelper.java

The phrase 'retries once, then fails' is important. Retrying forever hides real bugs. Interviewers listen for whether you understand that tests should handle expected situations but still report genuine failures.

Pro move: If your project's auth code was written by someone else, read it before your interview and explain it in your own words. Saying 'a senior wrote it, but here is how it works' is honest and strong.
How Uncodemy helps: If you want guided practice, Uncodemy's API Automation Testing Training Course (classroom and online, Noida) pairs live projects with mock interviews, so you learn APIs interview questions on work you actually built.

SECTION 04A depth check you can run on yourself

Use these three tabs to find where your confidence is ahead of your skill. Answer the self-test out loud, then use the practice plan and the answer frame to close the gaps you find.

Answer each aloud in under 30 seconds. No notes.

1. 401 vs 403, with a request that causes each.
2. 200 vs 201 vs 204: when does an API return each?
3. Which HTTP methods are idempotent? Why does it matter?
4. PUT vs PATCH: what happens to fields you leave out?
5. Where does your test suite get its auth token?
6. What happens if the token expires mid-run?
7. Apart from status code, name three things you
   assert on in a response.
8. How do you test that an API rejects invalid input?

Any answer starting with 'basically' or 'it depends'
with no follow-up: mark it as a gap.
api-depth-check.md

SECTION 05Habits that keep confidence and skill in step

Confidence is useful. These habits make sure it is backed by something an interviewer can verify.

  • Learn codes in pairs — Study 401 with 403, 400 with 422, 200 with 201. Pairs force you to understand the difference, not just the name.
  • Trigger every code yourself — For each status code you claim to know, have a saved request that produces it. You will remember the behaviour, not just the label.
  • Read the auth code in your project — Even if someone else wrote it, read it line by line until you can explain how tokens are fetched, stored and refreshed.
  • Assert beyond status — Practise checking body fields, headers, response time and schema. Interviewers often ask what else you validated.
  • Say 'it depends' with a reason — 'It depends on whether the API supports idempotency keys' is strong. 'It depends' with nothing after it is weak.
Pro tip: Before the interview, or before booking a mock round with an Uncodemy trainer, pick the three API topics you are least sure about and explain each to a friend who is not in IT. If you cannot make it simple, you do not understand it deeply enough yet.

SECTION 06Interview Q&A — API skills

Q1What is the difference between 401 and 403?

401 means the request is not authenticated, for example no token or an invalid one. 403 means the server knows who you are, but you do not have permission for that action. I test 401 by calling without a token and 403 by calling an admin endpoint with a normal user's valid token.

Q2What is idempotency in REST APIs?

An operation is idempotent if repeating it leaves the server in the same state as doing it once. GET, PUT and DELETE are idempotent by definition; POST is not. I test it by repeating requests and checking the final state, and for POST I check whether duplicates are prevented when the API supports idempotency keys.

Q3What is the difference between PUT and PATCH?

PUT replaces the whole resource with what you send, so fields you leave out may be cleared or reset. PATCH changes only the fields you send. My test sends a PATCH for one field, then does a GET to confirm the other fields are unchanged.

Q4How do you handle authentication in API automation?

I fetch a token once per run using a helper, with credentials from environment variables, and send it as a bearer token. If a call returns 401 due to expiry, the helper refreshes the token and retries once. A second failure fails the test, because it may be a real auth problem.

Q5What do you validate in an API response apart from the status code?

The response body fields and values, the data types and structure against a schema, important headers such as Content-Type or Location, error messages for negative cases, and response time against an agreed limit. For writes, I also check the state with a follow-up GET.

SECTION 07Test yourself — API skills quiz

Five questions. No sign-up.

0 / 5

Pick an answer to see why it is right or wrong.

SECTION 08Frequently asked questions

What API testing skills are asked in interviews?

Common topics include HTTP methods, status codes, request and response structure, authentication, assertions beyond status codes, schema validation, negative testing, chaining requests and an automation tool such as REST Assured, Postman or Python requests.

Is Postman enough for API testing jobs?

Postman is a good start and widely used, but many roles also expect code-based automation with a tool like REST Assured or Python requests, integrated into CI. Knowing the concepts deeply matters more than any single tool.

What is the difference between authentication and authorization?

Authentication checks who you are, for example with a token or password. Authorization checks what you are allowed to do. In APIs, failed authentication usually returns 401 and failed authorization usually returns 403.

How do I prepare for an API testing interview?

Learn status codes in pairs, understand idempotency and PUT versus PATCH, practise one authentication flow, and write small automated tests against a practice API. Then explain each concept aloud with an example test.

What is REST Assured used for?

REST Assured is a Java library for testing REST APIs. It lets you send requests and assert on status codes, headers and body values in a readable given-when-then style, and it works with test runners like JUnit or TestNG.

Where can I practise APIs interview questions with expert feedback?

Yes. Uncodemy's API Automation Testing Training Course in Noida (classroom and online) includes live projects, one-to-one mock interviews and resume reviews, so you practise APIs interview questions with trainer feedback before the real interview. You can book a free demo class from this page to see how the sessions work.

Classroom & online · Noida

Build API skills that survive follow-ups

Our API Automation Testing Training Course takes you from HTTP basics to REST Assured and Postman automation, with auth, schema validation and CI practice, plus mock rounds that probe your depth.

Talk to a counsellor for current fees
  • REST Assured & Postman
  • Auth and token handling
  • Schema & negative testing
  • Mock API interviews