


















































































Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
This page cannot be seen from the preview
Don't miss anything!



















































































Question 1. Which Unity Ads method should you call to check if a rewarded video ad is ready to be shown? A) Advertisement.IsReady() B) Advertisement.Show() C) Advertisement.Load() D) Advertisement.Initialize() Answer: A Explanation: Advertisement.IsReady(string placementId) returns true when the specified ad placement (e.g., rewarded video) has been loaded and is ready to display. Question 2. When a null reference exception occurs in a script that references playerController, what is the most likely cause? A) The script is attached to the wrong GameObject. B) playerController has not been assigned in the Inspector or via code. C) The Unity Ads package is not imported. D) The method name is misspelled. Answer: B Explanation: A null reference means the variable points to no object; forgetting to assign the reference in the Inspector or in Awake/Start triggers this error. Question 3. Which log level should you use for messages that are only needed while troubleshooting a specific Unity Ads flow? A) LogError B) LogWarning C) Log D) LogException Answer: C
Explanation: Debug.Log prints standard informational messages that can be filtered out later; LogError and LogWarning are for problems, while LogException includes stack traces. Question 4. To display a banner ad at the bottom of the screen, which placement ID should you pass to Advertisement.Show()? A) "rewardedVideo" B) "interstitial" C) "bannerBottom" D) "defaultBanner" Answer: C Explanation: Placement IDs are defined in the Unity Dashboard; a banner placed at the bottom typically uses an ID like "bannerBottom". Question 5. Which of the following statements about Advertisement.Initialize(string gameId, bool testMode) is true? A) It must be called before any other Advertisement method. B) It can be called multiple times with different game IDs. C) testMode disables all ads permanently. D) It returns a boolean indicating success. Answer: A Explanation: Initialization sets up the SDK; calling other methods before initialization results in errors. It can only be called once per session. Question 6. In the Unity Ads callback IUnityAdsListener.OnUnityAdsDidFinish(string placementId, ShowResult showResult), which ShowResult value indicates the user watched the ad completely? A) Skipped
Question 9. If you need to store a mapping from placement IDs to their reward amounts, which collection type is most suitable? A) ListAdvertisement.Load(string placementId) starts loading the ad without displaying it, enabling instant playback when needed. Question 11. A script logs “Unity Ads initialization failed: Invalid Game ID”. Which of the following is the most likely fix? A) Turn off test mode. B) Use the correct platform‑specific Game ID (iOS vs Android). C) Call Advertisement.Show() before initialization. D) Remove the Unity Ads package. Answer: B
Explanation: Each platform has its own Game ID; using the wrong one triggers an invalid‑ID error. Question 12. When implementing IUnityAdsListener, which method is invoked if an ad fails to load? A) OnUnityAdsDidError B) OnUnityAdsReady C) OnUnityAdsDidStart D) OnUnityAdsDidFinish Answer: A Explanation: OnUnityAdsDidError(string message) is called for loading or runtime errors. Question 13. Which of the following best describes the purpose of Advertisement.IsSupported()? A) Checks if the device can display banner ads. B) Determines whether the Unity Ads SDK is available on the current platform. C) Returns true if a rewarded video is cached. D) Verifies that the user has an internet connection. Answer: B Explanation: IsSupported returns false on platforms where Unity Ads cannot run (e.g., WebGL without a plugin). Question 14. In a script, you see private static bool adsInitialized = false;. What is the effect of the static keyword here? A) The variable can be edited in the Inspector. B) Each instance of the class gets its own copy. C) All instances share the same value.
B) Show → Initialize → Load → IsReady C) Load → Initialize → Show → IsReady D) Initialize → Show → Load → IsReady Answer: A Explanation: You must initialize the SDK, optionally preload with Load, verify readiness with IsReady, then call Show. Question 18. Which of the following will NOT cause a compilation error in C#? A) Declaring a method with the same name as a built‑in Unity function but different parameters. B) Using public on a local variable inside a method. C) Missing a semicolon at the end of a line. D) Declaring two variables with the same name in the same scope. Answer: A Explanation: Overloading a Unity function is allowed; the other options violate C# syntax rules. Question 19. In the Unity Editor, which window helps you identify the exact frame where an ad load call spikes CPU usage? A) Console B) Profiler → CPU C) Project D) Animator Answer: B Explanation: The Profiler’s CPU module displays per‑frame call stacks, allowing you to pinpoint expensive operations.
Question 20. When refactoring ad‑related code to follow the SOLID principles, which pattern is most useful for swapping different ad networks without changing game logic? A) Singleton B) Factory Method C) Observer D) Decorator Answer: B Explanation: A Factory creates concrete ad‑network objects behind an interface, enabling easy replacement while keeping client code unchanged. Question 21. Which attribute can you add to a field to make it visible in the Inspector while still keeping it private in code? A) [HideInInspector] B) [SerializeField] C) [RequireComponent] D) [ExecuteInEditMode] Answer: B Explanation: [SerializeField] forces Unity to serialize a private field, exposing it in the Inspector. Question 22. If Advertisement.Show("rewardedVideo") is called while Advertisement.IsReady("rewardedVideo") returns false, what will happen? A) The ad will still show after a short delay. B) Unity will throw an exception. C) Nothing; the call is ignored. D) The SDK will log a warning and the ad will not display. Answer: D
Answer: B Explanation: Providing user feedback while logging the detailed message aids debugging and maintains user experience. Question 26. When using a List<AdvertisementPlacement> to store placement data, which method adds a new placement at the end of the list? A) Insert(0, placement) B) Add(placement) C) Append(placement) D) Push(placement) Answer: B Explanation: List<T>.Add appends an element to the end of the list. Question 27. In C#, what is the result of the expression typeof(Advertisement).IsSubclassOf(typeof(object))? A) true B) false C) compilation error D) runtime exception Answer: A Explanation: All classes inherit from object; therefore the method returns true. Question 28. Which Unity Ads feature allows you to test ads without generating revenue? A) Production mode B) Test mode C) Debug mode
D) Offline mode Answer: B Explanation: Enabling test mode substitutes real ads with test ads, preventing revenue impact. Question 29. If you need to persist the user’s ad‑reward balance across sessions, which Unity system is most appropriate? A) PlayerPrefs B) AudioSource C) NavMeshAgent D) UnityWebRequest Answer: A Explanation: PlayerPrefs provides simple key‑value storage that persists between game launches. Question 30. Which of the following statements about Advertisement.Show(string placementId, ShowOptions options) is correct? A) ShowOptions can be null; the method will still compile. B) ShowOptions must always contain a non‑null resultCallback. C) The method returns a bool indicating success. D) ShowOptions is only used for banner ads. Answer: A Explanation: ShowOptions is optional; passing null uses default behavior. Question 31. When you receive a compilation error “CS0103: The name ‘adsInitialized’ does not exist in the current context”, what is the most probable cause? A) The variable is declared in another class without proper reference.
Question 34. Which of the following statements about Advertisement.SetMetaData(MetaData metaData) is true? A) It can only be called after Advertisement.Initialize. B) It allows you to pass custom key/value pairs to the ad network. C) It returns a boolean indicating success. D) It is used to set the ad’s volume level. Answer: B Explanation: MetaData lets developers send extra information (e.g., user age) to the ad SDK. Question 35. In a coroutine that waits for an ad to become ready, which Unity API call is appropriate? A) while (!Advertisement.IsReady("rewardedVideo")) { yield return null; } B) while (Advertisement.IsReady("rewardedVideo")) { yield return null; } C) do { yield return new WaitForSeconds(1); } while (Advertisement.IsReady("rewardedVideo")); D) if (Advertisement.IsReady("rewardedVideo")) yield break; Answer: A Explanation: The loop continues yielding each frame until the ad is ready. Question 36. When you want to hide a banner ad after the user dismisses a menu, which method should you call? A) Advertisement.Hide() B) Advertisement.Destroy() C) Advertisement.Show() with an empty placement ID D) Advertisement.Banner.Hide() Answer: D Explanation: Advertisement.Banner.Hide() specifically removes a banner from view.
Question 37. Which of the following is NOT a valid ShowResult enum value? A) Finished B) Skipped C) Completed D) Failed Answer: C Explanation: The enum contains Finished, Skipped, and Failed; “Completed” does not exist. Question 38. If a script contains public static readonly string gameId = "1234567";, what does readonly guarantee? A) The value can be changed at runtime. B) The value can only be set in the declaration or a static constructor. C) The field is visible in the Inspector. D) The field is constant and compiled away. Answer: B Explanation: readonly fields can be assigned once, either inline or in a constructor, but not modified thereafter. Question 39. Which Unity attribute forces a component to be added to a GameObject automatically when another component is added? A) [RequireComponent(typeof(Advertisement))] B) [AddComponentMenu] C) [ExecuteInEditMode] D) [DisallowMultipleComponent] Answer: A
D. Disable the Unity Ads package in the project. Answer: B Explanation: By abstracting the SDK behind an interface, you can inject a mock that simulates ad behavior for testing. Question 43. Which of the following is a correct way to declare a dictionary that maps placement IDs to their ShowOptions? A) Dictionary<string, ShowOptions> optionsMap = new Dictionary<string, ShowOptions>(); B) Dictionary<string, ShowOptions> optionsMap = new Dictionary<>(); C) Dictionary<string> optionsMap = new Dictionary<string, ShowOptions>(); D) Dictionary optionsMap = new Dictionary<string, ShowOptions>(); Answer: A Explanation: The generic type parameters must be specified for both key and value types. Question 44. When you want to pause the game while a rewarded video is playing, which Unity method should you call in OnUnityAdsDidStart? A) Time.timeScale = 0; B) AudioListener.pause = true; C) Application.runInBackground = false; D) SceneManager.LoadScene("PauseMenu"); Answer: A Explanation: Setting Time.timeScale to 0 stops all time‑based updates, effectively pausing gameplay. Question 45. Which of the following statements about ad frequency capping is true? A) Unity Ads automatically limits the number of ads per session.
B) Developers must implement their own logic to avoid showing ads too often. C) Frequency capping is only available for banner ads. D) It is controlled via the ShowOptions parameter. Answer: B Explanation: Unity Ads does not enforce frequency caps; developers should track impressions and decide when to show ads. Question 46. If you attempt to access Advertisement.Banner before calling Advertisement.Initialize, what will happen? A) The banner will load silently. B) A NullReferenceException is thrown. C) Unity logs an error and the call is ignored. D) The game crashes. Answer: C Explanation: The SDK checks initialization status and logs an error if banner methods are used prematurely. Question 47. Which C# keyword allows a method to be called without creating an instance of its class? A) static B) const C) virtual D) sealed Answer: A Explanation: static methods belong to the class itself and can be invoked directly.
Explanation: Removing the listener prevents the destroyed object from being referenced, avoiding leaks. Question 51. Which Unity Ads placement type typically has the highest eCPM (effective cost per mille)? A) Banner B) Rewarded video C) Interstitial D) Native Answer: C Explanation: Interstitial ads occupy the full screen and generally command higher eCPM than banners or rewarded videos. Question 52. If you need to store a list of ad‑placement IDs that the player has already seen, which collection gives O(1) lookup time? A) ListHashSet provides constant‑time containment checks, ideal for “already seen” tracking. Question 53. Which of the following statements about Advertisement.Banner.Show(string placementId, BannerOptions options) is correct? A) BannerOptions can include a showCallback that fires after the banner is displayed. B) The method returns a bool indicating success.
C) placementId must be null for default banner. D) Banners cannot be hidden once shown. Answer: A Explanation: BannerOptions lets you set callbacks for show, hide, and click events. Question 54. When using Advertisement.Load(string placementId, IUnityAdsLoadListener listener), which callback indicates a successful load? A) OnUnityAdsFailedToLoad B) OnUnityAdsReady C) OnUnityAdsLoaded D) OnUnityAdsStart Answer: C Explanation: OnUnityAdsLoaded is invoked when the requested placement has been successfully loaded. Question 55. Which Unity scripting event is called after a scene has been fully loaded, making it a good place to re‑initialize ads after a level change? A) Awake() B) Start() C) OnEnable() D) OnSceneLoaded(Scene scene, LoadSceneMode mode) Answer: D Explanation: SceneManager.sceneLoaded fires after the scene finishes loading, allowing you to re‑setup ad listeners. Question 56. If you want to disable ads for a specific platform (e.g., iOS) at runtime, which check should you perform?