Hiring guide for PureScript Engineers

PureScript Developer Hiring Guide

PureScript is a strongly-typed, purely functional programming language that compiles to JavaScript. It is designed to be easy to reason about and to facilitate the creation of highly reliable, maintainable, and robust web applications. PureScript features a rich type system that supports higher-kinded types, type inference, and type classes. It also provides seamless interoperability with existing JavaScript code and libraries. The language is heavily influenced by Haskell and aims to maintain a similar syntax and semantics while adapting to the needs of front-end development.

Ask the right questions secure the right PureScript talent among an increasingly shrinking pool of talent.

First 20 minutes

General PureScript app knowledge and experience

The first 20 minutes of the interview should seek to understand the candidate's general background in PureScript application development, including their experience with various programming languages, databases, and their approach to designing scalable and maintainable systems.

How would you define PureScript?
PureScript is a strongly-typed, purely-functional programming language that compiles to JavaScript. It is designed to be easy to reason about and to integrate with existing JavaScript code.
What are the main features of PureScript?
PureScript has many features, including strong static typing, type inference, purely functional, compiles to readable JavaScript, and has easy interoperation with existing JavaScript.
Describe the difference between PureScript and TypeScript.
While both PureScript and TypeScript are statically typed languages that compile to JavaScript, PureScript is a purely functional language, whereas TypeScript is a superset of JavaScript and retains its imperative style. PureScript also has more powerful type features such as higher-kinded types.
How would you use the Maybe type in PureScript?
The Maybe type is used to represent optional values and can be either Just a value or Nothing. It's used to safely handle cases where a value may or may not be present.
What are type classes in PureScript and how would you use them?
Type classes are a way of defining behavior for types. They are similar to interfaces in other languages. You would use them to define a set of functions or behaviors that a type must support.
The hiring guide has been successfully sent to your email address.
Oops! Something went wrong while submitting the form.

What you’re looking for early on

Does the candidate have a solid understanding of PureScript language?
Can they demonstrate experience with functional programming?
Have they shown problem-solving skills?
Are they familiar with using PureScript in a production environment?

Next 20 minutes

Specific PureScript development questions

The next 20 minutes of the interview should focus on the candidate's expertise with specific backend frameworks, their understanding of RESTful APIs, and their experience in handling data storage and retrieval efficiently.

How would you handle side effects in PureScript?
PureScript handles side effects using the Eff monad. This allows side effects to be tracked in the type system, ensuring they are handled correctly.
What is the role of monads in PureScript?
Monads in PureScript, like in other functional languages, are used to handle side effects, manage state, and deal with computation that may fail. They provide a way to sequence operations.
Describe the difference between the Eff and Aff monads in PureScript.
Eff is used for synchronous effects, while Aff is used for asynchronous effects. Aff also supports error handling, making it suitable for more complex scenarios.
How would you handle errors in PureScript?
Errors in PureScript can be handled using the Either type, which represents a value that can be either a Left (error) or a Right (success). This allows for explicit error handling.
What are higher-kinded types and how are they used in PureScript?
Higher-kinded types are types that take other types as arguments. They are used in PureScript to abstract over different kinds of containers, like Maybe or Array.
The hiring guide has been successfully sent to your email address.
Oops! Something went wrong while submitting the form.

The ideal back-end app developer

What you’re looking to see on the PureScript engineer at this point.

At this point, a skilled PureScript engineer should demonstrate strong problem-solving abilities, proficiency in PureScript programming language, and knowledge of software development methodologies. Red flags include lack of hands-on experience, inability to articulate complex concepts, or unfamiliarity with standard coding practices.

Digging deeper

Code questions

These will help you see the candidate's real-world development capabilities with PureScript.

What does this simple PureScript code do?
addTwo :: Int -> Int -> Int
addTwo x y = x + y
This code defines a function called 'addTwo' that takes two integers as parameters and returns their sum.
What does this PureScript syntax do?
type Point = { x :: Number, y :: Number }
This code defines a new type alias 'Point' for a record with two fields 'x' and 'y', both of type Number.
What will be the output of this array manipulation code in PureScript?
import Data.Array (filter)

isEven :: Int -> Boolean
isEven n = n `mod` 2 == 0

filter isEven [1, 2, 3, 4, 5]
This code will output an array of even numbers from the input array. So the output will be [2, 4].
What does this PureScript code related to threading do?
import Effect.Aff (Aff, delay, launchAff_)
import Effect.Aff as Aff
import Effect (Effect)
import Prelude

sleep :: Aff Unit
sleep = delay (Milliseconds 1000.0)

main :: Effect Unit
main = launchAff_ do
  log "Starting..."
  log "Finished!"
This code defines a sleep function that pauses execution for 1000 milliseconds using the 'delay' function from 'Effect.Aff'. The 'main' function launches this asynchronous computation and logs 'Starting...' before the delay and 'Finished!' after the delay.

Wrap-up questions

Final candidate for PureScript Developer role questions

The final few questions should evaluate the candidate's teamwork, communication, and problem-solving skills. Additionally, assess their knowledge of microservices architecture, serverless computing, and how they handle PureScript application deployments. Inquire about their experience in handling system failures and their approach to debugging and troubleshooting.

How would you define a custom operator in PureScript?
Custom operators can be defined in PureScript using the infix keyword. The operator is then available for use in the rest of the module.
What is currying in PureScript and how would you use it?
Currying is the technique of translating the evaluation of a function that takes multiple arguments into evaluating a sequence of functions, each with a single argument. In PureScript, all functions are automatically curried.
How would you handle asynchronous operations in PureScript?
Asynchronous operations in PureScript can be handled using the Aff monad. This allows for asynchronous code to be written in a synchronous style, with proper error handling.

PureScript application related

Product Perfect's PureScript development capabilities

Beyond hiring for your PureScript engineering team, you may be in the market for additional help. Product Perfect provides seasoned expertise in PureScript projects, and can engage in multiple capacities.