All fields

“Functional Programming” in Information Technology

53 questions across 5 technologies.

Information Technology

53 questions in 5 technologies

#QuestionTechnologyTopicLevel
1How do you implement a debounce function using closures, and how is it a functional programming technique? JavaScript › Functional ProgrammingJavaScriptFunctional ProgrammingAdvanced
2How 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
3What does 'immutability' mean and why does functional code favor it? JavaScript › Functional ProgrammingJavaScriptFunctional ProgrammingBeginner
4Why are recursion and immutable data often used together in functional style, instead of loops with mutable counters? JavaScript › Functional ProgrammingJavaScriptFunctional ProgrammingIntermediate
5What is a pure function? JavaScript › Functional ProgrammingJavaScriptFunctional ProgrammingBeginner
6What is a higher-order function? JavaScript › Functional ProgrammingJavaScriptFunctional ProgrammingBeginner
7What is function composition and how do you implement it? JavaScript › Functional ProgrammingJavaScriptFunctional ProgrammingIntermediate
8What is currying and what problem does it solve? JavaScript › Functional ProgrammingJavaScriptFunctional ProgrammingIntermediate
9What does 'referential transparency' mean, and how does it enable optimizations like memoization? JavaScript › Functional ProgrammingJavaScriptFunctional ProgrammingAdvanced
10What are functors and monads, at a practical level, and does JavaScript have native support for them? JavaScript › Functional ProgrammingJavaScriptFunctional ProgrammingAdvanced
11How do you avoid deeply nested, mutation-heavy code when updating nested state immutably? JavaScript › Functional ProgrammingJavaScriptFunctional ProgrammingAdvanced
12What is the difference between functools.cache and functools.lru_cache? Python › functools & Functional Programming ToolsPythonfunctools & Functional Programming ToolsBeginner
13How do you clear or inspect the cache of an lru_cache-decorated function? Python › functools & Functional Programming ToolsPythonfunctools & Functional Programming ToolsAdvanced
14What is the functools module used for in Python? Python › functools & Functional Programming ToolsPythonfunctools & Functional Programming ToolsBeginner
15How do you use functools.partial to fix keyword arguments for logging or callback functions? Python › functools & Functional Programming ToolsPythonfunctools & Functional Programming ToolsBeginner
16How does functools.partial work and when is it useful? Python › functools & Functional Programming ToolsPythonfunctools & Functional Programming ToolsIntermediate
17What does functools.reduce do, and why is it often discouraged in favor of loops? Python › functools & Functional Programming ToolsPythonfunctools & Functional Programming ToolsIntermediate
18How does @functools.wraps preserve metadata when writing decorators? Python › functools & Functional Programming ToolsPythonfunctools & Functional Programming ToolsIntermediate
19How does functools.total_ordering reduce boilerplate for comparison methods? Python › functools & Functional Programming ToolsPythonfunctools & Functional Programming ToolsIntermediate
20What does functools.reduce's initializer argument do, and why should you usually provide one? Python › functools & Functional Programming ToolsPythonfunctools & Functional Programming ToolsIntermediate
21What is the practical difference between using functools.reduce and a plain for-loop for accumulation? Python › functools & Functional Programming ToolsPythonfunctools & Functional Programming ToolsIntermediate
22How does functools.singledispatch enable function overloading based on argument type? Python › functools & Functional Programming ToolsPythonfunctools & Functional Programming ToolsAdvanced
23What is functools.cached_property and how does it differ from @property combined with manual caching? Python › functools & Functional Programming ToolsPythonfunctools & Functional Programming ToolsAdvanced
24Why is caution needed when applying @lru_cache directly to instance methods? Python › functools & Functional Programming ToolsPythonfunctools & Functional Programming ToolsAdvanced
25How does functools.cmp_to_key bridge old-style comparison functions with Python 3's key-based sorting? Python › functools & Functional Programming ToolsPythonfunctools & Functional Programming ToolsAdvanced
26How can functools.lru_cache be used with typed=True, and what does that change? Python › functools & Functional Programming ToolsPythonfunctools & Functional Programming ToolsAdvanced
27What's the difference between map() and forEach()? JavaScript › Arrays & Array MethodsJavaScriptArrays & Array MethodsBeginner
28How does filter() work? JavaScript › Arrays & Array MethodsJavaScriptArrays & Array MethodsBeginner
29What does reduce() do and what are its arguments? JavaScript › Arrays & Array MethodsJavaScriptArrays & Array MethodsBeginner
30What is a unit test and what makes a good one? JavaScript › Debugging, Testing & ToolingJavaScriptDebugging, Testing & ToolingBeginner
31How do you import everything from a module under one namespace object? JavaScript › ES ModulesJavaScriptES ModulesBeginner
32How do find() and findIndex() differ from filter()? JavaScript › Arrays & Array MethodsJavaScriptArrays & Array MethodsIntermediate
33How is the Decorator pattern typically implemented in JavaScript? JavaScript › Design Patterns in JavaScriptJavaScriptDesign Patterns in JavaScriptIntermediate
34How do you assign default values while destructuring? JavaScript › Destructuring, Spread & RestJavaScriptDestructuring, Spread & RestIntermediate
35How does the rest parameter differ from the spread operator, even though they use the same '...' syntax? JavaScript › Destructuring, Spread & RestJavaScriptDestructuring, Spread & RestIntermediate
36How do you write an async context manager more concisely using @contextlib.asynccontextmanager? Python › Async Generators & Async Context ManagersPythonAsync Generators & Async Context ManagersIntermediate
37Why should you use functools.wraps when writing a decorator, and what problem does it solve? Python › DecoratorsPythonDecoratorsIntermediate
38How do you use functools.lru_cache to add memoization to a function with a single decorator? Python › DecoratorsPythonDecoratorsIntermediate
39How does the 'nonlocal' keyword let a nested function modify a variable in its ENCLOSING (not global) scope? Python › Functions & ScopePythonFunctions & ScopeIntermediate
40How does the itertools module complement the iterator protocol? Python › Iterators & the Iterator ProtocolPythonIterators & the Iterator ProtocolIntermediate
41How do comparison magic methods like __lt__, __le__, __gt__, and __ge__ support custom sorting? Python › Magic Methods & Operator OverloadingPythonMagic Methods & Operator OverloadingIntermediate
42What is memoization, and how does it differ from a general-purpose external cache like Redis? Node.js › CachingNode.jsCachingIntermediate
43What is the difference between flat() and flatMap()? JavaScript › Arrays & Array MethodsJavaScriptArrays & Array MethodsAdvanced
44What is the Command pattern and where is it useful in JavaScript apps? JavaScript › Design Patterns in JavaScriptJavaScriptDesign Patterns in JavaScriptAdvanced
45When is it a mistake to force a 'classic' design pattern into idiomatic JavaScript? JavaScript › Design Patterns in JavaScriptJavaScriptDesign Patterns in JavaScriptAdvanced
46What's the performance and memory advantage of a generator-based lazy pipeline over building intermediate arrays with map/filter? JavaScript › Iterators & GeneratorsJavaScriptIterators & GeneratorsAdvanced
47How does LINQ's Aggregate() method work, and how would you use it to implement a custom reduction not covered by Sum()/Average()/Count()? C# › LINQC#LINQAdvanced
48How would you implement a memory-efficient sliding window or batching generator over a large iterable? Python › Comprehensions & GeneratorsPythonComprehensions & GeneratorsAdvanced
49How would you use concurrent.futures.ProcessPoolExecutor together with asyncio to run CPU-bound work without blocking the event loop? Python › Concurrency (asyncio/threading/multiprocessing)PythonConcurrency (asyncio/threading/multiprocessing)Advanced
50How would you efficiently merge two dictionaries in modern Python, and how do the different approaches handle overlapping keys? Python › Data Types & StructuresPythonData Types & StructuresAdvanced
51How do you use functools.partial to create a new function with some arguments pre-filled? Python › Functions & ScopePythonFunctions & ScopeAdvanced
52How 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
53How does itertools.tee let you iterate over the same iterator multiple times independently? Python › Iterators & the Iterator ProtocolPythonIterators & the Iterator ProtocolAdvanced