All fields

“Scope” in Information Technology

103 questions across 10 technologies.

Information Technology

103 questions in 10 technologies

#QuestionTechnologyTopicLevel
1What is a file-scoped namespace declaration, and how does it reduce indentation compared to a traditional block-scoped namespace? C# › Modern C# Features (Global Usings, File-Scoped Namespaces, Top-Level Statements)C#Modern C# Features (Global Usings, File-Scoped Namespaces, Top-Level Statements)Beginner
2What is variable scope in PHP, and why can't a function normally access a variable defined outside of it? PHP › Functions & ScopePHPFunctions & ScopeBeginner
3What is Python's LEGB rule for variable scope resolution, and what does each letter stand for? Python › Functions & ScopePythonFunctions & ScopeIntermediate
4How does the 'nonlocal' keyword let a nested function modify a variable in its ENCLOSING (not global) scope? Python › Functions & ScopePythonFunctions & ScopeIntermediate
5How does a closure capture variables from its enclosing scope, and what pitfall occurs when creating multiple closures inside a loop? Python › Functions & ScopePythonFunctions & ScopeAdvanced
6How do variable variables and variable scope work in PHP, and what are common pitfalls to avoid? PHP › Basics & TypesPHPBasics & TypesIntermediate
7What is an enum class (scoped enum) and why is it preferred? C++ › Enums & Enum ClassesC++Enums & Enum ClassesBeginner
8How do you scope RBAC to specific projects and applications? ArgoCD › RBACArgoCDRBACIntermediate
9How do you create a read-only role scoped to one project? ArgoCD › RBACArgoCDRBACIntermediate
10What is the difference between Singleton, Scoped, and Transient service lifetimes in ASP.NET Core's DI container? C# › Dependency Injection & IoC PrinciplesC#Dependency Injection & IoC PrinciplesIntermediate
11What is the purpose of the 'scope' parameter in OAuth 2.0, and how does it implement the principle of least privilege? .NET › Authentication & Authorization (Identity, JWT, OAuth).NETAuthentication & Authorization (Identity, JWT, OAuth)Intermediate
12What is the difference between Singleton, Scoped, and Transient service lifetimes in ASP.NET Core's DI container? .NET › Dependency Injection.NETDependency InjectionIntermediate
13How do you safely access scoped services like a DbContext from within a BackgroundService, which is registered as a singleton? ASP.NET Core › Background Tasks & Hosted ServicesASP.NET CoreBackground Tasks & Hosted ServicesIntermediate
14What is the risk of caching sensitive or user-specific data with an incorrectly scoped cache key, and how do you prevent cross-user data leakage? ASP.NET Core › CachingASP.NET CoreCachingIntermediate
15What is the difference between Singleton, Scoped, and Transient service lifetimes, and how does Scoped specifically map to an HTTP request? ASP.NET Core › Dependency InjectionASP.NET CoreDependency InjectionIntermediate
16How do you use IServiceScopeFactory to manually create a DI scope outside the normal per-request pipeline, such as inside a background service? ASP.NET Core › Dependency InjectionASP.NET CoreDependency InjectionIntermediate
17How do health checks interact with dependency injection scoping, particularly for checks that need a scoped service like a DbContext? ASP.NET Core › Health ChecksASP.NET CoreHealth ChecksIntermediate
18What is the difference between Maven's <dependencies> scope values (compile, provided, runtime, test) and how do they affect what's included in the final packaged artifact? Java › Build Tools: Maven & GradleJavaBuild Tools: Maven & GradleIntermediate
19How can you properly intercept and correctly handle the physical Android back button using the PopScope widget, such as showing a confirmation dialog before genuinely actually allowing the user to leave a screen with unsaved changes? Flutter › Navigation & Routing in FlutterFlutterNavigation & Routing in FlutterIntermediate
20How does the scopes setting affect group mapping? ArgoCD › RBACArgoCDRBACAdvanced
21How do you correctly and safely resolve a Scoped service from within a Singleton service using IServiceScopeFactory, avoiding the captive dependency problem? C# › Dependency Injection & IoC PrinciplesC#Dependency Injection & IoC PrinciplesAdvanced
22How do you inject scoped (per-request) services into middleware, given that middleware classes are constructed once at app startup? .NET › ASP.NET Core Middleware & Request Pipeline.NETASP.NET Core Middleware & Request PipelineAdvanced
23Why is it dangerous to capture and store an HttpContext reference in a singleton-scoped service, and what should you use instead? .NET › ASP.NET Core Middleware & Request Pipeline.NETASP.NET Core Middleware & Request PipelineAdvanced
24How do you safely access scoped services (like a DbContext) from within a BackgroundService, which itself is registered as a singleton? .NET › Background Services.NETBackground ServicesAdvanced
25How does service lifetime (Scoped, Singleton, Transient) have different practical meaning in Blazor Server versus Blazor WebAssembly? .NET › Blazor (Server & WebAssembly).NETBlazor (Server & WebAssembly)Advanced
26How do you use IServiceScopeFactory to manually create and manage a DI scope outside the normal request pipeline? .NET › Dependency Injection.NETDependency InjectionAdvanced
27How does the Generic Host's dependency validation (ValidateOnBuild and ValidateScopes) help catch DI configuration errors early? .NET › Generic Host.NETGeneric HostAdvanced
28How does a lambda expression capture variables from its enclosing scope, and why must captured local variables be effectively final? Java › Functional Interfaces & Method ReferencesJavaFunctional Interfaces & Method ReferencesAdvanced
29How can scoped dependency injection help properly manage the specific lifecycle of dependencies that should genuinely only exist for the duration of a particular feature or a specific user session, rather than living for the entire lifetime of the whole application? Flutter › Dependency Injection in Flutter (GetIt & Service Locator)FlutterDependency Injection in Flutter (GetIt & Service Locator)Advanced
30How should you properly structure a genuinely large app's own overall Provider architecture, deciding exactly where within the widget tree each individual specific provider should genuinely be scoped and properly placed? Flutter › State Management with ProviderFlutterState Management with ProviderAdvanced
31What are top-level statements, and how do they simplify a basic C# program's entry point? C# › Modern C# Features (Global Usings, File-Scoped Namespaces, Top-Level Statements)C#Modern C# Features (Global Usings, File-Scoped Namespaces, Top-Level Statements)Beginner
32What is the difference between positional arguments and keyword arguments when calling a function? Python › Functions & ScopePythonFunctions & ScopeBeginner
33How do default parameter values work, and when are they evaluated? Python › Functions & ScopePythonFunctions & ScopeBeginner
34What does it mean that functions are 'first-class objects' in Python? Python › Functions & ScopePythonFunctions & ScopeBeginner
35How do you define and call a basic function in PHP, and what are function parameters and return values? PHP › Functions & ScopePHPFunctions & ScopeBeginner
36How do global using directives work, and how do you declare one for an entire project? C# › Modern C# Features (Global Usings, File-Scoped Namespaces, Top-Level Statements)C#Modern C# Features (Global Usings, File-Scoped Namespaces, Top-Level Statements)Intermediate
37What does the 'ImplicitUsings' project setting (`<ImplicitUsings>enable</ImplicitUsings>`) do automatically? C# › Modern C# Features (Global Usings, File-Scoped Namespaces, Top-Level Statements)C#Modern C# Features (Global Usings, File-Scoped Namespaces, Top-Level Statements)Intermediate
38How do required members (C# 11's 'required' keyword) enforce that certain properties MUST be set during object initialization? C# › Modern C# Features (Global Usings, File-Scoped Namespaces, Top-Level Statements)C#Modern C# Features (Global Usings, File-Scoped Namespaces, Top-Level Statements)Intermediate
39Why do you need the 'global' keyword to MODIFY a global variable from inside a function, but not to simply READ it? Python › Functions & ScopePythonFunctions & ScopeIntermediate
40How do *args and **kwargs let a function accept an arbitrary number of positional and keyword arguments? Python › Functions & ScopePythonFunctions & ScopeIntermediate
41What are default parameter values and variadic functions in PHP, and how do they add flexibility to how a function can be called? PHP › Functions & ScopePHPFunctions & ScopeIntermediate
42What are named arguments introduced in PHP 8, and how do they improve the readability of function calls with many parameters? PHP › Functions & ScopePHPFunctions & ScopeIntermediate
43How does the static keyword affect a variable declared inside a function, and how does this differ from a regular local variable? PHP › Functions & ScopePHPFunctions & ScopeIntermediate
44How do C# 12's collection expressions (`[1, 2, 3]`) provide a unified, type-agnostic syntax for initializing arrays, lists, and spans? C# › Modern C# Features (Global Usings, File-Scoped Namespaces, Top-Level Statements)C#Modern C# Features (Global Usings, File-Scoped Namespaces, Top-Level Statements)Advanced
45How do C# 12 primary constructors interact with dependency injection in ASP.NET Core minimal APIs and controller classes? C# › Modern C# Features (Global Usings, File-Scoped Namespaces, Top-Level Statements)C#Modern C# Features (Global Usings, File-Scoped Namespaces, Top-Level Statements)Advanced
46How does the 'file' access modifier (C# 11) create a type visible ONLY within its own source file, and what problem does this solve for source generators? C# › Modern C# Features (Global Usings, File-Scoped Namespaces, Top-Level Statements)C#Modern C# Features (Global Usings, File-Scoped Namespaces, Top-Level Statements)Advanced
47How do C# 12's default parameter values on LAMBDA expressions work, and what limitation did they remove compared to earlier C# versions? C# › Modern C# Features (Global Usings, File-Scoped Namespaces, Top-Level Statements)C#Modern C# Features (Global Usings, File-Scoped Namespaces, Top-Level Statements)Advanced
48How do C# 11's raw string literals (`"""..."""`) simplify writing strings containing quotes, escape sequences, or multi-line content like JSON or SQL? C# › Modern C# Features (Global Usings, File-Scoped Namespaces, Top-Level Statements)C#Modern C# Features (Global Usings, File-Scoped Namespaces, Top-Level Statements)Advanced
49Why is using a mutable default argument (like an empty list) a classic Python bug, and how do you avoid it? Python › Functions & ScopePythonFunctions & ScopeAdvanced
50How do keyword-only arguments (using a bare '*' in the parameter list) force certain parameters to be passed by name only? Python › Functions & ScopePythonFunctions & ScopeAdvanced
51How do positional-only parameters (using a bare '/' in the parameter list, Python 3.8+) restrict how certain parameters can be passed? Python › Functions & ScopePythonFunctions & ScopeAdvanced
52How do you use functools.partial to create a new function with some arguments pre-filled? Python › Functions & ScopePythonFunctions & ScopeAdvanced
53How does Python evaluate default argument expressions ONLY ONCE at definition time, and what SAFE pattern exploits this for genuinely useful caching? Python › Functions & ScopePythonFunctions & ScopeAdvanced
54How do you correctly type-hint a function using *args and **kwargs with modern typing, like ParamSpec for preserving a wrapped function's exact signature? Python › Functions & ScopePythonFunctions & ScopeAdvanced
55How would you implement a function that dynamically inspects its own call arguments at runtime using the 'inspect' module, useful for building generic validation or logging decorators? Python › Functions & ScopePythonFunctions & ScopeAdvanced
56How does recursion work in PHP functions, and what are the practical considerations, such as stack depth limits, when writing a recursive function? PHP › Functions & ScopePHPFunctions & ScopeAdvanced
57How do function type declarations and return type declarations improve code reliability, and how does PHP handle nullable and union types in function signatures? PHP › Functions & ScopePHPFunctions & ScopeAdvanced
58What is the Module pattern and what problem does it solve? JavaScript › Design Patterns in JavaScriptJavaScriptDesign Patterns in JavaScriptBeginner
59How do you create a basic command-line argument parser using argparse? Python › Command-Line Interfaces (argparse)PythonCommand-Line Interfaces (argparse)Beginner
60How do you create and run a basic thread using the threading module? Python › Concurrency (asyncio/threading/multiprocessing)PythonConcurrency (asyncio/threading/multiprocessing)Beginner
61What is the difference between a Python list and a tuple? Python › Data Types & StructuresPythonData Types & StructuresBeginner
62How do you use print statements effectively for debugging, including showing variable names alongside values? Python › Debugging & ProfilingPythonDebugging & ProfilingBeginner
63What is a decorator, and how does the @decorator_name syntax relate to a plain function call? Python › DecoratorsPythonDecoratorsBeginner
64How do you write a basic decorator that adds a print statement before and after calling the decorated function? Python › DecoratorsPythonDecoratorsBeginner
65What is an array in PHP and what types of arrays does PHP support? PHP › Arrays in PHPPHPArrays in PHPBeginner
66How do you add, remove, and access elements within a PHP array? PHP › Arrays in PHPPHPArrays in PHPBeginner
67What is an anonymous function in PHP, and how does it differ from a regular named function? PHP › Closures & Anonymous FunctionsPHPClosures & Anonymous FunctionsBeginner
68What is the use keyword in a PHP closure, and why is it needed to access outside variables from within an anonymous function? PHP › Closures & Anonymous FunctionsPHPClosures & Anonymous FunctionsBeginner
69What is the nullsafe operator introduced in PHP 8, and how does it simplify safely accessing a chain of potentially null properties or methods? PHP › PHP 8 Features (Attributes, Enums, Match, Nullsafe Operator)PHPPHP 8 Features (Attributes, Enums, Match, Nullsafe Operator)Beginner
70How do you run a PHP script from the command line, and how does this differ from running PHP through a web server? PHP › PHP CLI ScriptingPHPPHP CLI ScriptingBeginner
71How do you access command line arguments passed to a PHP script using the $argv and $argc superglobals? PHP › PHP CLI ScriptingPHPPHP CLI ScriptingBeginner
72What is the difference between single quoted and double quoted strings in PHP, particularly regarding variable interpolation and escape sequences? PHP › Strings & String FunctionsPHPStrings & String FunctionsBeginner
73What are type declarations in PHP, and how do they let you specify what kind of value a function parameter or return value should be? PHP › Type Declarations & Strict TypesPHPType Declarations & Strict TypesBeginner
74What is PHPUnit, and what is a unit test meant to actually verify about a piece of code? PHP › Unit Testing with PHPUnitPHPUnit Testing with PHPUnitBeginner
75Why are ES Module imports 'hoisted' and evaluated before the rest of the module's code runs? JavaScript › ES ModulesJavaScriptES ModulesIntermediate
76How do closures unintentionally keep large objects alive longer than expected? JavaScript › Memory Management & Garbage CollectionJavaScriptMemory Management & Garbage CollectionIntermediate
77How do you implement boolean flags using action='store_true' and action='store_false'? Python › Command-Line Interfaces (argparse)PythonCommand-Line Interfaces (argparse)Intermediate
78How do you send a value INTO a generator using the .send() method, and how does this differ from just calling next()? Python › Comprehensions & GeneratorsPythonComprehensions & GeneratorsIntermediate
79Why can't you use a mutable default value (like an empty list) directly as a dataclass field default, and how do you use field(default_factory=...) to fix it? Python › Dataclasses & NamedTuplesPythonDataclasses & NamedTuplesIntermediate
80How does functools.partial work and when is it useful? Python › functools & Functional Programming ToolsPythonfunctools & Functional Programming ToolsIntermediate
81How do mutable default arguments create a subtle memory and correctness pitfall related to object lifetime? Python › Memory Management & Garbage CollectionPythonMemory Management & Garbage CollectionIntermediate
82What is the difference between an absolute import and a relative import within a package? Python › Modules & PackagingPythonModules & PackagingIntermediate
83What is __all__ and how does it control `from module import *` behavior? Python › Modules & PackagingPythonModules & PackagingIntermediate
84How 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
85How do array_map, array_filter, and array_reduce help you transform and process array data without writing manual loops? PHP › Arrays in PHPPHPArrays in PHPIntermediate
86How do you sort arrays in PHP, and what is the difference between functions like sort, asort, and usort? PHP › Arrays in PHPPHPArrays in PHPIntermediate
87What is array destructuring in PHP, and how does the list function or short array syntax simplify extracting values from an array? PHP › Arrays in PHPPHPArrays in PHPIntermediate
88What are PHP's comparison operators, and how does the spaceship operator introduced in PHP 7 simplify writing custom comparison logic? PHP › Basics & TypesPHPBasics & TypesIntermediate
89How does passing a variable by reference into a closure's use clause differ from the default pass by value behavior? PHP › Closures & Anonymous FunctionsPHPClosures & Anonymous FunctionsIntermediate
90What is the difference between a static property or method and an instance property or method in PHP? PHP › OOPPHPOOPIntermediate
91How do trait properties and static properties behave when a trait is used by multiple different classes, and is that state actually shared between them? PHP › TraitsPHPTraitsIntermediate
92What is the arrange act assert pattern, and how does structuring a test around these three distinct steps make tests clearer and easier to understand? PHP › Unit Testing with PHPUnitPHPUnit Testing with PHPUnitIntermediate
93What does 'live binding' mean for ES Module exports, and how does it differ from CommonJS? JavaScript › ES ModulesJavaScriptES ModulesAdvanced
94How do you implement subcommands (like 'git commit' or 'git push') using argparse's add_subparsers()? Python › Command-Line Interfaces (argparse)PythonCommand-Line Interfaces (argparse)Advanced
95How would you use Python 3.10+'s kw_only=True (or per-field kw_only) to require dataclass fields be passed as keyword arguments only? Python › Dataclasses & NamedTuplesPythonDataclasses & NamedTuplesAdvanced
96How do you stack MULTIPLE decorators on the same function, and in what order do they actually execute? Python › DecoratorsPythonDecoratorsAdvanced
97How does Python resolve circular imports, and what strategies avoid the resulting ImportError? Python › Modules & PackagingPythonModules & PackagingAdvanced
98How does the module search and caching system handle submodule imports like `import package.subpackage.module`? Python › Modules & PackagingPythonModules & PackagingAdvanced
99How does cooperative multiple inheritance require every class in the hierarchy to call super() consistently, even in __init__? Python › Multiple Inheritance & MROPythonMultiple Inheritance & MROAdvanced
100How would you design a mixin to be safely combinable with any base class's __init__ signature using **kwargs? Python › Multiple Inheritance & MROPythonMultiple Inheritance & MROAdvanced
101How does PHP handle array copying behavior, and when do arrays actually get passed by reference instead of by value? PHP › Arrays in PHPPHPArrays in PHPAdvanced
102How do data providers in PHPUnit let you run the exact same test logic repeatedly against many different sets of input data, without duplicating the test method itself? PHP › Unit Testing with PHPUnitPHPUnit Testing with PHPUnitAdvanced
103How does test driven development, commonly abbreviated as TDD, change the typical order in which tests and actual implementation code are written, and what benefits does this workflow claim to offer? PHP › Unit Testing with PHPUnitPHPUnit Testing with PHPUnitAdvanced