Difference between revisions of "Interview Questions"

From Hawk Wiki
Jump to: navigation, search
(PHP)
(Calculate degree between hour and minute hand)
Line 31: Line 31:
 
echo $a." and ". $b;
 
echo $a." and ". $b;
 
//output 10 and 20
 
//output 10 and 20
</pre>
 
==Calculate degree between hour and minute hand==
 
<pre>
 
<?php
 
$time=array();
 
$time['h']=12;
 
$time['m']=15;
 
$time['s']=30;
 
function clockDegree($time){
 
$mPercent=((float)$time['m']+((float)$time['s']/60.0))/60.0;
 
$mDegree=$mPercent*360;
 
$hdegree=((int)$time['h']%12+(float)$mPercent)/12.0*360;
 
echo abs($mDegree-$hdegree);
 
}
 
clockDegree($time);
 
 
</pre>
 
</pre>

Revision as of 23:09, 3 April 2012

Some Translation

n! Multiplicative

Object-oriented programming

Check here Interview_Questions(OOP)

C++ Interview

C++ interview

Javascript/Jquery

AJAX&Jquery

Algorithm Interview Problems

Algorithm Problems
All about Binary search tree
All about Linked List
Heap & Heap Sort

Regular Expression

http://www.zytrax.com/tech/web/regex.htm

PHP

PHP interview

Swap 2 numbers in one line

//swap
$a=10;
$b=20;
$a=$a+$b-($b=$a);
echo $a." and ". $b."\n";
// output 20 and 10
$a^=$b^=$a^=$b; //This has a bug. You cannot do things like this $a^=$a^=$a^=$a
echo $a." and ". $b;
//output 10 and 20