0
0
Prompt Engineering / GenAIml~20 mins

GenAI applications (text, image, code, audio) - Practice Problems & Coding Challenges

Choose your learning style9 modes available
Challenge - 5 Problems
🎖️
GenAI Mastery Badge
Get all challenges correct to earn this badge!
Test your skills under time pressure!
🧠 Conceptual
intermediate
1:30remaining
Which GenAI application is best suited for generating realistic human speech?

Imagine you want to create a virtual assistant that talks like a real person. Which GenAI application would you choose?

AAn audio generation model that synthesizes speech.
BAn image generation model that creates photos.
CA text generation model that writes stories.
DA code generation model that writes software scripts.
Attempts:
2 left
💡 Hint

Think about which type of data sounds like human voice.

Predict Output
intermediate
2:00remaining
What is the output of this text generation code snippet?

Given the following code using a GenAI text model, what will be the output?

Prompt Engineering / GenAI
prompt = "Hello, how are you?"
response = genai_text_model.generate(prompt)
print(response)
ASyntaxError: missing parentheses in call to 'print'
B"Hello, how are you? I am fine, thank you!"
C"<image>"
D"def hello(): pass"
Attempts:
2 left
💡 Hint

The model continues the text prompt with a natural response.

Model Choice
advanced
1:30remaining
Which GenAI model type is most appropriate for creating detailed artwork from a text description?

You want to generate a detailed painting from a sentence like "A sunset over mountains." Which model type should you use?

AImage generation model
BText generation model
CAudio generation model
DCode generation model
Attempts:
2 left
💡 Hint

Think about which model creates pictures.

Metrics
advanced
2:00remaining
Which metric best evaluates the quality of generated code by a GenAI model?

You have a GenAI model that writes code. Which metric helps measure how well the generated code works?

AAccuracy of image classification
BWord error rate in speech recognition
CBLEU score comparing generated code to reference code
DMean squared error of audio signals
Attempts:
2 left
💡 Hint

Think about comparing generated text to a known correct version.

🔧 Debug
expert
2:30remaining
What error does this audio generation code produce?

Consider this code snippet for generating audio with a GenAI model. What error will it raise?

Prompt Engineering / GenAI
audio = genai_audio_model.generate(text_input='Hello world')
print(audio.shape)
ANo error, prints the shape of the audio tensor
BTypeError: unsupported operand type(s) for +: 'int' and 'str'
CValueError: invalid literal for int() with base 10
DAttributeError: 'NoneType' object has no attribute 'shape'
Attempts:
2 left
💡 Hint

Check if the generate method returns a valid audio object.