All fields

“Collections” in Information Technology

123 questions across 8 technologies.

Information Technology

123 questions in 8 technologies

#QuestionTechnologyTopicLevel
1How does the 'yield return'-based lazy evaluation of collections (like LINQ or a custom iterator) differ from eagerly materializing a full collection, in terms of memory usage? C# › CollectionsC#CollectionsAdvanced
2How do you efficiently update large observable collections? .NET MAUI › Advanced Data Binding & Collections.NET MAUIAdvanced Data Binding & CollectionsAdvanced
3How do you efficiently update large observable collections? .NET MAUI › Advanced Data Binding & Collections.NET MAUIAdvanced Data Binding & CollectionsAdvanced
4What is the Java Collections Framework, and what are the core interfaces (List, Set, Map, Queue) at its foundation? Java › Collections FrameworkJavaCollections FrameworkBeginner
5What is the difference between fail-fast and fail-safe iterators in the Collections Framework, and which collections use each? Java › Collections FrameworkJavaCollections FrameworkIntermediate
6What are the immutable collection factory methods (List.of(), Set.of(), Map.of()) introduced in Java 9, and how do they differ from Collections.unmodifiableList()? Java › Collections FrameworkJavaCollections FrameworkIntermediate
7What is the purpose of the Collections utility class's synchronization wrappers (Collections.synchronizedList(), etc.), and how do they differ from genuinely concurrent collections like ConcurrentHashMap? Java › Collections FrameworkJavaCollections FrameworkIntermediate
8How do commonly used higher order collection methods, such as map, where, and reduce, let you transform and filter Dart collections in a clean, declarative style? Flutter › Dart Collections & GenericsFlutterDart Collections & GenericsIntermediate
9What are unmodifiable and immutable collections in Dart, and why might you deliberately choose to use one instead of a regular mutable collection in certain parts of your code? Flutter › Dart Collections & GenericsFlutterDart Collections & GenericsIntermediate
10How does the Collections Framework's fail-fast modCount mechanism actually work internally, and why is it described as "best-effort" rather than a strict guarantee? Java › Collections FrameworkJavaCollections FrameworkAdvanced
11What is the difference between collections.deque and a regular list for queue-like operations? Python › Data Types & StructuresPythonData Types & StructuresIntermediate
12How do you safely update collections bound to the UI from background threads? .NET MAUI › Concurrency & Threading.NET MAUIConcurrency & ThreadingAdvanced
13How do you safely update collections bound to the UI from background threads? .NET MAUI › Concurrency & Threading.NET MAUIConcurrency & ThreadingAdvanced
14How would you use collections.Counter to efficiently count occurrences and find the most common elements in a large dataset? Python › Data Types & StructuresPythonData Types & StructuresAdvanced
15How do you create a simple immutable record using collections.namedtuple? Python › Dataclasses & NamedTuplesPythonDataclasses & NamedTuplesBeginner
16How does typing.NamedTuple differ from collections.namedtuple in terms of syntax and type annotation support? Python › Dataclasses & NamedTuplesPythonDataclasses & NamedTuplesIntermediate
17What is LINQ, and how does it simplify querying collections compared to writing manual loops? C# › LINQC#LINQIntermediate
18What is the NgRx Entity library, and how does it simplify managing collections of data, like a list of users? Angular › NgRx State ManagementAngularNgRx State ManagementIntermediate
19How does structural (deep) equality for collections work, and why doesn't List<T>.Equals() perform element-by-element comparison by default? C# › Equality: Equals, GetHashCode & IEquatableC#Equality: Equals, GetHashCode & IEquatableAdvanced
20How does __instancecheck__ and __subclasscheck__ on a metaclass enable 'virtual subclassing' as used by collections.abc? Python › Metaclasses & Class CustomizationPythonMetaclasses & Class CustomizationAdvanced
21What are the internal memory encoding optimizations Redis applies to small collections, and how do they affect performance and memory usage? Redis › Data TypesRedisData TypesAdvanced
22How should you structure Firestore data using subcollections and denormalization to design efficient queries, given that Firestore does not support traditional relational joins across separate collections? Flutter › Cloud Firestore & Firebase StorageFlutterCloud Firestore & Firebase StorageAdvanced
23When would you use a List<T> vs an array? C# › CollectionsC#CollectionsBeginner
24When should you use a Dictionary<TKey,TValue>? C# › CollectionsC#CollectionsBeginner
25What is the difference between List<T> and an array (T[]) in terms of resizing? C# › CollectionsC#CollectionsBeginner
26What is the difference between Dictionary<TKey, TValue> and List<T> in terms of lookup performance? C# › CollectionsC#CollectionsBeginner
27What is the difference between IEnumerable, ICollection and IList? C# › CollectionsC#CollectionsIntermediate
28What does HashSet<T> provide and when do you use it? C# › CollectionsC#CollectionsIntermediate
29When would you choose a HashSet<T> over a List<T>, and what guarantee does it provide? C# › CollectionsC#CollectionsIntermediate
30How does Queue<T> differ from Stack<T> in terms of the order items are removed? C# › CollectionsC#CollectionsIntermediate
31What is the difference between IEnumerable<T>, ICollection<T>, and IList<T> in the collection interface hierarchy? C# › CollectionsC#CollectionsIntermediate
32When would you reach for a ConcurrentDictionary or an immutable collection? C# › CollectionsC#CollectionsAdvanced
33How do you avoid multiple enumeration of an IEnumerable? C# › CollectionsC#CollectionsAdvanced
34How does Dictionary<TKey,TValue> handle hash collisions internally, and why does a poor GetHashCode() implementation degrade its performance? C# › CollectionsC#CollectionsAdvanced
35What is the performance and thread-safety difference between ConcurrentDictionary<TKey,TValue> and a regular Dictionary<TKey,TValue> guarded by a manual lock? C# › CollectionsC#CollectionsAdvanced
36How would you choose between List<T>, LinkedList<T>, and ImmutableList<T> based on their different Big-O characteristics for common operations? C# › CollectionsC#CollectionsAdvanced
37How would you implement a custom, strongly-typed, read-only wrapper around a mutable collection to safely expose it from a class's public API? C# › CollectionsC#CollectionsAdvanced
38What is ObservableCollection and why use it for lists? .NET MAUI › Advanced Data Binding & Collections.NET MAUIAdvanced Data Binding & CollectionsBeginner
39What is ObservableCollection and why use it for lists? .NET MAUI › Advanced Data Binding & Collections.NET MAUIAdvanced Data Binding & CollectionsBeginner
40How do you bind to nested properties and handle null paths safely? .NET MAUI › Advanced Data Binding & Collections.NET MAUIAdvanced Data Binding & CollectionsIntermediate
41What is RelativeSource binding and when do you need it? .NET MAUI › Advanced Data Binding & Collections.NET MAUIAdvanced Data Binding & CollectionsIntermediate
42How do you implement input validation with data binding? .NET MAUI › Advanced Data Binding & Collections.NET MAUIAdvanced Data Binding & CollectionsIntermediate
43How do you bind to nested properties and handle null paths safely? .NET MAUI › Advanced Data Binding & Collections.NET MAUIAdvanced Data Binding & CollectionsIntermediate
44What is RelativeSource binding and when do you need it? .NET MAUI › Advanced Data Binding & Collections.NET MAUIAdvanced Data Binding & CollectionsIntermediate
45How do you implement input validation with data binding? .NET MAUI › Advanced Data Binding & Collections.NET MAUIAdvanced Data Binding & CollectionsIntermediate
46How do you implement grouping in a CollectionView? .NET MAUI › Advanced Data Binding & Collections.NET MAUIAdvanced Data Binding & CollectionsAdvanced
47How do you implement grouping in a CollectionView? .NET MAUI › Advanced Data Binding & Collections.NET MAUIAdvanced Data Binding & CollectionsAdvanced
48What is the difference between the Iterable and Iterator interfaces, and how does the enhanced for-each loop rely on them? Java › Collections FrameworkJavaCollections FrameworkBeginner
49What are the three main built in collection types in Dart, List, Set, and Map, and what makes each one uniquely suited for a different kind of data storage need? Flutter › Dart Collections & GenericsFlutterDart Collections & GenericsBeginner
50What are generics in Dart, and how does declaring a collection like List<String> let the Dart compiler catch type related mistakes before your code even runs? Flutter › Dart Collections & GenericsFlutterDart Collections & GenericsBeginner
51What are the key performance differences between ArrayList and LinkedList for common operations (random access, insertion/removal at various positions), and when would you choose one over the other? Java › Collections FrameworkJavaCollections FrameworkIntermediate
52What is the contract between equals() and hashCode() that a custom class must satisfy to work correctly as a HashMap key or HashSet element? Java › Collections FrameworkJavaCollections FrameworkIntermediate
53What is the purpose of the Deque interface, and how does it unify both stack (LIFO) and queue (FIFO) behavior in a single interface? Java › Collections FrameworkJavaCollections FrameworkIntermediate
54How does PriorityQueue work internally (as a binary heap), and what ordering does it use by default versus with a custom Comparator? Java › Collections FrameworkJavaCollections FrameworkIntermediate
55How do you create a custom generic class in Dart, and why would a generic class be preferable to writing several nearly identical, separate classes each hardcoded for a different specific type? Flutter › Dart Collections & GenericsFlutterDart Collections & GenericsIntermediate
56How does HashMap's internal implementation work (hashing, bucket array, treeification), and how did its collision-handling strategy change in Java 8? Java › Collections FrameworkJavaCollections FrameworkAdvanced
57How do you choose between HashMap, LinkedHashMap, and TreeMap based on their different ordering guarantees and performance characteristics? Java › Collections FrameworkJavaCollections FrameworkAdvanced
58How does TreeMap/TreeSet's red-black tree implementation guarantee O(log n) operations, and what role does the Comparable/Comparator interface play in maintaining sorted order? Java › Collections FrameworkJavaCollections FrameworkAdvanced
59How would you implement a custom Comparator with multiple sort criteria (e.g., sort by last name, then by first name as a tiebreaker) using the Comparator.comparing() and thenComparing() fluent API? Java › Collections FrameworkJavaCollections FrameworkAdvanced
60How would you choose the correct initial capacity for a HashMap to avoid unnecessary resizing overhead, given the relationship between capacity, load factor, and resize threshold? Java › Collections FrameworkJavaCollections FrameworkAdvanced
61How do bounded type parameters, using the extends keyword within a generic class definition, let you constrain a generic type to only accept types that satisfy a specific requirement? Flutter › Dart Collections & GenericsFlutterDart Collections & GenericsAdvanced
62What are the performance and memory tradeoffs between using a List, a LinkedHashMap, and a HashSet in Dart when working with a genuinely very large collection of data? Flutter › Dart Collections & GenericsFlutterDart Collections & GenericsAdvanced
63How do you declare and initialize a fixed-size array in C#? C# › Arrays, Span<T> & Memory<T>C#Arrays, Span<T> & Memory<T>Beginner
64How do you declare a generic class with a type parameter, and how do you instantiate it with a specific type? C# › GenericsC#GenericsBeginner
65What is an indexer, and how does it let a custom class support square-bracket syntax like an array? C# › Indexers & Operator OverloadingC#Indexers & Operator OverloadingBeginner
66Why is a method using 'yield return' considered LAZY, and what does that mean for when its code actually executes? C# › Iterators & yield returnC#Iterators & yield returnBeginner
67How do you declare, initialize, and access elements of a one-dimensional array in Java? Java › Arrays & Multidimensional ArraysJavaArrays & Multidimensional ArraysBeginner
68How do you retrieve all constants of an enum type, and how would you iterate over them? Java › EnumsJavaEnumsBeginner
69What is the default behavior of equals() and hashCode() inherited from Object, and why is it usually necessary to override them for value-based classes? Java › equals(), hashCode() & toString() ContractsJavaequals(), hashCode() & toString() ContractsBeginner
70What is the recommended way to combine multiple field values into a single hashCode() implementation, following the common formula used by IDE-generated code? Java › equals(), hashCode() & toString() ContractsJavaequals(), hashCode() & toString() ContractsBeginner
71What does it mean for an object to be 'eligible for garbage collection' in terms of reachability from GC roots? Java › Garbage CollectionJavaGarbage CollectionBeginner
72What problem do generics solve compared to using raw types (like a pre-Java-5 List without a type parameter), and how do they improve compile-time type safety? Java › GenericsJavaGenericsBeginner
73What are the basic variable declaration keywords in Dart, specifically var, final, and const, and how do they differ from each other? Flutter › Dart Language Basics & SyntaxFlutterDart Language Basics & SyntaxBeginner
74What is null safety in Dart, and how does it help prevent a common category of runtime error known as a null reference exception? Flutter › Dart Null SafetyFlutterDart Null SafetyBeginner
75What is a Hive box, and how does it function as the basic fundamental storage unit specifically used for actually storing and retrieving your own particular data? Flutter › Hive & NoSQL Local StorageFlutterHive & NoSQL Local StorageBeginner
76What is JSON serialization and deserialization, and how do Dart's own built in jsonEncode and jsonDecode functions let you convert genuinely freely between a Dart object and its own corresponding JSON text representation? Flutter › JSON Serialization & DeserializationFlutterJSON Serialization & DeserializationBeginner
77Why is my CollectionView not updating when data changes? .NET MAUI › Troubleshooting & Common Errors.NET MAUITroubleshooting & Common ErrorsIntermediate
78Why is my CollectionView not updating when data changes? .NET MAUI › Troubleshooting & Common Errors.NET MAUITroubleshooting & Common ErrorsIntermediate
79How do you correctly override Equals() and GetHashCode() together on a class, and why must they always be overridden as a pair? C# › Equality: Equals, GetHashCode & IEquatableC#Equality: Equals, GetHashCode & IEquatableIntermediate
80How does HashCode.Combine() help you write a correct and well-distributed GetHashCode() implementation? C# › Equality: Equals, GetHashCode & IEquatableC#Equality: Equals, GetHashCode & IEquatableIntermediate
81What is 'deferred execution' in LINQ, and how does it differ from calling .ToList() or .ToArray() immediately? C# › LINQC#LINQIntermediate
82How do GroupBy() and its resulting IGrouping<TKey, TElement> work? C# › LINQC#LINQIntermediate
83What utility methods does java.util.Arrays provide for common array operations like sorting, searching, filling, and comparing? Java › Arrays & Multidimensional ArraysJavaArrays & Multidimensional ArraysIntermediate
84How do you convert between an array and a List (ArrayList) in both directions, and what pitfalls exist with Arrays.asList()? Java › Arrays & Multidimensional ArraysJavaArrays & Multidimensional ArraysIntermediate
85What is array covariance's relationship to generic arrays, and why can't you directly create a generic array like new T[10] or new List<String>[10]? Java › Arrays & Multidimensional ArraysJavaArrays & Multidimensional ArraysIntermediate
86How would you flatten a 2D array into a 1D array, and conversely, reshape a 1D array into a 2D array? Java › Arrays & Multidimensional ArraysJavaArrays & Multidimensional ArraysIntermediate
87How does the EnumSet and EnumMap provide more efficient alternatives to HashSet<Enum> and HashMap<Enum, V> specifically for enum keys? Java › EnumsJavaEnumsIntermediate
88What are the five formal properties an equals() implementation must satisfy according to its documented contract (reflexive, symmetric, transitive, consistent, and null-handling)? Java › equals(), hashCode() & toString() ContractsJavaequals(), hashCode() & toString() ContractsIntermediate
89How does Comparable's compareTo() method relate to equals(), and what does it mean for compareTo() to be 'consistent with equals'? Java › equals(), hashCode() & toString() ContractsJavaequals(), hashCode() & toString() ContractsIntermediate
90What is the difference between a Consumer<T> and a BiConsumer<T,U>, and how would you use BiConsumer for operations needing two inputs but no return value, such as Map.forEach()? Java › Functional Interfaces & Method ReferencesJavaFunctional Interfaces & Method ReferencesIntermediate
91What is an unbounded wildcard (List<?>), and when is it more appropriate to use than a bounded generic method with a type parameter <T>? Java › GenericsJavaGenericsIntermediate
92How would you implement a generic Stack<T> class from scratch, demonstrating how a self-contained generic data structure is typically structured? Java › GenericsJavaGenericsIntermediate
93What is a raw type in Java, and why does the compiler still permit using them (with an unchecked warning) despite generics having been available since Java 5? Java › GenericsJavaGenericsIntermediate
94What is the difference between the == operator and the .equals() method when comparing String objects, and why does String's string pool (interning) behavior sometimes make == appear to 'work' for strings? Java › Java Fundamentals: Syntax, Data Types & OperatorsJavaJava Fundamentals: Syntax, Data Types & OperatorsIntermediate
95What are generics in C#, and what specific problems do they solve compared to writing type-specific code? C# › GenericsC#GenericsIntermediate
96What are named parameters and positional parameters in Dart functions, and how does using curly braces to declare parameters as named improve the readability of a function call with many arguments? Flutter › Dart Language Basics & SyntaxFlutterDart Language Basics & SyntaxIntermediate
97What are extension methods in Dart, and how do they let you add new useful functionality directly onto an existing class, including classes you did not originally write yourself, such as Dart's own built in String class? Flutter › Dart Language Basics & SyntaxFlutterDart Language Basics & SyntaxIntermediate
98What do the null aware operators, specifically the null coalescing operator and the null aware access operator, actually do, and how do they let you write more concise code when working with nullable values? Flutter › Dart Null SafetyFlutterDart Null SafetyIntermediate
99How does Dart's late keyword let you declare a non nullable variable that will genuinely be initialized before it is ever actually first used, even though it cannot be given an initial value immediately at the exact point of its declaration? Flutter › Dart Null SafetyFlutterDart Null SafetyIntermediate
100How do provider dependencies and provider composition work in Riverpod, letting one provider genuinely and cleanly depend on the current value of a completely separate other provider? Flutter › Flutter Riverpod Code Generation & ProvidersFlutterFlutter Riverpod Code Generation & ProvidersIntermediate
101How does properly using TextInputFormatter genuinely help restrict or automatically format exactly what a user can actually type into a specific given text field, such as automatically formatting a phone number or restricting input to only numeric digits? Flutter › Forms & Input Validation in FlutterFlutterForms & Input Validation in FlutterIntermediate
102How do you properly store a genuinely fully custom Dart object, rather than simply a basic primitive type, within Hive using a generated TypeAdapter? Flutter › Hive & NoSQL Local StorageFlutterHive & NoSQL Local StorageIntermediate
103How do you properly handle deserializing a genuinely nested JSON structure, such as an order object that itself contains an embedded nested list of individual line item objects, into a properly correctly structured set of nested Dart model classes? Flutter › JSON Serialization & DeserializationFlutterJSON Serialization & DeserializationIntermediate
104How do you actually properly pass genuinely complex data types, such as a Map or a List, between Dart and native code through a platform channel, and what specific limitations genuinely exist regarding exactly what data can actually genuinely be sent? Flutter › Platform Channels (Native Android & iOS Integration)FlutterPlatform Channels (Native Android & iOS Integration)Intermediate
105How does StateNotifierProvider let you properly manage genuinely more complex state that requires several genuinely separate distinct methods for updating it, compared to the considerably simpler StateProvider? Flutter › State Management with RiverpodFlutterState Management with RiverpodIntermediate
106How would you write an efficient LINQ query combining Join() with GroupBy() to replicate a SQL-style LEFT OUTER JOIN with aggregation? C# › LINQC#LINQAdvanced
107How do WeakReference<T> objects work, and in what scenario would you use one instead of a normal strong reference? C# › Memory & Garbage CollectionC#Memory & Garbage CollectionAdvanced
108How do dictionaries maintain insertion order internally since Python 3.7, and what data structure change made this both possible and efficient? Python › Data Types & StructuresPythonData Types & StructuresAdvanced
109How would you implement a custom, resizable dynamic array (similar to ArrayList's internal mechanism) from scratch using a raw Java array, including the amortized doubling growth strategy? Java › Arrays & Multidimensional ArraysJavaArrays & Multidimensional ArraysAdvanced
110How would you implement a memory-efficient sparse matrix representation in Java when a large 2D array would mostly contain zero/default values, avoiding the memory waste of a full dense array? Java › Arrays & Multidimensional ArraysJavaArrays & Multidimensional ArraysAdvanced
111How would you implement a custom compareTo()-based ordering for an enum that differs from its natural declaration-order ordering, given Comparable's default implementation uses ordinal()? Java › EnumsJavaEnumsAdvanced
112Why must hashCode() be overridden whenever equals() is overridden, and what specific, hard-to-diagnose bugs occur in a HashMap when this contract is violated (equals() overridden but hashCode() left as default)? Java › equals(), hashCode() & toString() ContractsJavaequals(), hashCode() & toString() ContractsAdvanced
113How does Java Record's automatically-generated equals(), hashCode(), and toString() implementations work, and in what specific ways do they differ from a manually-written, field-by-field implementation? Java › equals(), hashCode() & toString() ContractsJavaequals(), hashCode() & toString() ContractsAdvanced
114How would you implement equals()/hashCode() correctly for a class containing a mutable field, and why does using such a class as a HashMap key or HashSet element create a serious risk? Java › equals(), hashCode() & toString() ContractsJavaequals(), hashCode() & toString() ContractsAdvanced
115How would you use BiFunction combined with Stream's reduce() to implement a custom aggregation, and how does this relate to the more general concept of a fold operation in functional programming? Java › Functional Interfaces & Method ReferencesJavaFunctional Interfaces & Method ReferencesAdvanced
116How do bounded wildcards (? extends T and ? super T) work, and what does the PECS (Producer Extends, Consumer Super) mnemonic mean for choosing between them? Java › GenericsJavaGenericsAdvanced
117How would you implement a generic class with multiple type parameters and bounded type parameters (like <T extends Comparable<T>>), and what does this specific bound enable? Java › GenericsJavaGenericsAdvanced
118How do generics interact with arrays, and why does the JDK itself sometimes use an unsafe cast (like in ArrayList's internal implementation) to work around the inability to create generic arrays directly? Java › GenericsJavaGenericsAdvanced
119How does variance (covariance, contravariance, invariance) apply differently to Java arrays versus Java generics, and what practical safety trade-off does this design difference represent? Java › GenericsJavaGenericsAdvanced
120How would you implement the classic Iterator design pattern using a private non-static inner class, letting the inner Iterator implementation access the outer collection's private internal state directly? Java › Inner Classes & Anonymous ClassesJavaInner Classes & Anonymous ClassesAdvanced
121How does pattern matching, introduced through Dart's more modern switch expressions and destructuring, let you write more concise and expressive code when handling different possible shapes of data? Flutter › Dart Language Basics & SyntaxFlutterDart Language Basics & SyntaxAdvanced
122What are Dart records, and how do they let you group together several distinct values of potentially different types without needing to first define an entirely separate dedicated class? Flutter › Dart Language Basics & SyntaxFlutterDart Language Basics & SyntaxAdvanced
123How do you properly write parameterized tests that run the exact same test logic against several genuinely different sets of input data, avoiding needing to duplicate that exact same test method several genuinely separate times? Flutter › Unit Testing in FlutterFlutterUnit Testing in FlutterAdvanced