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.

Note: A wide variety of file types can be attached as custom files, but image file types (.jpg, .png, .pdf, etc) will not render as images in the pad. The file bytecode will be displayed. If you wish to show images to a candidate, include it in the candidate instructions using Markdown instead.

Create custom file

Upload a custom file to CoderPad for use in an interview question. Click ‘Files’ in the left-side navigation bar. 

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 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

with open('./data/test.csv', 'w') as f: print >> f, 'Filename:', filename # Python 2.x print('Filename:', filename, file=f) # Python 3.x
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: