Docsity

PrepIQ Unity Ads Certified User Programmer Ultimate Exam, Exams of Technology

Toggle sidebar
bg1
PrepIQ Unity Ads Certified User Programmer
Ultimate Exam
**Question 1.** Which Unity Ads method should you call to initialize the SDK
before loading any ads?
A) Advertisement.Start()
B) Advertisement.Initialize()
C) Advertisement.Load()
D) Advertisement.Show()
Answer: B
Explanation: Advertisement.Initialize(string gameId, bool testMode) must be
called first to set up the SDK with the correct Game ID and test mode flag.
**Question 2.** When a null reference exception occurs on the line
`myAd.Show();`, which of the following is the most likely cause?
A) The Advertisement package is not installed.
B) `myAd` was never assigned a value.
C) The ad placement is disabled in the dashboard.
D) The device is offline.
Answer: B
Explanation: A NullReferenceException indicates that `myAd` is null because
it was not instantiated or assigned before calling Show().
**Question 3.** Which debug log level is appropriate for printing a message
that should appear only when testing ad integration?
A) LogError
B) LogWarning
C) Log
D) LogException
Answer: C
Explanation: Debug.Log outputs a standard informational message, suitable
for test-only output. Errors and warnings are reserved for actual problems.
pf3
pf4
pf5
pf8
pf9
pfa
pfd
pfe
pff
pf12
pf13
pf14
pf15
pf16
pf17
pf18
pf19
pf1a
pf1b
pf1c
pf1d
pf1e
pf1f
pf20
pf21
pf22
pf23
pf24
pf25
pf26
pf27
pf28
pf29
pf2a
pf2b
pf2c
pf2d
pf2e
pf2f
pf30
pf31
pf32
pf33
pf34
pf35
pf36
pf37
pf38
pf39
pf3a
pf3b
pf3c
pf3d
pf3e
pf3f
pf40
pf41
pf42
pf43
pf44
pf45
pf46
pf47
pf48
pf49
pf4a
pf4b
pf4c
pf4d
pf4e
pf4f
pf50

Partial preview of the text

Download PrepIQ Unity Ads Certified User Programmer Ultimate Exam and more Exams Technology in PDF only on Docsity!

Ultimate Exam

Question 1. Which Unity Ads method should you call to initialize the SDK before loading any ads? A) Advertisement.Start() B) Advertisement.Initialize() C) Advertisement.Load() D) Advertisement.Show() Answer: B Explanation: Advertisement.Initialize(string gameId, bool testMode) must be called first to set up the SDK with the correct Game ID and test mode flag. Question 2. When a null reference exception occurs on the line myAd.Show();, which of the following is the most likely cause? A) The Advertisement package is not installed. B) myAd was never assigned a value. C) The ad placement is disabled in the dashboard. D) The device is offline. Answer: B Explanation: A NullReferenceException indicates that myAd is null because it was not instantiated or assigned before calling Show(). Question 3. Which debug log level is appropriate for printing a message that should appear only when testing ad integration? A) LogError B) LogWarning C) Log D) LogException Answer: C Explanation: Debug.Log outputs a standard informational message, suitable for test-only output. Errors and warnings are reserved for actual problems.

Ultimate Exam

Question 4. To listen for the event when a rewarded video finishes, you should implement which interface? A) IUnityAdsListener B) IUnityAdsInitializationListener C) IUnityAdsLoadListener D) IUnityAdsShowListener Answer: D Explanation: IUnityAdsShowListener includes OnUnityAdsShowComplete, which is invoked when a rewarded video finishes playing. Question 5. Which of the following statements about the static keyword in Unity C# scripts is FALSE? A) A static field is shared across all instances of the class. B) Static methods can be called without an object reference. C) Static fields are serialized and visible in the Inspector. D) Static members cannot access instance members directly. Answer: C Explanation: Unity does not serialize static fields, so they are not shown in the Inspector. Question 6. In Unity Ads, what does the placement ID "rewardedVideo" typically represent? A) A banner ad at the top of the screen. B) An interstitial ad shown between levels. C) A rewarded video that grants in-game currency. D) A native ad integrated into the UI. Answer: C Explanation: The default placement ID for rewarded video ads is "rewardedVideo". Question 7. Which of the following code snippets correctly checks whether an ad is ready to be shown for placement "interstitial"?

Ultimate Exam

