Tag view

#functions

Cross-subject tag search for related interview cards.

Clear

Results update as you type. Press / to jump straight into search.

Tagged with functions

9 cards

Python Medium Theory

Return values, multiple return values, function annotations, and docstrings

Python functions can return any object, often pack multiple results into a tuple, and may document intent through annotations and docstrings.

  • Multiple returns are tuple packing
  • Annotations describe intent, not runtime enforcement by default
  • Docstrings explain usage and behavior

Return values, multiple return values, function annotations, and docstrings

Python Easy Theory

What is a decorator?

A decorator wraps another callable to add behavior without changing the original function body.

  • Starts with a callable
  • Usually returns a wrapper
  • Common for logging, auth, caching

What is a decorator?

JavaScript Medium Theory

Function declarations, function expressions, arrow functions, default parameters, rest parameters, callbacks, higher-order functions, first-class functions, IIFE, and pure functions

JavaScript functions are first-class values, which is why callbacks, higher-order utilities, and different function forms all matter.

  • Declarations and expressions behave differently
  • Arrow functions change `this` behavior
  • Pure functions avoid hidden side effects

Function declarations, function expressions, arrow functions, default parameters, rest parameters, callbacks, higher-order functions, first-class functions, IIFE, and pure functions

JavaScript Hard Theory

Recursion, memoization, currying, debounce, and throttle in JavaScript

These patterns solve different problems: recursion for self-referential logic, memoization for caching, currying for partial application, and debounce or throttle for rate control.

  • Memoization trades memory for repeated-speed gains
  • Debounce waits for quiet time
  • Throttle limits call frequency

Recursion, memoization, currying, debounce, and throttle in JavaScript

JavaScript Medium Theory

The this keyword in global scope, methods, regular functions, arrow functions, and call/apply/bind

`this` depends on how a function is called, and `call`, `apply`, and `bind` let you control that context explicitly.

  • Arrow functions do not create their own `this`
  • Method calls bind `this` to the receiver
  • `bind` returns a new function

The this keyword in global scope, methods, regular functions, arrow functions, and call/apply/bind