Hiring guide for Crystal Engineers

Crystal Developer Hiring Guide

The Crystal programming language, first introduced in 2014 by Ary Borenszweig, Juan Wajnerman and a team of contributors, is a statically-typed, compiled language with syntax similar to Ruby. It is designed to provide the expressiveness of scripting languages with the efficiency and performance of compiled languages. Crystal's unique feature is its powerful type inference which allows developers to write code without specifying types explicitly. The language supports concurrent and parallel execution using fibers for lightweight concurrency while maintaining simplicity in syntax. As an open-source project, it has been developed collaboratively on GitHub by numerous contributors worldwide.

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

First 20 minutes

General Crystal app knowledge and experience

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

How would you define Crystal language?
Crystal is a statically typed, compiled, general-purpose programming language that has syntax similar to Ruby. It's designed to be easy to read and fast to execute.
What are the key features of Crystal language?
Crystal language has several key features including static type checking, C bindings, concurrency model, powerful macro system, and it's compiled.
Describe the difference between Crystal and Ruby.
While Crystal and Ruby have similar syntax, Crystal is statically typed and compiled, which makes it faster. Ruby, on the other hand, is dynamically typed and interpreted.
How would you handle nil values in Crystal?
In Crystal, nil values are handled using the '?' operator. This operator allows a variable to be of a certain type or nil.
What is the concurrency model in Crystal?
Crystal uses a concurrency model called CSP (Communicating Sequential Processes). It uses 'fibers' which are lightweight threads, to achieve concurrency.
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

How comfortable is the candidate with Crystal's syntax and its unique features?
Has the candidate worked on any significant projects using Crystal?
Can the candidate debug and optimize Crystal code?
Does the candidate understand the differences between Crystal and other similar languages?

Next 20 minutes

Specific Crystal 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 define a class in Crystal?
In Crystal, a class is defined using the 'class' keyword followed by the class name. The properties and methods are then defined within the class.
What are macros in Crystal and how would you use them?
Macros in Crystal are powerful tools that allow you to avoid boilerplate code. They are executed at compile time and can generate methods, types, and perform other transformations on the code.
How would you handle exceptions in Crystal?
In Crystal, exceptions are handled using the 'begin', 'rescue', 'ensure', and 'end' keywords. You can define custom exceptions by creating a class that inherits from the 'Exception' class.
What is the difference between '==' and '===' in Crystal?
'==' is used for equality comparison while '===' is used for case equality, or to check if an object belongs to a certain type or range.
How would you implement inheritance in Crystal?
Inheritance in Crystal is implemented using the '<' operator. The child class inherits all the methods and properties of the parent class, and can also override them.
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 Crystal engineer at this point.

At this point, a skilled Crystal engineer should demonstrate strong problem-solving abilities, proficiency in Crystal 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 Crystal.

What does the following Crystal code do?
puts "Hello, World!"
The code prints the string 'Hello, World!' to the console.
What will be the output of the following Crystal code?
x = 10
y = 20
z = (x == y) ? "Equal" : "Not Equal"
puts z
The code checks if x is equal to y. If true, it assigns 'Equal' to z, otherwise 'Not Equal'. The output will be 'Not Equal' because x is not equal to y.
What does the following Crystal code do?
numbers = [1, 2, 3, 4, 5]
numbers.map! { |num| num * 2 }
puts numbers
The code multiplies every number in the 'numbers' array by 2. The 'map!' method modifies the original array. The output will be '[2, 4, 6, 8, 10]'.
What will be the output of the following Crystal code?
spawn do
  puts "Hello from a thread"
puts "Hello from the main thread"
The 'spawn' keyword starts a new concurrent thread. The output will be 'Hello from the main thread' followed by 'Hello from a thread'. However, the exact order of outputs might vary due to concurrency.

Wrap-up questions

Final candidate for Crystal 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 Crystal application deployments. Inquire about their experience in handling system failures and their approach to debugging and troubleshooting.

What are the data types available in Crystal?
Crystal supports several data types including Integers, Floats, Booleans, Strings, Arrays, Hashes, Tuples, Ranges, and more.
How would you create a multidimensional array in Crystal?
In Crystal, a multidimensional array can be created by nesting arrays within an array. Each nested array can be of any length, allowing for non-rectangular arrays.
What is the difference between 'include' and 'extend' in Crystal?
'include' is used to add instance methods to a class, while 'extend' is used to add class methods.

Crystal application related

Product Perfect's Crystal development capabilities

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