C) Queue D) HashSet Answer: B Explanation: A List maintains an ordered collection of placement IDs and allows easy iteration for preloading. Question 11. Which attribute must be added to a method to expose it as a Unity Ads callback for initialization events? A) [Initialize] B) [UnityAdsInitializationListener] C) [RuntimeInitializeOnLoadMethod] D) No attribute; you must implement IUnityAdsInitializationListener. Answer: D Explanation: Unity Ads uses the interface IUnityAdsInitializationListener; no special attribute is required. Question 12. What is the default behavior of Advertisement.Show() when called without specifying a placement ID? A) It shows the first loaded placement. B) It throws an ArgumentException. C) It shows a banner ad. D) It does nothing. Answer: B Explanation: The overload without a placement ID requires a string argument; calling it without one results in a compile-time error. Question 13. Which line correctly adds a listener to the Advertisement class that will receive all ad events? A) Advertisement.AddListener(this); B) Advertisement.RegisterListener(this); C) Advertisement.SetListener(this); D) Advertisement.OnEvent += this;

Ultimate Exam

Answer: A Explanation: Advertisement.AddListener registers an object that implements IUnityAdsListener. Question 14. When you need to test ads on a device without affecting production revenue, which parameter should you set to true? A) testMode in Advertisement.Initialize B) debugMode in Advertisement.Show C) isTest in IUnityAdsLoadListener D) enableLogging in UnityAdsSettings Answer: A Explanation: Passing true for the testMode argument during initialization ensures that test ads are served. Question 15. Which UnityAdsError value indicates that the requested ad placement does not exist in the dashboard? A) NOT_INITIALIZED B) SHOW_ERROR C) INVALID_ARGUMENT D) NO_FILL Answer: C Explanation: INVALID_ARGUMENT is returned when a placement ID is invalid or not configured. Question 16. In a C# script, what is the effect of declaring a field as public static int score;? A) Each instance of the script has its own score value. B) The field can be edited in the Inspector. C) The value is shared across all instances and persists across scenes. D) Unity will automatically save the value between play sessions. Answer: C

Ultimate Exam

Explanation: Total Allocated Memory shows how much heap memory is being used; a steady increase indicates a leak. Question 20. In Unity Ads, what does the placementState property of PlacementContent indicate? A) Whether the ad is muted. B) The current load status (Ready, NotReady, etc.). C) The ad’s revenue value. D) The user’s reward amount. Answer: B Explanation: placementState returns an enum describing whether the placement is ready, loading, or not available. Question 21. Which of the following statements about Coroutines and Unity Ads is TRUE? A) Coroutines can replace all IUnityAdsShowListener callbacks. B) You can yield return Advertisement.Show() to pause execution until the ad finishes. C) Coroutines can be used to poll Advertisement.IsReady before showing an ad. D) Coroutines automatically handle ad initialization. Answer: C Explanation: A coroutine can repeatedly check Advertisement.IsReady and yield until true, then call Show. Question 22. To ensure that a dictionary of placement IDs to reward amounts is not modified at runtime, you should declare it as: A) public Dictionary rewards = new Dictionary(); B) private readonly Dictionary rewards = new Dictionary(); C) static Dictionary rewards; D) public static Dictionary rewards = new Dictionary();

Ultimate Exam

Answer: B Explanation: readonly prevents reassignment after construction, keeping the collection’s reference immutable (contents can still be changed, but the intent is to protect it). Question 23. Which line correctly disables Unity Ads for a specific platform build (e.g., Android) using pre-processor directives? A) #if UNITY_ANDROID Advertisement.Disable(); #endif B) #if !UNITY_ANDROID Advertisement.Disable(); #endif C) #if UNITY_EDITOR Advertisement.Disable(); #endif D) #if UNITY_IOS Advertisement.Disable(); #endif Answer: B Explanation: The !UNITY_ANDROID condition excludes Android builds, disabling ads only on other platforms. Question 24. When refactoring ad-related code to follow the SOLID principles, which pattern helps to decouple the ad service from game logic? A) Singleton B) Observer C) Factory D) Dependency Injection Answer: D Explanation: Dependency Injection allows you to inject an IAdService interface, making the game logic independent of the concrete Unity Ads implementation. Question 25. Which UnityAdsError value is returned when you attempt to show an ad before calling Advertisement.Initialize? A) NOT_INITIALIZED B) SHOW_ERROR C) INTERNAL_ERROR D) AD_BLOCKED

Ultimate Exam

