Searching for "st"

Q:

prp  qrp  prr  pqr  qrp  rpr  qqr  rpr  qpr  qrr qpr  qpr

If every third letter starting from the left is replaced by a number beginning with 1 then which letter/ number will be 16th from the right?

A) q B) r
C) 6 D) 7
 
Answer & Explanation Answer: D) 7

Explanation:

New sequence is as follows:

pr1  qr2  pr3  pq4  qr5  rp6  qq7  rp8  qp9  qr10  qp11  qp12

16th from the right  end is 7

Report Error

View Answer Report Error Discuss

Filed Under: Number Series

Q:

What do you know about the big-O notation and can you give some examples with respect to different data structures ?

Answer

The Big-O notation simply describes how well an algorithm scales or performs in the worst case scenario as the number of elements in a data structure increases. The Big-O notation can also be used to describe other behavior such as memory consumption. Since the collection classes are actually data structures, we usually use the Big-O notation to chose the best implementation to use, based on time, memory and performance. Big-O notation can give a good indication about performance for large amounts of data.

Report Error

View answer Workspace Report Error Discuss

Subject: Java

Q:

What is the difference between an Interface and an Abstract class ?

Answer

1.Main difference is methods of a Java interface are implicitly abstract and cannot have implementations. A Java abstract class can have instance methods that implements a default behavior.


2.Variables declared in a Java interface is by default final. An abstract class may contain non-final variables.


3.Members of a Java interface are public by default. A Java abstract class can have the usual flavors of class members like private, protected, etc..


4.Java interface should be implemented using keyword “implements”; A Java abstract class should be extended using keyword “extends”.


5.An interface can extend another Java interface only, an abstract class can extend another Java class and implement multiple Java interfaces.


6.A Java class can implement multiple interfaces but it can extend only one abstract class.


7.Interface is absolutely abstract and cannot be instantiated; A Java abstract class also cannot be instantiated, but can be invoked if a main() exists.


8.In comparison with java abstract classes, java interfaces are slow as it requires extra indirection.

Report Error

View answer Workspace Report Error Discuss

Subject: Java

Q:

Can you access non static variable in static context ?

Answer

A static variable in Java belongs to its class and its value remains the same for all its instances. A static variable is initialized when the class is loaded by the JVM. If your code tries to access a non-static variable, without any instance, the compiler will complain, because those variables are not created yet and they are not associated with any instance.

Report Error

View answer Workspace Report Error Discuss

Subject: Java

Q:

What were the most memorable accomplishments at your last job ? In your Carrer?

Answer

Focus on your most recent accomplishments, those in your current position or the job you had just prior to this one. But make sure they are relevant to the position for which you're interviewing.

Report Error

View answer Workspace Report Error Discuss

Q:

What is your Greatest Success?

Answer

This is a good question to highlight your achievements. Don't be smug or arrogant about the success of a project, especially if it was a team effort. You need to give credit to the team, too. You could say what you contributed to the total project and also give credit to others that helped in your success. Don't be overly modest, either.Here are some pointers:


1. Pick something that was clearly a success and highlight your skills.


2. Pick something recent. If you pick something twenty years ago, they are going to wonder what you have done lately.


3. Pick something important. You may have succeeded in many projects that are not that significant. 


4. Pick something easy to explain. If complicated, give the short version.


5. Be sure to explain what you learned from this success.

Report Error

View answer Workspace Report Error Discuss

Q:

How do you decide when to use ArrayList and When to use LinkedList?

Answer

If you need to support random access, without inserting or removing elements from any place other than the end, then ArrayList offers the optimal collection. If, however, you need to frequently add and remove elements from the middle of the list and only access the list elements sequentially, then LinkedList offers the better implementation.

Report Error

View answer Workspace Report Error Discuss

Subject: Java

Q:

How are this() and super() used with constructors?

Answer

Constructors use this to refer to another constructor in the same class with a different parameter list.


Constructors use super to invoke the superclass's constructor. If a constructor uses super, it must use it in the first line; otherwise, the compiler will complain.

Report Error

View answer Workspace Report Error Discuss

Subject: Java