Interview Questions

Q:

What of the following describes protected access specifier?

A) The variable is visible only outside inside the block B) The variable is visible everywhere
C) The variable is visible to its block and to it’s derived class D) None of these
 
Answer & Explanation Answer: C) The variable is visible to its block and to it’s derived class

Explanation:
Report Error

View Answer Report Error Discuss

Filed Under: C++

2 6298
Q:

Which is true?

A) "X extends Y" is correct if and only if X is a class and Y is an interface B) "X extends Y" is correct if and only if X is a class and Y is an interface
C) "X extends Y" is correct if X and Y are either both classes or both interfaces D) "X extends Y" is correct for all combinations of X and Y being classes and/or interfaces
 
Answer & Explanation Answer: C) "X extends Y" is correct if X and Y are either both classes or both interfaces

Explanation:

A is incorrect because classes implement interfaces, they don't extend them. B is incorrect because interfaces only "inherit from" other interfaces. D is incorrect based on the preceding rules.

Report Error

View Answer Report Error Discuss

Filed Under: Java

2 6278
Q:

What is the difference between $argv and $argc? Give example?

Answer

To pass the information into the script from outside, help can be taken from the PHP CLI (Command line interface) method. Suppose addition of two numbers has to be passed to PHP then it can be passed like this on the command line:


php add.php 2 3


Here the script name is add.php, and 2 and 3 are the numbers that has to be added by the script. These numbers are available inside the script in an array called $argv. This array contains all the information on the command line; the statement is stored as follows:


$argv[0]=add.php


$argv[1]=2


$argv[2]=3


So, $argv always contains at least one element — the script name.


Then, in your script, you can use the following statements:


$sum = $argv[1] + $argv[2];


echo $sum;


$argc is a variable that stores the numbers of elements in $argv. $argc is equal to at least 1, which is saved for the name of the script. Example is $argc=3 using the above statements.

Report Error

View answer Workspace Report Error Discuss

Subject: PHP

0 6262
Q:

Does javascript have the concept level scope?

Answer

No. JavaScript does not have block level scope, all the variables declared inside a function possess the same level of scope unlike c,c++,java.

Report Error

View answer Workspace Report Error Discuss

Subject: Web Technology

0 6253
Q:

What are the different phases involves in cloud architecture?

Answer

There are four phases that basically gets involved in the cloud architecture:


1. Launch phase: it launches the basic services and makes the system ready for communication and for application building


2. Monitor phase: it monitors the services that is being launched and then manages them so that on demand the user will be able to get what he wants.


3. Shutdown phase: it shutdown the services that are not required first and after all the services gets shutdown, and then it closes the system services. 


4. Cleanup phase: it clean up the left out processes and services that is being either broken or didn’t get shutdown correctly.

Report Error

View answer Workspace Report Error Discuss

Subject: Cloud Computing

1 6247
Q:

Explain derivatives in terms of capital markets ?

Answer

The term derivative indicates that it has no independent value that is its value is entirely derived from the values of the underlying assets. The underlying asset can be securities, commodities , bullion, currency, livestock or anything else.

Report Error

View answer Workspace Report Error Discuss

Subject: Finance

5 6245
Q:

Which containers use a border Layout as their default layout ?

Answer

The window, Frame and Dialog classes use a border layout as their default layout.

Report Error

View answer Workspace Report Error Discuss

Subject: Java

8 6240
Q:

Describe a stressful situation and how you handled it?

Answer

The interviewer wants to know how you will deal in stressful situations by asking this question.


Sample answer:


I react to situations rather than being stressful. I want to make the situations not to be stress for anybody. If a situation seems overwhelming, I mentally break it up into smaller steps and just focus on reaching each one on the way to accomplishing the larger task. Once I had a situation that in the same week i had to submit two projects which is very pressure to me. As i was skilled in multiple tasks, i just break down all the works i have in to smaller assignments and just worked one by one to complete the whole task. By this way i handled my stressful situation and submitted my projects within the due time.


Ofcourse, such situations helps me to stay motivated and productive.

Report Error

View answer Workspace Report Error Discuss

5 6235