All fields

“Multiple Inheritance & MRO” in Information Technology

44 questions across 3 technologies.

Information Technology

44 questions in 3 technologies

#QuestionTechnologyTopicLevel
1What is multiple inheritance in Python, and how does it differ from single inheritance? Python › Multiple Inheritance & MROPythonMultiple Inheritance & MROBeginner
2Why is Python's approach to multiple inheritance considered more powerful but riskier than single-inheritance-only languages? Python › Multiple Inheritance & MROPythonMultiple Inheritance & MROBeginner
3How does super() work in the context of multiple inheritance, and why is it more than just 'call the parent class'? Python › Multiple Inheritance & MROPythonMultiple Inheritance & MROIntermediate
4What is a mixin class, and how does it differ from a typical base class in multiple inheritance? Python › Multiple Inheritance & MROPythonMultiple Inheritance & MROIntermediate
5How can you use isinstance() and issubclass() to check relationships in a multiple-inheritance hierarchy? Python › Multiple Inheritance & MROPythonMultiple Inheritance & MROIntermediate
6How does cooperative multiple inheritance require every class in the hierarchy to call super() consistently, even in __init__? Python › Multiple Inheritance & MROPythonMultiple Inheritance & MROAdvanced
7How does Python handle attribute (not just method) resolution across multiple inheritance, and can it lead to surprising shadowing? Python › Multiple Inheritance & MROPythonMultiple Inheritance & MROAdvanced
8What is the 'diamond problem', and how does Python's MRO solve it? Python › Multiple Inheritance & MROPythonMultiple Inheritance & MROIntermediate
9How do you call a specific ancestor's method explicitly, bypassing the normal MRO-based super() resolution? Python › Multiple Inheritance & MROPythonMultiple Inheritance & MROIntermediate
10How does the built-in `object` class relate to every class's MRO, and why does it always appear last? Python › Multiple Inheritance & MROPythonMultiple Inheritance & MROIntermediate
11How does the C3 linearization algorithm compute a class's MRO? Python › Multiple Inheritance & MROPythonMultiple Inheritance & MROAdvanced
12Why does the convention of listing mixins before the primary base class matter for MRO and method overriding? Python › Multiple Inheritance & MROPythonMultiple Inheritance & MROAdvanced
13What's the difference between mixing in an abstract base class (using abc.ABC) versus a plain mixin class? Python › Multiple Inheritance & MROPythonMultiple Inheritance & MROIntermediate
14Why does Python sometimes raise 'TypeError: Cannot create a consistent method resolution order'? Python › Multiple Inheritance & MROPythonMultiple Inheritance & MROAdvanced
15How would you design a mixin to be safely combinable with any base class's __init__ signature using **kwargs? Python › Multiple Inheritance & MROPythonMultiple Inheritance & MROAdvanced
16Why can't you freely mix two classes with different, incompatible metaclasses in multiple inheritance? Python › Metaclasses & Class CustomizationPythonMetaclasses & Class CustomizationAdvanced
17What is the __mro__ attribute and how does it relate to metaclasses? Python › Metaclasses & Class CustomizationPythonMetaclasses & Class CustomizationBeginner
18What is the practical difference between isinstance(obj, cls) and type(obj) is cls, particularly regarding metaclasses and inheritance? Python › Metaclasses & Class CustomizationPythonMetaclasses & Class CustomizationIntermediate
19How does EF Core map inheritance hierarchies to database tables, and what are the three main strategies (TPH, TPT, TPC)? .NET › Entity Framework Core & Data Access.NETEntity Framework Core & Data AccessIntermediate
20What is a metaclass in Python, and what is the default metaclass for all classes? Python › Metaclasses & Class CustomizationPythonMetaclasses & Class CustomizationBeginner
21Why do most Python developers rarely need to write a custom metaclass in everyday code? Python › Metaclasses & Class CustomizationPythonMetaclasses & Class CustomizationBeginner
22What does the __init__.py file do inside a package directory? Python › Modules & PackagingPythonModules & PackagingBeginner
23What is a reference cycle, and why can't simple reference counting free it? Python › Memory Management & Garbage CollectionPythonMemory Management & Garbage CollectionIntermediate
24How does the gc module let you inspect and debug memory leaks caused by uncollectable objects? Python › Memory Management & Garbage CollectionPythonMemory Management & Garbage CollectionIntermediate
25How do you create a class dynamically using type() with three arguments instead of a class statement? Python › Metaclasses & Class CustomizationPythonMetaclasses & Class CustomizationIntermediate
26How does __init_subclass__ provide a simpler alternative to metaclasses for many customization needs? Python › Metaclasses & Class CustomizationPythonMetaclasses & Class CustomizationIntermediate
27How would you set up a CORS policy that allows any subdomain of a given domain (like *.mycompany.com) using SetIsOriginAllowed? .NET › CORS & Cross-Origin Resource Sharing.NETCORS & Cross-Origin Resource SharingIntermediate
28How does the [OutputCache] attribute's VaryByValue option let you cache based on custom, computed criteria beyond query strings or headers? ASP.NET Core › CachingASP.NET CoreCachingIntermediate
29How does functools.singledispatch enable function overloading based on argument type? Python › functools & Functional Programming ToolsPythonfunctools & Functional Programming ToolsAdvanced
30What is the difference between __new__ and __init__, and when would you override __new__? Python › Magic Methods & Operator OverloadingPythonMagic Methods & Operator OverloadingAdvanced
31How does the weakref module help avoid reference cycles and memory leaks? Python › Memory Management & Garbage CollectionPythonMemory Management & Garbage CollectionAdvanced
32Why is __del__ (the finalizer method) discouraged for critical cleanup logic, and what problems can it cause? Python › Memory Management & Garbage CollectionPythonMemory Management & Garbage CollectionAdvanced
33How do circular references between objects with __del__ methods behave differently in Python 3.4+ compared to earlier versions? Python › Memory Management & Garbage CollectionPythonMemory Management & Garbage CollectionAdvanced
34How do you write a custom metaclass by subclassing type, and when would you do so? Python › Metaclasses & Class CustomizationPythonMetaclasses & Class CustomizationAdvanced
35How do abstract base classes (ABCs) use a metaclass to enforce that subclasses implement required methods? Python › Metaclasses & Class CustomizationPythonMetaclasses & Class CustomizationAdvanced
36How can a metaclass be used to implement the Singleton design pattern more robustly than overriding __new__ alone? Python › Metaclasses & Class CustomizationPythonMetaclasses & Class CustomizationAdvanced
37How does __instancecheck__ and __subclasscheck__ on a metaclass enable 'virtual subclassing' as used by collections.abc? Python › Metaclasses & Class CustomizationPythonMetaclasses & Class CustomizationAdvanced
38How would you write a custom configuration provider to load settings from an unsupported source, like a remote database? .NET › Configuration & Options.NETConfiguration & OptionsAdvanced
39How do you handle optimistic concurrency conflicts in EF Core using a concurrency token (like RowVersion)? .NET › Entity Framework Core & Data Access.NETEntity Framework Core & Data AccessAdvanced
40How would you implement custom middleware to catch and log unhandled exceptions before they reach the exception handler, adding request-specific context? .NET › Global Exception Handling & Middleware.NETGlobal Exception Handling & MiddlewareAdvanced
41How would you implement hierarchical or nested permission checks, like an organization admin having access to all of their organization's resources? ASP.NET Core › AuthorizationASP.NET CoreAuthorizationAdvanced
42How would you write a custom configuration provider to load settings from an unsupported source, like a remote configuration service or database? ASP.NET Core › Configuration & Options PatternASP.NET CoreConfiguration & Options PatternAdvanced
43How would you design configuration for a multi-tenant ASP.NET Core application where each tenant needs different settings resolved at runtime? ASP.NET Core › Configuration & Options PatternASP.NET CoreConfiguration & Options PatternAdvanced
44How would you configure CORS to allow any subdomain of a known domain (like *.mycompany.com) using SetIsOriginAllowed with custom matching logic? ASP.NET Core › CORS (Cross-Origin Resource Sharing)ASP.NET CoreCORS (Cross-Origin Resource Sharing)Advanced