Following are the list of coding questions that are generally asked in the interview. These contain basic as well as advanced level PHP Coding interview questions and answers. Here we will try to cover as much as possible.
This is the most common question asked in the PHP Interview to draw a Pyramid/Patterns. Here we will look into the different patterns and will try to understand one by one in detail.
1. Program to print * pattern in descending order
Pattern 1:
* * * * *
* * * *
* * *
* *
*
2. Program to print * pattern in ascending order
Pattern 2:*
* *
* * *
* * * *
* * * * *
3. Program to print digits in descending order
Pattern 3:5 4 3 2 1
5 4 3 2
5 4 3
5 4
5
4. Program to print digits in Ascending order
Pattern 4:
1
1 2
1 2 3
1 2 3 4
1 2 3 4 5
No comments:
Post a Comment