Common Mistakes in Using Codevita Code Evaluation Platform
Short Description
here you can read the mistakes that are being done at the codevita contest-2013 by tcs...
Description
Contents Background ................................................................................................................................................... 2 General algorithm for interacting with CodeVita Platform .......................................................................... 2 Common Mistakes ........................................................................................................................................ 3 1.
Compile-Time Compile-Tim e Errors .................................. ................ ................................... .................................. ................................... ................................... ................................... .................. 3
2.
Run-time Errors ................................. ................ .................................. ................................... ................................... ................................... .................................... .......................... ........ 3
3.
Wrong Answer .................................. ................. .................................. ................................... ................................... ................................... .................................... .......................... ........ 4
Do’s and Don’ts ............................................................................................................................................. 4 Do’s ........................................................................................................................................................... 4 Don’ts ........................................................................................................................................................ 4
Closing Comments ........................................................................................................................................ 5
Tata Consultancy Services
Page 1
Common Mistakes in using CodeVita Code Evaluation Platform: What the participants should and should not do? Background CodeVita code evaluation platform performs automated evaluation of code submitted by participants. There is zero manual intervention. No human user reads the code submitted by the participants. The evaluation is similar to how objective questions are evaluated in competitive exams. For e.g. a competitive exam answer sheet is typically read by OCR (Optical Character Recognition) technology. The software reads the answers marked by the examinee and grades whether the answer is correct or incorrect. Such a technology serves two purposes, 1. It prevents any subjective biases / human errors that human users correcting the papers would bring. 2. The amount of time it will take for humans to evaluate will never make it possible to declare results in a short time. Sheer volumes make it mandatory that the correction process is automated. For CodeVita, TCS follows a similar methodology. The evaluation of code is automatic. No human is involved in code evaluation. Hence it is of paramount importance that participants of CodeVita adhere to the input / output specifications mentioned with each question. If your input or output formats don’t adhere to the specifications, the system will grade it as an incorrect submission.
General algorithm for interacting with CodeVita Platform 1. Ensure that your compilers match the following specifications 2. Ensure that your programming environment is setup on the machine(s) you are using. There is no provision in the CodeVita Platform website to allow users to write the programs. Write your programs in your favourite IDE, use a debugger/ profiler or other tools that you may need, on your own machines. Once the code is completed, save your program as per extensions. You can submit your solutions in any of the 7 allowed languages. You are free to submit even multiple language solutions for the same problem. For e.g. a team may decide that two people will work on the same problem. If these people have different skill-sets they can write solutions in different languages and submit. So let’s say member1 writes a program in C and member2
writes it in Java. Both programs can be submitted. Submit only the source code. 3. All the source code needs to be written in one file itself. Do not split your program in multiple files. If you are programming in Java / C++ / C# do not package them in packages or namespaces 4. As you are already aware, each team member needs to login with their credentials (Ref #, Email ID and Secret Code) 5. Your 6 hour window starts the moment you login for the contest. It will keep ticking even if you decide to take a break and come back later to solve the problem. Be judicious. Use your time effectively.
Now let’s get into the specifics.
Tata Consultancy Services
Page 2
Common Mistakes 1. Compile-Time Errors You will get compile time errors in the following conditions
CodeVita platform treats warnings as errors. If your compiler gives you a warning, the CodeVita platform will treat it as an error and you will get the message “Compile -Time Error” as status for your submission o Common examples of this include – using a deprecated API in Java or main function in C does not return an int. o In short, after compilation – your compiler should give no output after compiling your program. Submit your program only once you have ensured this. The following commands are used for compiling programs at the CodeVita end. o
gcc –Wall –lm $yourfile g++ -Wall –lm $yourfile javac –Xlint $yourfile mcs $yourfile If you are using a compiler different from the ones specified, it is your obligation to see to it the output matches the ones from specified compilers.
Using invalid APIs that don’t work in gcc / g++ / jdk1.6 / .Net Framework 4.0 compilers, will result in compilation errors. For e.g. using functions from conio.h will for C language will result in compilation errors because conio.h does not exist in gcc.
2. Run-time Errors You will get run-time errors in the following circumstances
Once your program is compiled by CodeVita platform after submission, it runs a battery of test cases against your program. These test cases will provide inputs to your programs and capture output from your program. If your program fails to handle the input properly, then it will lead in a run-time error. For e.g. you may have submitted a code to add to matrices of 3x3, but the test case may contain a matrix of any size. If your program fails to handle this constraint, your program will fail with a run-time error. Failing to handle inputs correctly will result in run-time errors. For e.g. when your program is asked to read from a file whose path is provided as an input to your program, not having a mechanism to accept the file path as input or hard-coding a file name in your program will result in a run-time error.
Tata Consultancy Services
Page 3
3. Wrong Answer When the status of your submission is marked as a Wrong Answer, one or more of the following is true
Input handling mechanism of your program is wrong Output specifications are not adhered to Program logic is incorrect and fails one or more test cases
Let’s see some examples
Incorrect input handling – If for Simple Interest Calculations if value of Principle, Rate or Tenure is negative, then the p rogram should output “Invalid Input”. Instead, if somebody actually calculates and outputs negative simple interest, then the program will receive “Wrong Answer”
status message. Incorrect output handling – If the output specification mentions that simple interest should be output as “Simple Interest : ”, then, changing format of the required output such as “Simple Interest is - ” will result in Wrong Answer. Any deviation from expected output, in
general, will be marked as wrong answer. Please read the output specification carefully so that such silly mistakes do not happen. Incorrect program logic – If your program fails to correctly calculate the value of simple interest for a valid input in terms of Principle, Rate or Tenure, then the program will receive “Wrong Answer” status message.
Do’s and Don’ts Do’s 1. Maintain cool and calm when solving the problems. 2. Have an open mind – When the system gives a particular status message to your submission, analyze why you get that status message. If you think deep enough you will be able to figure out your mistakes.
Don’ts 1. Do not post angry questions or rant about “my solution is right, why is it marked wrong” messages. The questions and the solutions are thoroughly researched before putting them in the contest. It is unlikely that the CodeVita platform will make an error in judging your submission. If it marks your submission with a certain message, there are 99.9999% chances that your submission is incorrect. 2. Do not make errors in adhering to input / output formats 3. Do not submit your solution in haste or without thoroughly analyzing why your previous solution is rejected by the system. You will lose points this way.
Tata Consultancy Services
Page 4
Closing Comments As stated in the opening paragraph of this document, the submissions are automatically evaluated without human intervention. In order to meaningfully deal with such a system, all you need to do is adhere to input / output specifications. Practice rounds are meant to be easy problems. Actual contest problems will be much more difficult. Our endeavour is to ensure that you do not get caught up in trivial issues such as Compile-Time Errors and focus more on getting the program logic correct. correct. If you read up the documents we have shared and pay attention to system messages you will overcome these challenges and give yourself an opportunity to solve interesting problems. That way it will be a win-win situation, because when you solve more problems, we will derive more pleasure. Hope you will meaningfully utilize the opportunity that the Practice round provides. All the Best !!!
Tata Consultancy Services
Page 5
View more...
Comments