Interview Questions

Q:

Write an algorithm to separate all ones & zeroes in an array.

Answer

1. Have two indexes pointing to two ends of array, say i and j.


2. Approach towards each other with a check condition that they dont cross each other.


3. Each iteration of while loop, swap the numbers pointed by two indexes when num[i] index number is not equal to 1.


 


void sort()


{


     int a[]={1,0,0,0,1,1,0,1,0,1,0,0,1,0};


     int i=0;


     int j=13;


     int temp;


      while(j>i)


     {


          if(a[i]==1)


                 i++;


          if(a[j]==0)


                 j--;


          if(a[i]==0)


         {


                 temp=a[i];


                a[i]=a[j];


                a[j]=temp;


         }


     } 


     for(i=0;i<14;i++)


             Console.Write(a[i]+", ");


}


Output: 1,1,1,1,1,1,0,0,0,0,0,0,0

Report Error

View answer Workspace Report Error Discuss

0 2633
Q:

What is off-shore outsourcing?

Answer

When a work process is out-sourced to a different country which is not nearby – it is called off-shore outsourcing. For e.g. If USA outsources a work process to India- it is off-shore outsourcing. 

Report Error

View answer Workspace Report Error Discuss

Subject: Call Center

4 2633
Q:

Which platforms does Silverlight support?

Answer

  • Mac OS 

  • Windows Vista 

  • Windows XP SP2 

  • Windows 2000 

  • Windows Server 2003 

  • Linux (Moonlight) 



 

Report Error

View answer Workspace Report Error Discuss

Subject: Web Technology

0 2633
Q:

What's fuzz testing ?

Answer

1) List down usecases (taken from business cases) from function specs. For each use case write a test case and categorize them into sanity tests, functionality, GUI, performance etc. Then for each test case, write its workflow. 


2) For a GUI application - make a list of all GUI controls. For each control start writing test cases for testing of the control UI, functionality (impact on the whole application), negative testing (for incorrect inputs), performance etc.  

Report Error

View answer Workspace Report Error Discuss

Subject: QA Testing

0 2632
Q:

What is PEAR in php?

Answer

PEAR(PHP Extension and Application Repository) is a framework and repository for reusable PHP components. PEAR is a code repository containing all kinds of php code snippets and libraries. 


PEAR also offers a command-line interface that can be used to automatically install "packages".

Report Error

View answer Workspace Report Error Discuss

Subject: PHP

0 2632
Q:

Explain how to send large amounts of emails with php.

Answer

The mail() function of PHP is quite robust for sending bulk emails. A SMTP server can also be directly used from the script. PHPmailer class can be used for sending emails.

Report Error

View answer Workspace Report Error Discuss

Subject: PHP

0 2631
Q:

Which king class properly represents the relationship "King has a best friend who is a Soldier"?

A) class King extends Soldier { } B) class King implements Soldier { }
C) class King { private BestFriend Soldier; } D) class King { private Soldier bestFriend; }
 
Answer & Explanation Answer: D) class King { private Soldier bestFriend; }

Explanation:
Report Error

View Answer Report Error Discuss

Filed Under: Java

0 2629
Q:

When finally block is executed?

Answer

If exception is generated  in try and if that exception is not catch by any catch then finally is executed.


If exception is generated in try and if that exception is caught by one of catch statements then also finally is executed.


if no exception is generated then also finally is executed.

Report Error

View answer Workspace Report Error Discuss

Subject: Java

0 2627