Q1. What is the difference between a block, a proc and a lambda?
All three are chunks of code, but they differ in argument checking and how `return` behaves. - A `block` is passed to a method with `do...end` or braces and is not a stan...
Technical Question Bank · Peer-Reviewed
Search and filter frequently asked interview questions across technical, programming, and behavioral domains. Tailor your interview preparation by difficulty for freshers or experienced developers (7 available).
All three are chunks of code, but they differ in argument checking and how `return` behaves. - A `block` is passed to a method with `do...end` or braces and is not a stan...
A higher-order function takes a function as a parameter or returns one. Functions are first-class values with types like `(Int) -> Int`. ```kotlin fun List.myFilter(predi...
A **lambda function** in Python is a small, anonymous (unnamed) function defined using the `lambda` keyword: ### Syntax: `lambda arguments: expression` ```python # Simple...
Python creator Guido van Rossum deliberately designed Python lambda expressions to be restricted to a single expression rather than containing full statements: ### Key Re...
A lambda statement is used to create new function objects and then return them at runtime. Example: my_func=lambdax:x**2 creates a function called my_func that return s t...
An anonymous function is known as a lambda function. This function can have any number of parameters but, can have just one statement. Example: 1 2 a = lambda x,y : x+y p...
Lambda Vs. Def. Def can hold multiple expressions while lambda is a uni-expression function. Def generates a function and designates a name to call it later. Lambda forms...
HireXTech uses essential storage to remember your study preferences and third-party advertising cookies via Google AdSense in compliance with GDPR. You can choose to enable essential cookies only or accept all cookies. Read our Privacy Policy.