Docs Index

Doc

Custom Files

Last updated on

CoderPad’s Custom Files feature allows an interviewer to test a candidate’s ability to manipulate data, navigate a file system programmatically, and prove their expertise in a system very similar to what they’ll encounter on the job..

After you have uploaded the files, you can attach them to questions. Typical use-cases for custom files are importing data from CSVs files for analysis, or analyzing log files in text format to aid in debugging exercises.

❗ Image file types (.jpg, .png, .pdf, etc.) will not render as images in the pad. The file bytecode will be displayed instead.

If you wish to show images to a candidate, include it in the candidate instructions using Markdown instead.

Create custom file

To add a custom file for use in an interview question, first click Files in the left-side navigation bar of your dashboard. 

Then click Create File to upload your file. Make sure to give your file a descriptive and recognizable name that you can refer to in the question.

Attach a custom file to a question

Custom Files must be associated with a question in your Question Library. Attach a custom file to a question in Step 2 – Add Code Elements of the question wizard. At this time, only one custom file can be attached per question.

Accessing a file in an interview

During the interview, once a question with an attached file has been loaded, the candidate can access the file from the ./data/ directory. Here are some examples:

Python

f = open('./data/addresses.csv', 'r') print('Filename:', f.name) print(f.read())
Code language: Python (python)

JavaScript

const fs = require("fs"); const csv = fs.readFileSync("./data/test.csv") console.log(csv.toString());
Code language: JavaScript (javascript)

Java

File file = new File("./data/test.csv");
Code language: Java (java)

Ruby

puts File.open('./data/test.csv')
Code language: Ruby (ruby)

☎️ Contact support if you have any problems accessing the files.

Sample files

Feel free to use this sample file as a starting point for trying out Custom Files in CoderPad: