0
0
Prompt Engineering / GenAIml~20 mins

Content filtering in Prompt Engineering / GenAI - Practice Problems & Coding Challenges

Choose your learning style9 modes available
Challenge - 5 Problems
🎖️
Content Filtering Master
Get all challenges correct to earn this badge!
Test your skills under time pressure!
🧠 Conceptual
intermediate
2:00remaining
What is the main purpose of content filtering in AI?
Content filtering is used in AI systems to manage what kind of content is shown or blocked. What is the main goal of content filtering?
ATo prevent harmful or inappropriate content from being shown
BTo improve the speed of AI model training
CTo increase the size of the training dataset
DTo reduce the number of model parameters
Attempts:
2 left
💡 Hint
Think about why some AI systems block certain words or images.
Predict Output
intermediate
2:00remaining
What is the output of this content filtering code snippet?
Given the following Python code that filters out banned words from a list of messages, what is the output?
Prompt Engineering / GenAI
banned_words = {'bad', 'ugly'}
messages = ['This is good', 'This is bad', 'Ugly truth']
filtered = [msg for msg in messages if not any(word.lower() in banned_words for word in msg.split())]
print(filtered)
A['This is bad', 'Ugly truth']
B['This is good']
C['This is good', 'Ugly truth']
D['This is good', 'This is bad']
Attempts:
2 left
💡 Hint
Check which messages contain words in the banned_words set.
Model Choice
advanced
2:00remaining
Which model type is best suited for real-time content filtering in chat applications?
You want to filter harmful content in a chat app instantly as users type. Which AI model type is best for this task?
ALightweight rule-based model with keyword matching
BLarge batch-trained transformer model with high latency
CHeavy deep learning model requiring GPU inference
DOffline unsupervised clustering model
Attempts:
2 left
💡 Hint
Consider speed and resource use for real-time filtering.
Hyperparameter
advanced
2:00remaining
Which hyperparameter adjustment helps reduce false positives in a content filtering model?
You have a content filtering model that blocks too many safe messages (false positives). Which hyperparameter change can help reduce this?
ALower the classification threshold
BIncrease the learning rate
CIncrease the classification threshold
DDecrease the batch size
Attempts:
2 left
💡 Hint
Think about how threshold affects model sensitivity.
🔧 Debug
expert
2:00remaining
Why does this content filtering code fail to block the word 'Bad'?
Examine the code below. It should block messages containing the word 'bad' regardless of case, but it does not block 'Bad'. Why?
Prompt Engineering / GenAI
banned_words = {'bad'}
message = 'This is Bad'
if any(word.lower() in banned_words for word in message.split()):
    print('Blocked')
else:
    print('Allowed')
AThe any() function is used incorrectly
BThe banned_words set should include 'Bad' with uppercase B
CThe split() method does not split the message correctly
DThe code does not convert message words to lowercase before checking
Attempts:
2 left
💡 Hint
Check how case sensitivity affects membership tests.