Some Technical Question Of Accenture

 1. Write a Java program to find n fibonacci series ? 

2. What is lambda expression in java ?

3. What is use of static keyword in java ? 

4. Can we implement multiples interfaces in a single java class ?

5. What is the significance of the "super" and "this" keyword in java ?

6. What is run time polymorphism and how it is achieved in java ?

7. Distinguish between  Array and ArrayList provided by java ?

8. What is the "Diamond problem" in java ?

9. How can you differentiate between C, C++ and Java ?

10. Can you differentiate between "var++" and "++var" ?

11. What is normalization in the datebase ? 

12. Can you give differences for the Primary Key and Unique Key in SQL ?

13. What is XML ? 


  1. Java program for Fibonacci series:

    java
    public class Fibonacci {public static void main(String[] args) { int n = 10, a = 0, b = 1; System.out.print(a + " " + b); for (int i = 2; i < n; i++) { int next = a + b; System.out.print(" " + next); a = b; b = next; } } }
  2. Lambda Expression in Java: A way to write functions in a short way. Example: (a, b) -> a + b.

  3. Use of static keyword in Java: Makes something belong to the class, not the object. Example: static methods can be called without creating an object.

  4. Multiple interfaces in one class: Yes, a class can use many interfaces by separating them with commas.

  5. super and this in Java:

    • super: Refers to the parent class.
    • this: Refers to the current class.
  6. Runtime polymorphism in Java: When a method is chosen at runtime. Achieved using method overriding.

  7. Array vs. ArrayList:

    • Array: Fixed size.
    • ArrayList: Can grow in size.
  8. Diamond problem in Java: Happens when a class inherits from two classes that have the same method. Java avoids it by not allowing multiple inheritance with classes.

  9. C, C++, Java differences:

    • C: Simple, procedural.
    • C++: Adds objects to C.
    • Java: Object-oriented, platform-independent.
  10. var++ vs. ++var:

  • var++: Use the value, then increase.
  • ++var: Increase first, then use the value.
  1. Normalization in database: Organizing data to avoid duplicates.

  2. Primary Key vs. Unique Key in SQL:

  • Primary Key: No duplicates, no nulls.
  • Unique Key: No duplicates, but can have one null.
  1. XML: A language for storing and transporting data. Example: <tag>data</tag>.

Comments