Loading…
0+ curated questions with the same answer shape every time: quick recap, deep dive, pitfalls, and follow-ups. Coverage includes .
Blocks, Procs, and Lambdas are the most-tested Ruby language topic in intermediate and senior interviews. This module covers every angle interviewers probe: block syntax (do/end vs curly braces and their precedence), yield and block_given?, explicit &block capture, converting a method to a proc with &method(:name), Proc.new vs proc vs lambda vs stabby lambda, the four key differences between Proc and Lambda (return behavior, arity enforcement, === and lambda?), closures and captured variables, Proc#curry for partial application, symbol-to-proc shorthand &:method, and functional composition with << and >>. Every answer includes the code shape that makes the difference visible and explains when each form is the right tool.
Full catalog
Topics are ordered for learning. Within each topic, rows are numbered 1–0 globally so you always know where you are. Collapse topics if you want a lighter view — use Expand all when you need the full list again.
Numbers 1–0 follow the order we recommend — click any row to open the full answer, or use the sticky Next link at the bottom of each page to go Q1 → Q0.