Find jobs for php developer

Php developer Interview Questions

3K

Php Developer interview questions shared by candidates

Top Interview Questions

Sort: Relevance|Popular|Date
WebKul
PHP Developer was asked...11 September 2016

Q1. Draw star pattern like. n=1. * n=2. ** * n=3. *** ** * n=4 **** *** ** * n=5. ***** **** *** ** *

16 Answers

#include int main() { int n=10,i,j,s,sum=1,l,k; for(k=1;k=1;i--){ l=sum-i; for(s=1;s<=l;s++){ printf(" "); } for(j=1;j<=i;j++){ printf("*"); } l=l+1; sum=l; printf("\n"); } return 0; } Less

import java.util.Scanner; class New { public static void main(String ... args) { Scanner sc =new Scanner(System.in); int n=sc.nextInt(); int p=n-2; for(int i=1;i<=n;i++) { for(int j=1;j<=(p*(p+1))/2;j++) System.out.print(" "); p--; for(int k=1;k<=n-i+1;k++) System.out.print("*"); System.out.println(""); } } } Less

int main() { int i,j,s,n; scanf("%d",&n); for(i=1;i<=n;i++) { for(s=1;s<=n-i;s++) { printf(" "); } for(j=1;j<=(n+1)-i;j++) { printf("*"); } printf("\n"); } } Less

Show More Responses
Wayfair

Given an array of numbers [1,3,3,5,9,4,1,10,9,7,2,7], Write a php function that will print numbers that are not duplicated in array. [5,4,10,2]

6 Answers

The simplest solution for me is to loop through array, unset the current value then check if it is in the array which mean its duplicate and we add it to duplicated values array, if not ,its unique and added to another array for unique numbers .. in every iteration we check the number in the main array and in the duplicated array .. finally we print the unique array. Less

$firstarray = [1,3,3,5,9,4,1,10,9,7,2,7]; $secondarray = []; foreach ($firstarray as $i) { if (array_key_exists($i, $secondarray)) { $secondarray[$i] += 1; } else { $secondarray[$i] = 1; } } $result = []; foreach ($secondarray as $i=&gt;$j) { if ($j==1) { array_push($result, $i); } } echo var_dump($firstarray); echo "<br>"; echo var_dump($result); Less

$firstarray = [1,3,3,5,9,4,1,10,9,7,2,7]; $secondarray = []; foreach (array_count_values($firstarray) as $i=&gt;$j) { if ($j==1) { array_push($secondarray, $i); } } echo var_dump(array_count_values($firstarray)); echo "<br>"; echo var_dump($secondarray); Less

Show More Responses
WebKul

First round is pattern based question like.. n=1 n=2 n=3 * * * *** *** *** * * * * ***** ***** * * * *******

5 Answers

d if(n==1): l=n;m=n+1 for k in range(n+1): for b in range(l): print(end=" ") l=l-1 if(m&gt;=2): for b in range(3): print("*",end=" ") m=m-1 else: for b in range(3): print("*"*3,end=" ") print(end="\n") elif(n==2): l=n;m=1 for k in range(n+1): if(m&lt;3): for b in range(l): print(end=" ") for b in range(2): print("*",end=" ") m=m+1 else: for b in range(l-2): print(end=" ") for b in range(2): print("*"*5,end=" ") print(end="\n") elif(n==3): l=1;m=1 for k in range(n+1): if(m&lt;4): for b in range(l): print("*",end=" ") m=m+1 else: for b in range(l): print("*"*7) print(end="\n") (Code in Python) Less

def show1(n): m=4-n for _ in range(0,n): print(end=" "*n) print("*"*m,end="\n") for _ in range(m): print("*"*(n*2+1),end=" ") Less

n=int(input()) if n==1: for i in range(n+1): print(" " *(n-i)+"*"*(3*n+6*i)) elif(n==2): for i in range(3): for j in range(13): if(i in {0,1} and j in {3,5}): print("*",end="") elif(i==2 and j in {1,2,3,4,6,7,8,9,10,11,12}): print("*",end="") else: print(" ",end="") print() elif(n==3): for i in range(4): for j in range(6): if(i in {0,1,2} and j==0): print("*",end="") elif(i==3 and j in {0,1,2,3,4,5}): print("*",end="") else: print(" ",end="") print() else: print("",end="\n") Less

