InterviewStack.io LogoInterviewStack.io

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.

MediumTechnical
0 practiced
Implement both `foldr` and `foldl` for lists in Haskell with correct type signatures. Then implement a strict version `foldl'` (you may use `seq` or a strictness annotation). Explain why `foldl` can cause space leaks on large inputs while `foldl'` typically avoids them.
HardTechnical
0 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
0 practiced
Implement a simple parser combinator monad from scratch in Haskell (no external libraries). Provide a `Parser a` type, `satisfy` primitive, `char` parser, and implement `Monad` and `Applicative` instances so parsers can be sequenced. Demonstrate parsing a two-digit number.
HardTechnical
0 practiced
Explain the free monad and the tagless-final (aka finally tagless) encoding for building embedded DSLs in Haskell. Discuss trade-offs in terms of ease of defining interpreters, performance, type safety, and testability. Sketch a small DSL for logging with both approaches.
EasyTechnical
0 practiced
Implement the composition operator and `curry`/`uncurry` in Haskell: provide definitions for `(.:)`, `curry'`, and `uncurry'` with correct type signatures. Explain how currying and function composition shape idiomatic Haskell code.

Unlock Full Question Bank

Get access to hundreds of Haskell & Functional Programming Concepts interview questions and detailed answers.

Sign in to Continue

Join thousands of developers preparing for their dream job.