Question 29. Which method should you call to hide a banner ad that was previously shown? A) Advertisement.Banner.Hide(true); B) Advertisement.HideBanner(); C) Advertisement.Banner.Hide(); D) Advertisement.Banner.Unload(); Answer: C Explanation: Advertisement.Banner.Hide() removes the banner from view; the optional bool parameter controls whether to destroy the banner. Question 30. In Unity Ads, what does the placementContent property of IUnityAdsShowListener provide? A) The ad’s video URL. B) The raw JSON payload of the ad. C) The type of ad (Banner, Interstitial, Rewarded). D) The amount of revenue earned. Answer: C Explanation: placementContent indicates the ad type associated with the show event. Question 31. Which of the following statements about the Advertisement.IsSupported() method is correct? A) It returns true only on Android devices. B) It checks whether the current platform can display Unity Ads. C) It verifies that the ad placement is configured in the dashboard. D) It determines if test mode is enabled. Answer: B Explanation: IsSupported returns true if the runtime platform supports Unity Ads (e.g., iOS, Android, Unity Editor).

Ultimate Exam

Question 32. When using a Dictionary to cache loaded placements, which method retrieves a placement safely without throwing an exception if the key does not exist? A) placements["interstitial"] B) placements.GetValueOrDefault("interstitial") C) placements.Add("interstitial", content) D) placements.Remove("interstitial") Answer: B Explanation: GetValueOrDefault returns the value if present, otherwise the default (null), avoiding a KeyNotFoundException. Question 33. Which UnityAdsShowError indicates that the ad could not be displayed because the user is in a restricted region? A) NOT_INITIALIZED B) SHOW_ERROR C) AD_BLOCKED D) INTERNAL_ERROR Answer: C Explanation: AD_BLOCKED is used when the ad network blocks delivery due to user location or policy restrictions. Question 34. To prevent a NullReferenceException when accessing adListener.OnUnityAdsShowComplete, you should first check: A) if (adListener != null) B) if (Advertisement.IsReady()) C) if (adListener.IsInitialized()) D) if (Advertisement.IsSupported()) Answer: A Explanation: Verifying that the listener instance is not null avoids dereferencing a null reference.

Ultimate Exam

Question 38. Which of the following best describes the purpose of the IUnityAdsInitializationListener interface? A) To receive callbacks for ad load success/failure. B) To be notified when the SDK finishes initializing or fails. C) To handle banner placement events. D) To manage rewarded video reward distribution. Answer: B Explanation: The interface provides OnInitializationComplete and OnInitializationFailed callbacks. Question 39. If you need to store the mapping between placement IDs and the amount of in-game currency they reward, which collection gives O(1) lookup time? A) List> B) Dictionary C) Queue D) SortedList Answer: B Explanation: Dictionary provides constant-time key lookup. Question 40. Which statement about using Advertisement.IsReady() inside Update() is considered a bad practice? A) It ensures the ad is always shown as soon as it’s ready. B) It may cause performance overhead due to frequent polling. C) It automatically loads the ad if not ready. D) It prevents the ad from ever being shown. Answer: B Explanation: Continuously calling IsReady each frame can add unnecessary CPU load; it’s better to use callbacks. Question 41. Which UnityAdsError indicates that the ad request was blocked because the user has opted out of personalized ads?

Ultimate Exam

A) AD_BLOCKED

B) INTERNAL_ERROR

C) SHOW_ERROR

D) NOT_INITIALIZED

Answer: A Explanation: AD_BLOCKED is used for regulatory blocks, including opt-out scenarios. Question 42. To guarantee that a banner ad respects safe-area insets on iOS devices, which property should you set? A) Advertisement.Banner.SetPosition(BannerPosition.BottomCenter); B) Advertisement.Banner.SetPosition(BannerPosition.Smart); C) Advertisement.Banner.SetPosition(BannerPosition.TopCenter); D) Advertisement.Banner.SetPosition(BannerPosition.Custom); Answer: B Explanation: The Smart position automatically adjusts for safe-area insets. Question 43. Which of the following is the correct way to declare a public array of placement IDs that can be edited in the Unity Inspector? A) public string[] placementIds; B) private string[] placementIds; C) public static List placementIds; D) public readonly string[] placementIds; Answer: A Explanation: Public fields of supported types (including arrays) are serialized and appear in the Inspector. Question 44. When using Advertisement.Load() with a LoadOptions object, which callback is invoked upon successful load? A) loadCallback B) onSuccess

Ultimate Exam