Show More Responses
Home24

whats the angle between the minute pointer and hour pointer at 3:15

5 Answers

at 3:15 hour arrow will indicate to 16minutes. So diff is 1 minute = 360/60 = 6 deg Less

U r right, it's 7.5 =) I was wrong and sleepy

Angle

Show More Responses
WebKul

draw a reversed T pattern which would generate on dynamic series by giving odd input * * * * * @ @ @ @ Second Question is : * * * * * *

3 Answers

Reverse T for odd number. It's dynamic $x=5; for($i=0;$i'; }

Okay its not getting written here!!

Reverse T for odd number in php. It's dynamic '; } ?&gt;

Get the last thee max salaried person from table via sql.

3 Answers

Just call select query with order by salary with 3 rows limit.

select top 3 salary from employee order by salary desc

"select sal from employ order by sal dec limit 3;"

Trantor

I was having 8 Yrs of experience but they asked me how to access array elements

3 Answers

They asked very low standard questions

Sorry that you found the question subpar. We have had a candidate once and I reviewed some of their code on screen share. I remember that the candidate had some confusion and said that Arrays is the same Hash Maps which shows lack of understanding of data structures. We are find highly skilled PHP developers who lack understanding of data structures. Unfortunately the nature of business requires our senior developers to have a good command on the basics of programming apart from knowing a language or a framework. I hope that this would explain why our interviewers might ask very basic questions to highly experiences candidates. Less

*Re-commenting because of grammatical errors in the last comment* Sorry that you found the question sub-par. We have had a candidate once who I interviewed. We reviewed some of their code on screen share and I remember that the candidate had some confusion and he believed that Arrays are the same Hash Maps which shows lack of understanding of data structures. We are finding highly skilled PHP developers who lack understanding of data structures and algorithms. Unfortunately (or fortunately), the nature of business requires all of our senior developers to have a good command on the basics of programming apart from knowing a language or a framework. I hope that this would explain why our interviewers might ask very basic questions to highly experiences candidates. Less

Appinventiv

12: one ring bells at 20 sec, second will 40 sec and third will 60.at what time these three will ring together?

3 Answers

USE LCM of these 20,40,60.

In 2nd minute

60 mins

Wren Kitchens

Tell me about yourself. What technologies you learnd?

3 Answers

I talked about the university graduated, about the projects carried out and I listed the programming languages ​​learned. Less

I wouldn't stick it out long if your good, the tech stack is rubbish, the framework is just an out of date version of symfony. They might be tedious and pedantic about what they do, it doesn't mean they are any good or moving with the times. Less

When it comes to Wren Kitchens I would ask about the staff retention and ask them about all the allegations of racism, bullying and unfair treatment in the genuine reviews, i.e. the 1 star reviews. The IT manager at Barton on Humber knows nothing about managing people, he might have pulled away from the programming and abstracted himself away into senior management but he knows nothing about managing people either. Communication with him is difficult and unclear, he shows signs or irritation vey quickly and any trivial little question you ask is a black mark against your name, even though you can't be expected to know the core business, bespoke elements of the role or things you don't claim to have experience of in the last 4 years. He tests you exhaustively but you don't in return earn any confidence or time to prove yourself, even if you don't have all the skills and thought the lower salary was a trade off, you will get sacked if you are not hitting the ground running by the end of the week. This all took place at the Manchester office. They are now trying to say they haven't received my references and my work contract isn't valid however I have emails from my references stating they were happy to supply references which proves references were requested and supplied. Basically from an employment perspective they are harsh, irresponsible and opportunistic. Less

1.hr interview-they check your verbal and written communication ability 2.written test consists of 10 questions with mix of javascript and php 3.technical test - here they ask you to install LAMP ,Wordpress, Virtualization and/or FTP

3 Answers

15k p.m

How much salary offered..?

Passed every test but didn't because of their salary offer salary offered is not at all good for freshers Less

Viewing 1 - 10 of 3,186 Interview Questions