Coding Guidelines and Sample Codes

For all of the problems on InterviewBit, we do not require you to write a main function / Main class.


You are not required to read input, but instead use the arguments passed to your function. You are not required to print the desired values, but instead return the data as defined by the function signature.


Lets say you were given the problem of adding 2 number a and b.

          Example:

          a : 2
          b : 3

          Output : 5

        

The code will go like this :

CPP

          int add(int a, int b) {
            return a + b;
          }

        

C

          int add(int a, int b) {
            return a + b;
          }

        

Python

          class Solution:
            def add(a, b):
            return a + b

        

Java

        public class Solution {
            public int add(int a, int b) {
                return a + b;
            }
        }
        
Click here to start solving coding interview questions