Haskell & Functional Programming Concepts Questions
Haskell language fundamentals and functional programming concepts, including pure functions, immutability, higher-order functions, recursion, lazy evaluation, the type system and type classes, and core FP abstractions such as Functor, Applicative, and Monad (including monadic IO), along with common patterns and idioms used in Haskell programming.
EasyTechnical
27 practiced
Define a simple binary tree ADT in Haskell:Implement an inorder traversal `inorder :: Tree a -> [a]` that returns the values in-order. Explain how ADTs make pattern matching and structural recursion straightforward in Haskell.
haskell
data Tree a = Leaf | Node (Tree a) a (Tree a)MediumTechnical
26 practiced
Explain what a lens is and why it's useful for updating deeply nested immutable structures. Implement a minimal manual lens for a simple record type (no external library): create `get` and `set` functions for a nested field and show how to compose them.
MediumTechnical
28 practiced
Explain higher-kinded types (types that take type constructors as parameters) in Haskell. Use `Functor`'s kind `* -> *` as an example and show a small example of a typeclass that requires `* -> * -> *` kinds (e.g., `Bifunctor`).
HardTechnical
27 practiced
Implement a bounded worker pool in Haskell that processes tasks concurrently: use `async` or `forkIO` plus a bounded `TChan`/`TBQueue` for job queueing, spawn N workers, support graceful shutdown, and allow cancellation of in-flight tasks. Provide code sketches and discuss how you'll handle exceptions and resource cleanup.
HardTechnical
24 practiced
Use GADTs to define a strongly-typed expression AST in Haskell that encodes result types, for example `Expr a` with constructors for integer literals, boolean literals, addition (only for ints), and equality (produces Bool). Implement an evaluator `eval :: Expr a -> a` that is statically guaranteed not to produce type errors.
Unlock Full Question Bank
Get access to hundreds of Haskell & Functional Programming Concepts interview questions and detailed answers.
Sign in to ContinueJoin thousands of developers preparing for their dream job.