You can generate a boilerplate code that saves you time while setting up a coding question. This boilerplate code or code stub handles the input and output in the code.
Adding code stubs is strongly recommended to prevent wastage of candidates' time because of minor errors pertaining to the input and output format. The pre-generated code stub allows them to focus on the algorithm required to solve the problem instead of the input and output syntax.
The code stub can be automatically generated for most of the languages by specifying the following:
- Function Name: For the automated code stub generation, you can only specify one function. However, if you require more than one function, then you can select the language and manually type the code stub for that particular language.
- Return Type: The return type of a function defines the type of value returned by the function. It can be a string, integer, boolean, long integer, integer array etc.
- Function Parameters: Function parameters are the special variables or input arguments used to refer to a particular data provided as an input. Optionally, you can specify the parameters along with their input type. You can specify more than one function parameter if required.
For example:
Problem Description Write a program that reads in a string and finds the first non-repeated character in that string. Treat the characters as case sensitive. Therefore, "a" and "A" are different. You will be required to complete a given function nonRepeated. Input Format There is one sentence in the input that contains String Str. Constraints
Sample Test Case with Explanation Sample Input
Sample Output
Explanation
Output Format A single character that represents the first character in Str that is not repeated. Code Stub Function Name: nonRepeated Return Type: String Function Parameters Type: String Name: Str |
However, if you expect candidates to be familiar with the handling of input and output, you might choose not to generate any code stubs. Candidates have to write the complete code from scratch in this case.
Currently, you cannot generate code stub automatically for the following languages:
- Cobol
- Fortran
- OCaml
- Racket
- Common Lisp (SBCL)
- VB.NET
- D
- F#
- Groovy
- Pascal
- Rust
- Smalltalk
For these languages, you can type the code stub manually in the editor.
Comments
0 comments
Please sign in to leave a comment.