Skip to main content

Coding Tests

Technical documentation and advanced features for creating and managing coding tests in ByteXL.

1. Readonly Sections in Tests

In Tests sometimes we want to make some part of the code readonly so that we can enforce functions calling or strict data structure usage etc.

To achieve this we need to annotate the Stub code with the following boundaries:

.
.
.
Code that is not editable
.
.
.
// start your solution


// end your solution
.
.
.
Code that is not editable
.
.
.

Supported Blocks

For Python and other languages using # for comments:

# start your solution

# end your solution

For Java, C, C++, JavaScript and other languages using // for comments:

// start your solution

// end your solution

Readonly Blocks

note

We support only one editable section as of now.

Example Usage

Python Example:

def calculate_sum(a, b):
"""This function is readonly"""
# start your solution

# Write your code here

# end your solution
return result

Java Example:

public class Solution {
// This method signature is readonly
public int solve(int n) {
// start your solution

// Write your code here

// end your solution
}
}

This feature ensures that students cannot modify critical parts of the code structure while still allowing them to implement their solutions in the designated areas.