Technical Interview Questions and Answers :: Accenture


Tot. Mock Test: 5

Total Qs: 150+

  •  Select All
  •  C
  •  Java
  •  C++
  •  .NET
  •  SQL
  •  Informatica
  •  WebMethod
  •  Soft. Engineering
  •  Data Structure
  •  HR Question in TR
  •  Operating System
  •  DBMS

    1 / 150

    What is the difference between ++var and var++?

    The ++ operator is called the increment operator. When the operator is placed before the variable (++var), the variable is incremented by 1 before it is used in the expression. When the operator is placed after the variable (var++), the expression is evaluated, and then the variable is incremented by 1.

    The same holds true for the decrement operator (--). When the operator is placed before the variable, you are said to have a prefix operation. When the operator is placed after the variable, you are said to have a postfix operation.

    For instance, consider the following example of postfix incrementation:

    int x, y;
    x = 1;
    y = (x++ * 5);

    In this example, postfix incrementation is used, and x is not incremented until after the evaluation of the expression is done. Therefore, y evaluates to 1 times 5, or 5. After the evaluation, x is incremented to 2.

    Now look at an example using prefix incrementation:

    int x, y;
    x = 1;
    y = (++x * 5);

    This example is the same as the first one, except that this example uses prefix incrementation rather than postfix. Therefore, x is incremented before the expression is evaluated, making it 2. Hence, y evaluates to 2 times 5, or 10.

    Please Login First :

    2 / 150

    How can you rate yourself in C on a scale of 10?

    On what basis u have rated. It might be depend on the question

    Please Login First :

    3 / 150

    What are the principle concepts of OOPS?

    1. Abstraction
    2. Encapsulation
    3. Inheritance
    4. Polymorphism
    5. Classes and Object

    Please Login First :

    Inheritance means, we use the methods or function or other public members of the parent class by child class. So to do this we have to extend the the parent class through it child class.
    For Ex:- Amitabh bacchan's fames inherited by his child Abhishek.

    Program Ex:-

    class A{
    System.out.println("HELLLO ");

    class B extends class A{
    public static void main(String... args){
    A pr=new A();

    Things to remember:---
    * Every class in java inherited by its parent class Object which is in the package:- java.lang.Object when the class is not extended by any child class only.
    * Java does not support "Multiple Inheritance" except in the case of Interface Concept.
    Because one class cannot extend more than one class but Interface able to extend more than one.

    Please Login First :

    5 / 150

    What is Polymorphism/Late Binding? Explain the different forms of Polymorphism.

    When an object is sent a message then it does not know itself what type it is, the runtime environment will decide about function calling over an object. This feature of connecting an object with its associated message at runtime is known as Polymorphism or Late binding or Dynamic binding.

    Please Login First :

    6 / 150

    What is method overloading and overriding?

    Method Overloading:
    A method with changed formal parameters will lead to implementing method overloading.
    int calculateSum(int i,int j)
    float calculateSum(float i,int j)
    double calculateSum(double i,int j)
    float calculateSum(int i,float j)

    Method Overriding:
    The method with the same signature but with changed implementation lead to method overriding and that can occur in a parent child relation of classes. A method defined in parent class can be overridden in its child class with different implementation from its base class.
    1. Pointers are supported in C++ while not in Java. The memory management is done automatically with help of part of JVM called Garbage Collector.
    2. Multiple inheritance is not supported in Java but supported in C++.
    3. There are no structures and unions in Java.
    4. There is no scope resolution operator in Java (::).
    5. There are no destructors in Java like C++.
    6. There is no virtual keyword in Java because all non-static method use dynamic binding.

    Please Login First :

    super is a keyword in java used to refer to the base class in inheritance

    Please Login First :

    8 / 150

    What is an Interface?Can we instantiate an interface?

    No, an interface can't be instantiated. Interface is similar to class. Interface can only have abstract methods. A class can implement an interface.

    Please Login First :

    9 / 150

    What is an abstract class?Can we instantiate an abstract class?

    A virtual function, equated to zero is called a pure virtual function. It is a function declared in a base class that has no definition relative to the base class. A class containing such pure function is called an abstract class.
    It objectives are
    • Provide some traits to the derived classes.
    • To create a base pointer required for achieving run time polymorphism.

    Please Login First :

    10 / 150

    What is Constructor? What is the purpose of default constructor? Does constructor return any value?

    Constructor are similar methods that are called when an instance of the class is created. The constructor doesn't explicitly returns a value but it does constructs something that as an instance can be used for that class.

    Please Login First :

Most Frequent Qs.