The answer is a feature mismatch between the model’s training input and the prediction request. This 400 error occurs because Vertex AI Prediction validates the instance structure against the model’s saved signature; when the model was trained on exactly two features but the request provides three, the service rejects it as an invalid input shape mismatch. On the Google Professional Machine Learning Engineer exam, this scenario tests your understanding of how Vertex AI enforces schema consistency during online predictions—a common trap is assuming the error stems from data type issues rather than feature count. Remember that a 400 error almost always points to a malformed request, not a model or infrastructure problem. Memory tip: “Two trained, three sent? 400 is what you get.”
PMLE Serving and scaling models Practice Question
This PMLE practice question tests your understanding of serving and scaling models. Read the scenario carefully and evaluate each option against the stated constraints before committing to an answer. After answering, compare your reasoning against the explanation and wrong-answer breakdown below. Once you have made your selection, read the full explanation to reinforce the concept and understand why each distractor is designed to mislead on exam day.
Exhibit
Refer to the exhibit.
```
$ curl -X POST -H "Content-Type: application/json" -d '{"instances": [[1.0, 2.0, 3.0]]}' https://us-central1-aiplatform.googleapis.com/v1/projects/my-project/locations/us-central1/endpoints/123456:predict
{
"error": {
"code": 400,
"message": "Prediction failed: exception during prediction: RuntimeError: Model input shape mismatch. Expected shape (None, 2) but received shape (1, 3)."
}
}
A data scientist deployed a model to Vertex AI Prediction. When making a prediction request as shown in the exhibit, they receive a 400 error. What is the most likely cause?
Clue words in this question
Noticing these words before you look at the options changes how you read each choice.
Clue: "most likely"
Why it matters: Probability qualifier — the question wants the most probable cause or outcome, not a guaranteed one. Eliminate low-probability options.
Answer the question above first, then reveal the full breakdown to understand why each option is right or wrong.
Correct answer & explanation
✓
The model was trained on 2 features, but the request provides 3 features.
The 400 error indicates a malformed request, typically due to a mismatch between the input features the model expects and what is provided. Since the model was trained on 2 features but the request includes 3 features, Vertex AI rejects the prediction as invalid input shape mismatch. This is the most common cause of 400 errors in Vertex AI Prediction when the instance structure does not match the model's signature.
Key principle: Answer the scenario, not the keyword: identify the specific constraint before choosing the most familiar-sounding option.
Answer analysis
Option-by-option breakdown
For each option: why learners choose it and why it is or isn't the right answer here.
✗
The request JSON is malformed due to a missing comma between instances.
Why it's wrong here
The JSON is valid; the error is about shape mismatch, not parsing.
✓
The model was trained on 2 features, but the request provides 3 features.
Why this is correct
The error indicates the model expects 2 features per instance, but the request provides 3.
Clue confirmation
The clue word "most likely" in the question point toward this answer.
Related concept
Read the scenario before looking for a memorised answer.
✗
The endpoint path is incorrect; it should include the model version.
Why it's wrong here
The endpoint path is correct; the error is a prediction failure, not a routing error.
✗
The request is sending 3 separate instances but the model expects only 1.
Why it's wrong here
The request sends one instance with 3 features, not 3 instances. The error says shape (1,3) vs expected (None,2).
Common exam traps
Common exam trap: answer the scenario, not the keyword
The trap here is that candidates confuse a 400 error with a routing or versioning issue (Option C) or assume JSON syntax errors (Option A), but the real cause is a feature count mismatch, which is a common pitfall when deploying models with different training and serving data schemas.
Detailed technical explanation
How to think about this question
Vertex AI Prediction uses the model's signature (defined during training, e.g., via TensorFlow SavedModel or XGBoost) to validate input shapes. The 'instances' field in the JSON request must match the model's expected feature count and data types; a mismatch triggers a 400 error with details like 'Input tensor shape does not match'. In production, this often occurs when feature engineering pipelines drift between training and serving, or when one-hot encoding expands feature dimensions unexpectedly.
KKey Concepts to Remember
Read the scenario before looking for a memorised answer.
Find the constraint that changes the correct option.
Eliminate answers that are true in general but not in this case.
TExam Day Tips
→Watch for words such as best, first, most likely and least administrative effort.
→Review why wrong options are wrong, not only why the correct option is correct.
Key takeaway
Answer the scenario, not the keyword: identify the specific constraint before choosing the most familiar-sounding option.
Real-world example
How this comes up in practice
A cloud solutions architect for a retail company is evaluating services for a new workload. The correct answer here reflects best practice for the specific scenario described — not a general cloud recommendation. Answer the scenario, not the keyword: identify the specific constraint before choosing the most familiar-sounding option. Cloud exam questions reward reading the constraint carefully: the same technology can be right or wrong depending on the use case.
What to study next
Got this wrong? Here's your next step.
Identify which exam domain this question belongs to, review the core concept, then practise similar questions from the same domain.
Serving and scaling models — This question tests Serving and scaling models — Read the scenario before looking for a memorised answer..
What is the correct answer to this question?
The correct answer is: The model was trained on 2 features, but the request provides 3 features. — The 400 error indicates a malformed request, typically due to a mismatch between the input features the model expects and what is provided. Since the model was trained on 2 features but the request includes 3 features, Vertex AI rejects the prediction as invalid input shape mismatch. This is the most common cause of 400 errors in Vertex AI Prediction when the instance structure does not match the model's signature.
What should I do if I get this PMLE question wrong?
Identify which exam domain this question belongs to, review the core concept, then practise similar questions from the same domain.
Are there clue words in this question I should notice?
Yes — watch for: "most likely". Probability qualifier — the question wants the most probable cause or outcome, not a guaranteed one. Eliminate low-probability options.
What is the key concept behind this question?
Read the scenario before looking for a memorised answer.
About these practice questions
Courseiva creates original exam-style practice questions with explanations and wrong-answer analysis. It does not publish real exam questions, exam dumps, or protected exam content. Learn why practice questions differ from exam dumps →
Share a tip, memory trick, or ask about the reasoning behind this question. Do not post real exam questions, leaked content, braindumps, or copyrighted exam material. Comments are moderated and may be removed without notice.
This PMLE practice question is part of Courseiva's free Google Cloud certification practice question bank. Courseiva provides original exam-style practice questions with explanations, topic-based practice, mock exams, readiness tracking, and study analytics to help learners prepare for the PMLE exam.
Question Discussion
Share a tip, memory trick, or ask about the reasoning behind this question. Do not post real exam questions, leaked content, braindumps, or copyrighted exam material. Comments are moderated and may be removed without notice.
Sign in to join the discussion.