Prepare and test your skills

Prepare and test your skills

Free sample question with answers and detailed explanation below. The Professional Cloud Developer practice bank has an additional 608 practice questions.Try 10 free realistic questions: instant score, no credit card, and no account required.
You are developing a Python microservice for Cloud Run that validates incoming order payloads from Pub/Sub and writes records to Firestore. To speed up development, you use an AI coding assistant to generate a suite of pytest unit tests.
When you review the generated test suite, you observe the following:
How should you evaluate and refine the AI-generated unit tests to ensure accurate and complete test coverage?
Linting and static analysis (such as flake8, pylint, or mypy) check code formatting, syntax validity, and type consistency. Using an LLM prompt to judge test adequacy attempts to delegate quality verification to a probabilistic model rather than deterministic checks.
The task were to enforce code style compliance and syntax checks as a preliminary CI gate before running deterministic unit tests, rather than validating and refining missing test logic.
Auditing and manual refinement is the practice of treating AI-generated unit tests as an initial draft that must be verified for accuracy, intent alignment, and completeness before being accepted into a codebase. While AI coding assistants excel at generating boilerplate test scaffolding and standard positive paths, human developers must validate that assertions actually test the intended business rules.
unittest.mock) to raise transient Google Cloud exceptions (e.g., ServiceUnavailable or DeadlineExceeded) verifies that retry, dead-letter, or error-logging paths execute properly.Generative AI models frequently underrepresent rare edge cases and complex failure modes because those scenarios appear less often in training data. Combining AI-accelerated test scaffolding with targeted human review and manual refinement delivers both high developer velocity and rigorous, production-grade unit test coverage.
Relying solely on production monitoring shifts defect detection from the pre-merge development phase to live runtime operations. Cloud Monitoring is designed to track operational health metrics—such as request latency, HTTP 5xx error rates, and container resource utilization—on deployed Cloud Run services.
The goal were to establish production observability and alerting thresholds for an already thoroughly tested microservice, rather than evaluating and refining incomplete AI-generated unit tests during development.
Repeatedly regenerating tests to chase a 100% line coverage metric relies entirely on automated code generation without human inspection. Increasing model randomness (temperature) produces more varied outputs, which an automated coverage tool can measure by counting executed lines of source code.
assert result is not None.quantity == 0), and transient error retries.You were using an AI assistant to brainstorm candidate test scenarios that a developer then manually reviews, validates, and refines before committing to the repository.
Answer them yourself and get your score the moment you finish. No account needed.
Full access includes
Keep the momentum going with these hand-picked practice scenarios
Last updated Validated