yoklainterview sim

Game Development Ue Uobject Reflection Gc Interview Questions

75 verified Game Development Ue Uobject Reflection Gc interview questions — solve with answers, learn from explanations, test yourself in a real simulation.

Try the real simulation →

Sample questions

Ue Uobject Reflection GcDifficulty 1
What is the primary purpose of the UCLASS() macro placed above a C++ class declaration in Unreal Engine?
  • aIt forces the class to compile as a header-only template.
  • bIt registers the class with Unreal's reflection system.
  • cIt marks the class as thread-safe for the render thread.
  • dIt disables C++ virtual dispatch for the class's methods.
Explanation:UCLASS() tells Unreal Header Tool to generate reflection data for the class, which is what makes the class visible to systems like serialization, garbage collection, and the editor.
Ue Uobject Reflection GcDifficulty 1
Where must the GENERATED_BODY() macro be placed inside a UCLASS-declared C++ class?
  • aAnywhere after the last public member function.
  • bOnly inside a .cpp file, never in the header.
  • cImmediately after the class's virtual destructor.
  • dAs the very first line inside the class body.
Explanation:GENERATED_BODY() must be the first line in the class body; Unreal Header Tool expects it there to inject the generated reflection boilerplate correctly.
Ue Uobject Reflection GcDifficulty 2
What is a key difference between a type declared with USTRUCT() and one declared with UCLASS()?
  • aA USTRUCT() type does not need to derive from UObject.
  • bA USTRUCT() type can never contain a UPROPERTY() member.
  • cA USTRUCT() type is always replicated automatically over the network.
  • dA USTRUCT() type cannot be used inside a TArray.
Explanation:USTRUCT() gives lightweight, value-type data reflection without UObject identity, ownership, or lifecycle, unlike UCLASS() which is conventionally used for UObject-derived reference types.
Ue Uobject Reflection GcDifficulty 2
Why would you mark a C++ enum class with UENUM() in Unreal Engine?
  • aSo the enum's underlying storage type changes from an integer to a string automatically.
  • bSo the compiler enforces that no two enumerators share a value.
  • cSo the enum's values become visible to the editor and Blueprint.
  • dSo the enum can be forward-declared without including its header.
Explanation:UENUM() registers the enum with reflection, which is what lets the editor and Blueprint display its enumerators and lets the engine serialize a chosen value by its name rather than a raw integer.
Ue Uobject Reflection GcDifficulty 3
In Unreal's reflection system, why does declaring a reflected interface require two classes: one prefixed U and one prefixed I?
  • aThe U-prefixed class is only used in Shipping builds, and the I-prefixed class only in Debug builds.
  • bThe U-prefixed class is the Blueprint version and the I-prefixed class is the C++-only version, and only one can exist per project.
  • cThe U-prefixed class carries reflection metadata; the I-prefixed class holds the virtual functions.
  • dThe U-prefixed class stores the function implementations, and the I-prefixed class is deleted after compilation.
Explanation:This dual-class pattern splits reflection bookkeeping (the U class) from the actual C++ interface contract with pure virtual functions (the I class); a class implements the interface by inheriting from the I class.
Ue Uobject Reflection GcDifficulty 2
A UObject* class member has no UPROPERTY() macro above it. What is the direct consequence for that member?
  • aThe compiler refuses to build the class until UPROPERTY() is added.
  • bThe engine's reflection system has no knowledge of it.
  • cThe pointer is automatically converted to a TWeakObjectPtr at compile time.
  • dThe member becomes accessible from Blueprint by default.
Explanation:A raw, non-reflected UObject* is invisible to the engine: it isn't automatically nulled when its target is destroyed, and it doesn't keep the target alive during garbage collection.

Test yourself against the 2850-question Game Development bank.

Start interview