Ballerina Developer Hiring Guide

Hiring Guide for Ballerina Engineers

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

The Ballerina programming language, introduced by Sanjiva Weerawarana and his team at WSO2 in 2017, is a cloud-native programming language designed for integration. It simplifies the task of writing resilient, secure, and scalable code for network-distributed applications. Ballerina's unique feature is its sequence diagram-based graphical view, which allows developers to visualize their coding logic. The language supports both text and graphical syntaxes making it user-friendly for developers of all skill levels. Sources of this information include WSO2's official website and various tech publications like InfoWorld and TechCrunch.

First 20 minutes

General Ballerina knowledge and experience

The next 20 minutes of the interview should attempt to focus more specifically on the development questions used, and the level of depth and skill the engineer possesses.

How would you use a function in Ballerina?

In Ballerina, a function can be defined using the function keyword followed by a block of code. The function can then be called by its name, followed by parentheses with any required parameters inside.

What are the different types of variables in Ballerina?

Ballerina has several types of variables including: int for integers, float for floating point numbers, string for sequences of characters, boolean for true or false values, and json for JSON values.

How would you create a service in Ballerina?

In Ballerina, a service can be created using the service keyword followed by a block of code that contains a set of resource functions. Each resource function represents a method of the service.

What are the key features of Ballerina?

Some of the key features of Ballerina include: built-in support for JSON and XML, built-in support for services and resource functions, support for streams and tables, and the ability to write concurrent programs with lock-free programming.

How would you define Ballerina?

Ballerina is a statically typed, concurrent programming language, specifically designed for integration. It is simple, easy to write, understand, and has a clean syntax which minimizes the possibility of errors. It is designed to write microservices that integrate APIs.

The hiring guide has been successfully sent to your email address.
Oops! Something went wrong while submitting the form.

What youre looking for early-on

Has the candidate shown an ability to learn new technologies quickly?

The tech field is constantly evolving. The candidate should be able to adapt and learn new technologies quickly to stay relevant.

Does the candidate have experience with concurrent programming?

Ballerina is a concurrent, transactional, and statically-typed programming language. Experience with concurrent programming is therefore important.

Can the candidate effectively communicate their thought process and solutions?

Communication skills are important in a development team. The candidate should be able to explain their thought process and solutions clearly.

Is the candidate familiar with the tools commonly used with Ballerina?

Knowledge of tools such as Ballerina Central, Ballerina Composer, and Ballerina Integrator is important for efficient and effective development.

Has the candidate demonstrated problem-solving skills?

Problem-solving skills are essential for any developer position. The candidate should be able to identify, analyze, and solve problems that may arise during the development process.

Does the candidate have a strong understanding of Ballerina language?

This is crucial as the position requires the candidate to develop using Ballerina. Their understanding of the language will directly impact their ability to perform the job.

Next 20 minutes

Specific Ballerina development questions

The next 20 minutes of the interview should attempt to focus more specifically on the development questions used, and the level of depth and skill the engineer possesses.

How would you use loops in Ballerina?

Loops in Ballerina can be created using the while and foreach statements. The while statement repeatedly executes a block of code as long as a given condition is true, while the foreach statement executes a block of code for each item in a list.

What is the use of the main function in Ballerina?

The main function in Ballerina serves as the entry point of the program. It is the first function that gets executed when a Ballerina program is run.

How would you handle errors in Ballerina?

Errors in Ballerina can be handled using the error type and the check and checkpanic expressions. The error type represents a union of a message string and a map of detail values. The check expression can be used to handle errors at runtime, while the checkpanic expression can be used when we want to panic if an error occurs.

What are the control flow statements in Ballerina?

Ballerina has several control flow statements including: if, else, while, break, continue, and foreach. These can be used to control the flow of execution in a Ballerina program.

Describe the difference between services and functions in Ballerina.

In Ballerina, a service is a collection of network accessible entry points, represented by resource functions. A function, on the other hand, is a reusable piece of code that can be called from anywhere within the program.

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 Ballerina engineer at this point.

At this point, a skilled Ballerina engineer should demonstrate a strong understanding of network distributed systems, concurrency, and transactional integrity. They should also be proficient in using the Ballerina language for microservices orchestration. Red flags include lack of experience in cloud native applications and inability to solve complex problems.

Digging deeper

Code questions

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

What does the following Ballerina code do?

import ballerina/io;

public function main() {
    io:println("Hello, World!");
}

This code prints 'Hello, World!' to the standard output.

What will be the output of the following Ballerina code snippet?

import ballerina/io;

public function main() {
    int a = 10;
    int b = 20;
    io:println(a + b);
}

The output of this code will be '30'. The code adds two integers, 10 and 20, and prints the result.

What does the following Ballerina code do?

import ballerina/io;

public function main() {
    int[] arr = [1, 2, 3, 4, 5];
    arr[2] = 10;
    io:println(arr);
}

This code initializes an integer array with five elements, changes the third element to 10, and then prints the array.

What will be the output of the following Ballerina code snippet?

import ballerina/io;

public function main() {
    worker w1 {
        io:println("Worker 1");
    }
    worker w2 {
        io:println("Worker 2");
    }
}

The output of this code will be 'Worker 1' and 'Worker 2'. However, the order of the output may vary because the two workers run concurrently.

What does the following Ballerina code do?

public type Student object {
    public int age = 0;
    public string name = "";

    public function init(string name, int age) {
        self.name = name;
        self.age = age;
    }
};

This code defines a 'Student' object with two fields, 'age' and 'name', and an 'init' function to initialize these fields.

What will be the output of the following Ballerina code snippet?

import ballerina/io;

public function main() {
    int[] arr = [1, 2, 3, 4, 5];
    int[] arr2 = arr.filter(function (int value) returns boolean {
        return value % 2 == 0;
    });
    io:println(arr2);
}

The output of this code will be '[2, 4]'. The code filters out the even numbers from the array and prints the new array.

Wrap-up questions

Final candidate for Ballerina role questions

The final few interview questions for a Ballerina candidate should typically focus on a combination of technical skills, personal goals, growth potential, team dynamics, and company culture.

How would you use a strand in Ballerina?

In Ballerina, a strand is used to execute a sequence of statements concurrently. The start keyword is used to create a new strand. The sequence of statements to be executed concurrently is specified within curly braces after the start keyword.

Describe the difference between a future and a worker in Ballerina.

In Ballerina, a future represents a single asynchronous computation that can be executed concurrently with other tasks, while a worker is a concurrent execution unit that can execute multiple tasks concurrently.

How would you use a worker in Ballerina?

In Ballerina, a worker can be used to create a concurrent execution unit. The worker keyword is followed by a block of code that represents the task to be executed concurrently.

What are the concurrency constructs in Ballerina?

Ballerina has several concurrency constructs including: workers, futures, and strands. Workers are used for concurrent execution, futures represent a single asynchronous computation, and strands are lightweight threads of execution.

Describe the difference between synchronous and asynchronous communication in Ballerina.

In Ballerina, synchronous communication means that the caller waits for the callee to finish processing before it can continue, while asynchronous communication means that the caller can continue processing other tasks without waiting for the callee to finish.

The hiring guide has been successfully sent to your email address.
Oops! Something went wrong while submitting the form.

Ballerina application related

Product Perfect's Ballerina development capabilities

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