GCP Generative AI Leader Practice Question 93: Code Generation Use Case
Google Cloud Generative AI Leader · Test 10 · question 3 of 10
An engineering director wants developers to describe a function in plain English inside their editor and have the assistant write the boilerplate code, generate matching unit tests, and explain unfamiliar code left behind by a former teammate. Which gen AI use case category does this describe?
Show answer and explanation
Answer:
Writing functions from a natural-language description, generating unit tests, and explaining existing code are all code generation tasks. Foundation models trained on large code corpora, such as those behind Gemini Code Assist, can turn a plain-English request into working code, summarize what an unfamiliar block does, and produce tests alongside it.
Option B is wrong because summarization shortens existing text; it does not produce new code. Option C is wrong because personalization tailors output to an individual's preferences or history, which is not what the director described. Option D is wrong because image generation produces pictures, not source code, from a text prompt.
Reference: Write code with Gemini Code Assist