D) #if !DEVELOPMENT_BUILD Advertisement.SetDebugMode(false); #endif Answer: D Explanation: The DEVELOPMENT_BUILD symbol is defined for development builds; negating it disables debug logs in release. Question 48. Which of the following is a best-practice naming convention for a method that loads a rewarded video placement? A) loadRewardedVideo() B) LoadRewardedVideoAsync() C) Load_Rewarded_Video() D) LoadRewardedVideo Answer: B Explanation: Using PascalCase and the “Async” suffix clarifies that the method performs an asynchronous operation. Question 49. When you need to pass a custom user ID to Unity Ads for analytics, which class do you use? A) UserMetadata B) MetaData C) Analytics D) AdSettings Answer: B Explanation: MetaData can be created with the “user” category and a “userId” key to send custom identifiers. Question 50. Which of these statements about the Advertisement.Show() overload that takes a ShowOptions parameter is FALSE? A) ShowOptions can specify a result callback. B) ShowOptions can set a placement ID. C) ShowOptions can mute the ad audio.

Ultimate Exam

D) ShowOptions does not affect the ad’s loading state. Answer: B Explanation: The placement ID is passed directly to Show(); ShowOptions does not contain a placement field. Question 51. In Unity Ads, what does the PlacementState.NotReady state signify? A) The ad is currently showing. B) The SDK is not initialized. C) The placement has no loaded ad. D) The ad has been blocked by the user. Answer: C Explanation: NotReady means there is no ad cached for that placement. Question 52. Which C# keyword should you use to make a method that can be called without creating an instance of the class, useful for a global ad utility? A) virtual B) static C) abstract D) sealed Answer: B Explanation: static methods belong to the class itself and can be invoked directly. Question 53. If you want to keep a list of rewarded placements that have already granted a reward to avoid double-rewarding, which collection is most appropriate? A) List B) Queue C) HashSet D) Dictionary

Ultimate Exam

Explanation: SHOW_ERROR covers runtime failures such as muted audio or other playback issues. Question 57. To ensure that the ad manager is not destroyed when loading a new scene, which Unity method should you call? A) DontDestroyOnLoad(this.gameObject); B) Destroy(this.gameObject); C) HideFlags = HideFlags.DontSave; D) SceneManager.LoadSceneAsync(..., LoadSceneMode.Additive); Answer: A Explanation: DontDestroyOnLoad marks the object to persist across scene loads. Question 58. Which of the following is the most efficient way to check if a placement ID exists in a List called placements? A) placements.Contains("interstitial"); B) placements.IndexOf("interstitial") != -1; C) foreach (var p in placements) { if (p == "interstitial") return true; } D) placements.Find(p => p == "interstitial") != null; Answer: A Explanation: List.Contains internally performs a linear search; it is the most concise and readable option. Question 59. When you receive the log “UnityAds: Initialization failed: Invalid Game ID”, what is the most likely fix? A) Enable test mode. B) Pass the correct Game ID string to Advertisement.Initialize. C) Call Advertisement.Load before initializing. D) Update the Unity Ads package. Answer: B Explanation: An invalid Game ID causes initialization to fail; providing the correct ID resolves the issue.

Ultimate Exam

Question 60. Which Unity Ads method should you use to retrieve the current version of the Ads SDK at runtime? A) Advertisement.GetVersion() B) Advertisement.Version C) Advertisement.sdkVersion D) Advertisement.GetSDKVersion() Answer: A Explanation: GetVersion returns a string with the SDK version. Question 61. Which of the following is the correct syntax to add a custom key-value pair ("level", "5") to the MetaData category "game"? A) MetaData md = new MetaData("game"); md.Set("level", "5"); Advertisement.SetMetaData(md); B) MetaData md = new MetaData(); md.Add("game", "level", "5"); C) Advertisement.AddMetaData("game", "level", "5"); D) MetaData md = new MetaData("game"); md.Add("level", 5); Answer: A Explanation: MetaData.Set stores a string value for a given key; SetMetaData registers it with the SDK. Question 62. In a Unity Ads script, you notice the warning “Attempting to show ad while another ad is already showing.” Which design change will prevent this warning? A) Call Advertisement.Show inside a coroutine that waits for OnUnityAdsShowComplete. B) Use a static bool flag to block Show calls while an ad is active. C) Disable the ad button when an ad is playing. D) All of the above. Answer: D Explanation: All three approaches ensure that a second Show request is not issued while an ad is active.