Saturday 28 November 2015

CDK Global Interview Experience

1. Array List, difference between Array List and Linked list?

2. Write a program to find loop in linked list?

3. HashSet and TreeSet - difference and when to prefer what?

4. How to write object into file?
Suppose you write object to file, now when you read the object say you remove one variable? What might happen
Also, what happens if you add extra variable and read the object from memory?

5. You are given a file with data? Write a program to read the file and print line number and number of words on that line?

6. Conside class A, B and C extends A and D extends B? Now you need to create an array list that can store objects of A, B and C?

7. Conside following program

class A {
    public void readFile() throws IOException {
       
    }
}

class B extends A {
    public void readFile() throws Exception {
        File f = new File("xyz");
    }
}

Say the file does not exist, then what will happen with above program.

No comments :

Post a Comment