All fields

“Arrays” in Information Technology

117 questions across 10 technologies.

Information Technology

117 questions in 10 technologies

#QuestionTechnologyTopicLevel
1What is an array in PHP and what types of arrays does PHP support? PHP › Arrays in PHPPHPArrays in PHPBeginner
2How do multidimensional arrays work in Java, and how do they differ from truly rectangular arrays in languages like C? Java › Arrays & Multidimensional ArraysJavaArrays & Multidimensional ArraysIntermediate
3What utility methods does java.util.Arrays provide for common array operations like sorting, searching, filling, and comparing? Java › Arrays & Multidimensional ArraysJavaArrays & Multidimensional ArraysIntermediate
4How 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
5What 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
6How do you sort arrays in PHP, and what is the difference between functions like sort, asort, and usort? PHP › Arrays in PHPPHPArrays in PHPIntermediate
7Why can array holes (sparse arrays) behave unexpectedly with iteration methods? JavaScript › Arrays & Array MethodsJavaScriptArrays & Array MethodsAdvanced
8How does Java implement covariant array typing, and why is this considered a design flaw that can lead to runtime ArrayStoreException? Java › Arrays & Multidimensional ArraysJavaArrays & Multidimensional ArraysAdvanced
9How would you efficiently copy, resize, or merge large arrays in Java, and what are the performance trade-offs between System.arraycopy(), Arrays.copyOf(), and manual loops? Java › Arrays & Multidimensional ArraysJavaArrays & Multidimensional ArraysAdvanced
10How does the JVM lay out array objects in memory, including the array header overhead, and how does this affect memory efficiency for very large arrays of primitives versus boxed wrapper types? Java › Arrays & Multidimensional ArraysJavaArrays & Multidimensional ArraysAdvanced
11How do you merge, combine, and compare arrays in PHP, and what are the subtle differences between array_merge and the plus operator? PHP › Arrays in PHPPHPArrays in PHPAdvanced
12How 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
13How 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
14How 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
15How 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
16What are the limitations of PHP generators compared to regular arrays, particularly around rewinding and multiple iteration passes? PHP › Generators & IteratorsPHPGenerators & IteratorsAdvanced
17What is the difference between the 'include'/'exclude' arrays and the 'files' array in tsconfig.json for specifying which files are part of the compilation? TypeScript › tsconfig & Compiler OptionsTypeScripttsconfig & Compiler OptionsIntermediate
18How do you work with arrays within a JSON document stored in Redis, such as adding a new item to an existing array? Redis › RedisJSONRedisRedisJSONIntermediate
19How do you destructure nested objects and arrays in one statement? JavaScript › Destructuring, Spread & RestJavaScriptDestructuring, Spread & RestAdvanced
20What's the performance and memory advantage of a generator-based lazy pipeline over building intermediate arrays with map/filter? JavaScript › Iterators & GeneratorsJavaScriptIterators & GeneratorsAdvanced
21How does Python's list implementation achieve amortized O(1) append performance despite lists being dynamically resizable arrays under the hood? Python › Data Types & StructuresPythonData Types & StructuresAdvanced
22How does the configuration binder handle nested objects, arrays, and complex types when binding a JSON section to a C# class? .NET › Configuration & Options.NETConfiguration & OptionsAdvanced
23How does the configuration binder handle nested objects and arrays when binding a JSON section to a strongly-typed C# class? ASP.NET Core › Configuration & Options PatternASP.NET CoreConfiguration & Options PatternAdvanced
24What is an ArrayBuffer in JavaScript? JavaScript › ArrayBuffer, TypedArrays & Binary DataJavaScriptArrayBuffer, TypedArrays & Binary DataBeginner
25How do you convert a TypedArray to a regular JavaScript array? JavaScript › ArrayBuffer, TypedArrays & Binary DataJavaScriptArrayBuffer, TypedArrays & Binary DataIntermediate
26What is a TypedArray and how does it relate to ArrayBuffer? JavaScript › ArrayBuffer, TypedArrays & Binary DataJavaScriptArrayBuffer, TypedArrays & Binary DataBeginner
27Name a few common TypedArray types and their byte sizes. JavaScript › ArrayBuffer, TypedArrays & Binary DataJavaScriptArrayBuffer, TypedArrays & Binary DataBeginner
28What's the difference between map() and forEach()? JavaScript › Arrays & Array MethodsJavaScriptArrays & Array MethodsBeginner
29How does filter() work? JavaScript › Arrays & Array MethodsJavaScriptArrays & Array MethodsBeginner
30What does reduce() do and what are its arguments? JavaScript › Arrays & Array MethodsJavaScriptArrays & Array MethodsBeginner
31What are TypeScript's basic primitive types, and how do you annotate a variable with one? TypeScript › Primitive Types, Arrays & TuplesTypeScriptPrimitive Types, Arrays & TuplesBeginner
32How do you type an array of a specific element type, and what are the two equivalent syntaxes? TypeScript › Primitive Types, Arrays & TuplesTypeScriptPrimitive Types, Arrays & TuplesBeginner
33What is a tuple, and how does it differ from a regular array type? TypeScript › Primitive Types, Arrays & TuplesTypeScriptPrimitive Types, Arrays & TuplesBeginner
34How do you declare and initialize a fixed-size array in C#? C# › Arrays, Span<T> & Memory<T>C#Arrays, Span<T> & Memory<T>Beginner
35How do you create and work with a multidimensional (rectangular) array versus a jagged array? C# › Arrays, Span<T> & Memory<T>C#Arrays, Span<T> & Memory<T>Beginner
36What is Span<T> and what core performance problem does it solve? C# › Arrays, Span<T> & Memory<T>C#Arrays, Span<T> & Memory<T>Beginner
37How do you declare, initialize, and access elements of a one-dimensional array in Java? Java › Arrays & Multidimensional ArraysJavaArrays & Multidimensional ArraysBeginner
38How do you declare and initialize an array of objects (reference types) versus an array of primitives, and what is the key difference in their default values? Java › Arrays & Multidimensional ArraysJavaArrays & Multidimensional ArraysBeginner
39How do you add, remove, and access elements within a PHP array? PHP › Arrays in PHPPHPArrays in PHPBeginner
40What is a DataView and when would you use it over a TypedArray? JavaScript › ArrayBuffer, TypedArrays & Binary DataJavaScriptArrayBuffer, TypedArrays & Binary DataIntermediate
41What's the difference between slice() and subarray() on a TypedArray? JavaScript › ArrayBuffer, TypedArrays & Binary DataJavaScriptArrayBuffer, TypedArrays & Binary DataIntermediate
42What's the difference between splice() and slice()? JavaScript › Arrays & Array MethodsJavaScriptArrays & Array MethodsIntermediate
43How do find() and findIndex() differ from filter()? JavaScript › Arrays & Array MethodsJavaScriptArrays & Array MethodsIntermediate
44What does Array.isArray() solve that typeof can't? JavaScript › Arrays & Array MethodsJavaScriptArrays & Array MethodsIntermediate
45How do you make a tuple element optional, and how does that affect the tuple's minimum required length? TypeScript › Primitive Types, Arrays & TuplesTypeScriptPrimitive Types, Arrays & TuplesIntermediate
46How do labeled tuple elements improve readability and editor tooling compared to unlabeled tuples? TypeScript › Primitive Types, Arrays & TuplesTypeScriptPrimitive Types, Arrays & TuplesIntermediate
47How does a rest element work within a tuple type, like `[string, ...number[]]`? TypeScript › Primitive Types, Arrays & TuplesTypeScriptPrimitive Types, Arrays & TuplesIntermediate
48How does Memory<T> differ from Span<T>, and when would you use Memory<T> instead? C# › Arrays, Span<T> & Memory<T>C#Arrays, Span<T> & Memory<T>Intermediate
49How do you slice an array or string efficiently without allocating a new array/string, using Span<T> or ReadOnlySpan<T>? C# › Arrays, Span<T> & Memory<T>C#Arrays, Span<T> & Memory<T>Intermediate
50What restrictions does the C# compiler enforce on Span<T> because it's a 'ref struct'? C# › Arrays, Span<T> & Memory<T>C#Arrays, Span<T> & Memory<T>Intermediate
51How does Java handle array bounds checking, and what exception is thrown when accessing an invalid index? Java › Arrays & Multidimensional ArraysJavaArrays & Multidimensional ArraysIntermediate
52How do you correctly iterate a 2D array using both traditional indexed for-loops and the enhanced for-each loop, and when is each approach preferable? Java › Arrays & Multidimensional ArraysJavaArrays & Multidimensional ArraysIntermediate
53How 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
54How 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
55What 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
56How do you share an ArrayBuffer between a Web Worker and the main thread without copying it? JavaScript › ArrayBuffer, TypedArrays & Binary DataJavaScriptArrayBuffer, TypedArrays & Binary DataAdvanced
57How does BigInt64Array differ from a standard numeric TypedArray? JavaScript › ArrayBuffer, TypedArrays & Binary DataJavaScriptArrayBuffer, TypedArrays & Binary DataAdvanced
58How can you grow an ArrayBuffer after it's been created? JavaScript › ArrayBuffer, TypedArrays & Binary DataJavaScriptArrayBuffer, TypedArrays & Binary DataAdvanced
59How do you handle out-of-range writes to a TypedArray safely? JavaScript › ArrayBuffer, TypedArrays & Binary DataJavaScriptArrayBuffer, TypedArrays & Binary DataAdvanced
60How does sort() compare values by default, and how do you fix numeric sorting? JavaScript › Arrays & Array MethodsJavaScriptArrays & Array MethodsAdvanced
61What is the difference between flat() and flatMap()? JavaScript › Arrays & Array MethodsJavaScriptArrays & Array MethodsAdvanced
62How do you efficiently remove duplicate values from an array? JavaScript › Arrays & Array MethodsJavaScriptArrays & Array MethodsAdvanced
63How does TypeScript infer a tuple type versus a regular array type from an array literal, and how do 'as const' assertions change this? TypeScript › Primitive Types, Arrays & TuplesTypeScriptPrimitive Types, Arrays & TuplesAdvanced
64How would you write a generic type that extracts the length of a tuple type at compile time? TypeScript › Primitive Types, Arrays & TuplesTypeScriptPrimitive Types, Arrays & TuplesAdvanced
65How do variadic tuple types (using generic rest elements) let you build type-safe function composition or concat utilities? TypeScript › Primitive Types, Arrays & TuplesTypeScriptPrimitive Types, Arrays & TuplesAdvanced
66How does readonly interact with tuple types, and what does `readonly [number, number]` prevent compared to a mutable tuple? TypeScript › Primitive Types, Arrays & TuplesTypeScriptPrimitive Types, Arrays & TuplesAdvanced
67How would you use conditional types together with tuples to implement a type-safe 'head' and 'tail' extraction, similar to array destructuring at the type level? TypeScript › Primitive Types, Arrays & TuplesTypeScriptPrimitive Types, Arrays & TuplesAdvanced
68How does 'stackalloc' work together with Span<T> to allocate memory on the stack instead of the heap? C# › Arrays, Span<T> & Memory<T>C#Arrays, Span<T> & Memory<T>Advanced
69How would you write a high-performance CSV field parser using ReadOnlySpan<char> that avoids all intermediate string allocations? C# › Arrays, Span<T> & Memory<T>C#Arrays, Span<T> & Memory<T>Advanced
70How does the modern .NET Span-based string.Split (via MemoryExtensions) or manual span-splitting reduce garbage collection pressure compared to string.Split()? C# › Arrays, Span<T> & Memory<T>C#Arrays, Span<T> & Memory<T>Advanced
71How would you use Span<T> to implement an in-place array reversal or sorting algorithm without allocating a temporary array? C# › Arrays, Span<T> & Memory<T>C#Arrays, Span<T> & Memory<T>Advanced
72How would you implement an efficient in-place algorithm on a 2D array, such as rotating a matrix 90 degrees, while minimizing extra memory allocation? Java › Arrays & Multidimensional ArraysJavaArrays & Multidimensional ArraysAdvanced
73How 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
74How 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
75What is the role of Span<T> and Memory<T> in .NET, and why can't Span<T> be used inside an async method? C# › Arrays, Span<T> & Memory<T>C#Arrays, Span<T> & Memory<T>Advanced
76What is console.table() useful for? JavaScript › Debugging, Testing & ToolingJavaScriptDebugging, Testing & ToolingBeginner
77How do you destructure values out of an array? JavaScript › Destructuring, Spread & RestJavaScriptDestructuring, Spread & RestBeginner
78What does the spread operator (...) do when used on an array? JavaScript › Destructuring, Spread & RestJavaScriptDestructuring, Spread & RestBeginner
79How does a Set differ from an array? JavaScript › Map, Set, WeakMap & WeakSetJavaScriptMap, Set, WeakMap & WeakSetBeginner
80What are some commonly used Math object methods? JavaScript › Numbers, Math & BigIntJavaScriptNumbers, Math & BigIntBeginner
81What is a numeric enum, and what values do its members get by default? TypeScript › EnumsTypeScriptEnumsBeginner
82What is the difference between List<T> and an array (T[]) in terms of resizing? C# › CollectionsC#CollectionsBeginner
83What are the eight primitive data types in Java, and how do they differ fundamentally from reference types like String or a custom class? Java › Java Fundamentals: Syntax, Data Types & OperatorsJavaJava Fundamentals: Syntax, Data Types & OperatorsBeginner
84What are the basic data types available in PHP? PHP › Basics & TypesPHPBasics & TypesBeginner
85What is an anonymous function in PHP, and how does it differ from a regular named function? PHP › Closures & Anonymous FunctionsPHPClosures & Anonymous FunctionsBeginner
86How do you convert a PHP array or object into a JSON formatted string using json_encode? PHP › JSON Handling in PHPPHPJSON Handling in PHPBeginner
87How does SimpleXML let you access nested elements and attributes within an XML document using a natural, object like syntax? PHP › XML Handling in PHPPHPXML Handling in PHPBeginner
88What is Number.MAX_SAFE_INTEGER and what breaks beyond it? JavaScript › Numbers, Math & BigIntJavaScriptNumbers, Math & BigIntIntermediate
89What is BigInt and how do you create one? JavaScript › Numbers, Math & BigIntJavaScriptNumbers, Math & BigIntIntermediate
90What is parameter property shorthand in a constructor, and what does it expand to? TypeScript › Classes: Access Modifiers, Abstract Classes & ImplementsTypeScriptClasses: Access Modifiers, Abstract Classes & ImplementsIntermediate
91What is 'reverse mapping' in numeric enums, and why don't string enums support it? TypeScript › EnumsTypeScriptEnumsIntermediate
92How do computed and constant enum members work when mixing string and numeric-style initialization? TypeScript › EnumsTypeScriptEnumsIntermediate
93How do rest parameters work with type annotations, and what type must the annotation be? TypeScript › Function Types, Overloads & Optional/Default ParametersTypeScriptFunction Types, Overloads & Optional/Default ParametersIntermediate
94How does 'as const' behave differently when applied to an array literal versus a plain object literal? TypeScript › Readonly, const Assertions & ImmutabilityTypeScriptReadonly, const Assertions & ImmutabilityIntermediate
95What 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
96What is the global Buffer class, and how does it relate to the process object's broader role in giving access to system-level capabilities? Node.js › Global Objects & the process ObjectNode.jsGlobal Objects & the process ObjectIntermediate
97What are PHP's comparison operators, and how does the spaceship operator introduced in PHP 7 simplify writing custom comparison logic? PHP › Basics & TypesPHPBasics & TypesIntermediate
98What are arrow functions introduced in PHP 7.4, and how do they simplify writing short closures compared to traditional anonymous functions? PHP › Closures & Anonymous FunctionsPHPClosures & Anonymous FunctionsIntermediate
99What 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
100How does yield from let a generator delegate part of its iteration to another generator or an array, and why is this useful? PHP › Generators & IteratorsPHPGenerators & IteratorsIntermediate
101How do control structures like loops and conditionals work within Blade and Twig templates, and how do they compare to writing the equivalent raw PHP directly inside an HTML file? PHP › Template Engines (Blade & Twig)PHPTemplate Engines (Blade & Twig)Intermediate
102How does the DOM extension provide a more powerful and flexible alternative to SimpleXML when you need to actually modify or construct an XML document rather than only read one? PHP › XML Handling in PHPPHPXML Handling in PHPIntermediate
103What is XPath, and how does it let you query and extract specific elements from an XML document using a powerful, standardized path based query syntax? PHP › XML Handling in PHPPHPXML Handling in PHPIntermediate
104How do you sort an array of strings correctly for a given language using Intl.Collator? JavaScript › Date, Time & Internationalization (Intl API)JavaScriptDate, Time & Internationalization (Intl API)Advanced
105How would you group an array of objects by a property using Map, and how does the newer Object.groupBy() compare? JavaScript › Map, Set, WeakMap & WeakSetJavaScriptMap, Set, WeakMap & WeakSetAdvanced
106How do you create a type-safe iteration over all values of a string enum? TypeScript › EnumsTypeScriptEnumsAdvanced
107How do template literal types interact with number and bigint literal types embedded inside them? TypeScript › Template Literal TypesTypeScriptTemplate Literal TypesAdvanced
108How would you use template literal types to enforce a semantic-versioning-style string format at compile time? TypeScript › Template Literal TypesTypeScriptTemplate Literal TypesAdvanced
109How would you implement a multi-dimensional indexer, like a Matrix class supporting matrix[row, col] syntax? C# › Indexers & Operator OverloadingC#Indexers & Operator OverloadingAdvanced
110What is the Large Object Heap (LOH), and why do objects allocated there behave differently from regular small objects? C# › Memory & Garbage CollectionC#Memory & Garbage CollectionAdvanced
111How would you use ArrayPool<T> to reduce garbage collection pressure in a high-throughput, buffer-allocating hot path? C# › Memory & Garbage CollectionC#Memory & Garbage CollectionAdvanced
112How does Java's integer division and modulo operator behave with negative operands, and how does this differ from the mathematical definition of modulo used in some other contexts (like array indexing wraparound)? Java › Java Fundamentals: Syntax, Data Types & OperatorsJavaJava Fundamentals: Syntax, Data Types & OperatorsAdvanced
113What is a common pitfall when using async/await inside Array.prototype.forEach(), and how do you fix it? Node.js › Async PatternsNode.jsAsync PatternsAdvanced
114How 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
115How do generators help implement memory efficient data processing pipelines, chaining multiple transformation steps together without ever loading an entire dataset into memory at once? PHP › Generators & IteratorsPHPGenerators & IteratorsAdvanced
116How can __clone be used to customize what happens when an object is duplicated using PHP's clone keyword, particularly for handling deep copies of nested objects? PHP › Magic MethodsPHPMagic MethodsAdvanced
117How can regular string concatenation inside a large loop lead to performance problems, and what alternative approaches help avoid this issue when building up very large strings? PHP › Strings & String FunctionsPHPStrings & String FunctionsAdvanced