Categories
General Interview Interview questions PHP

How to PHP/ LAMP light screen interview ?

Overview

45 to 60 minutes format interview – Screen Interview

5 minutesIntroduction – Interview
25 minutesTechnical (6 questions)
5 minutesBehavorial (2 questions)
5 minutesPersonality (2 questions)
5 minutesQuestions for us
15 min buffer

Assessment Grid

TechnicalGrade
PHP
Database
Linux
Front end
readable code
Optimal code
reusable code
passionated ? up to date with latest ?
Behavorial
perseverance / determination
problem solver
collaboration team
work ethic
Personality
Openness
Conscientiousness
Extraversion
Agreeableness
Neuroticism
Universality

Behavorial Question

tell us about your latest ‘coding’ project ?
Tell me about a stressful situation at work and how you handled it.
Describe a time when you disagreed with your supervisor on how to accomplish something.
Have you ever had to convince your team to do a job they were reluctant to do?
Have you ever had a deadline you were not able to meet? What happened? What did you do?
Tell me about a time your co-workers had a conflict. How did you handle it?
How have you prioritized being assigned multiple projects?
Tell me about a difficult work challenge you’ve had.
Talk about a time when you had to adapt to big changes at work.
How have you dealt with an angry or upset customer?
Have you ever gone above and beyond to help a customer? What did you do?
Tell me about a time when you had to fight for an idea at work.
Talk about a time where you had to make an important decision quickly. What did you decide? What were the results?
Have you ever been in a business situation that was ethically questionable? What did you do?
Have you ever had a project that had to change drastically while it was in progress? Why? How did you do it?
Talk about a time when a co-worker was not doing their share on a project. How did you handle it?
Tell me about a major setback you’ve had. How did you deal with it?
What have you done when colleagues have been stressed out by a project?
Talk about a difficult problem you’ve had to solve. How did you solve it?
Have you ever had to defend a customer’s point of view? What did you do? Why?
Talk about a time when you’ve had to sell an idea to your colleagues.
Tell me about a problem you solved in a creative way.

Personality Question

If you could change one thing about your personality, what would it be and why?
What are your sports and hobbies outside of work?
Do you prefer working on your own or in a team? Why?
What are you most passionate about?
Can you tell me about a time when you went above and beyond in your job?
How would your best friend describe you?
What makes you unique?
Tell me about a time when you came up with a creative solution to a challenging task. What was the result?
How do you handle stress at work?
How do you feel when someone interrupts you during a task?
Tell me about a time when you disagreed with a manager or colleague about a decision. How did you handle it?
What is your favorite book and why?
Can you name one professional achievement and one personal achievement?
Which superhero would you want to be and why?
What is your greatest fear?

PHP Questions

What is difference between abstract class and interface ?
What is difference between PUT and PATCH ?
tell us about your latest ‘coding’ project ?
What are the steps to create a new database using MySQL and PHP?
30. How to create API in PHP?
Explain type hinting in PHP
Explain the main types of errors.
Do they follow any PHP convention standard of programming ?
Are you familiar with CodeSniffer
Are you familiar with PHPUnit
Do you use Composer? If yes, what benefits have you found in it?
What does MVC stand for and what does each component do?
do you know some design pattern ?
factory pattern ?
interface ?
Factory ?
singleton ?
How do you handle PHP upgrades ?

Javascript Questions

what is nodeJS
Have you used any JS framework ? is yes what are they ?

Database Questions

Q #7) Explain Normalization and De-Normalization.

Answer:

Normalization is the process of removing redundant data from the database by splitting the table in a well-defined manner in order to maintain data integrity. This process saves much of the storage space.

De-normalization is the process of adding up redundant data on the table in order to speed up the complex queries and thus achieve better performance.
8) What are the different types of Normalization?

Answer: Different types of Normalization are:

First Normal Form (1NF): A relation is said to be in 1NF only when all the entities of the table contain unique or atomic values.
Second Normal Form (2NF): A relation is said to be in 2NF only if it is in 1NF and all the non-key attribute of the table is fully dependent on the primary key.
Third Normal Form (3NF): A relation is said to be in 3NF only if it is in 2NF and every non-key attribute of the table is not transitively dependent on the primary key.

API Question

What restful api method would be appropriate for an upsert ?

Linux Question

Do you know how toi use vim / vi ?
What experience have you had with nginx ? apache ?
What is netstat command?
Explain working of env command.
44. What is pipe?

Deployment Question

Are you familiar with CI ?
Are you familiar with CD ?
Are you familiar with jenkins?
Are you familiar with Git Pull request
are you familiar with GIT branch
Categories
Interview Interview questions

How to fibonacci with PHP ? Recursively

This function runs in O(2 exponent N)

function fibonacci(int $n) {
    if ($n == 0) {
        return 0; 
        
    }
    if ($n == 1) {
        return 1;
    }
    
    
    return fibonacci($n-1) + fibonacci($n-2);
}

echo 'FINAL ' . fibonacci(9);
Categories
Interview Interview questions

How to Fibonacci Bottom-Up Memoization PHP ? Dynamic Programming

This function runs in O(n) time

<?php
function fibonacci(int $n) {
    if ($n == 0) {
        return 0; 
        
    }    else if ($n == 1) {
        return 1;
    }
    
    $memo = array_fill(0, $n, 0);
    $memo[0] = 0;
    $memo[1] = 1;
    
    for ($i = 2; $i < $n; $i++) {
        
        $memo[$i] = $memo[$i - 1] + $memo[$i - 2] ;   
        echo    "memo[$i] ($memo[$i]) = memo[$i - 1] + memo[$i - 2] \n\r";   
        
    }
    return $memo[$n - 1] + $memo[$n - 2];
}

OR

function fibonacci(int $n) {
    if ($n == 0) {
        return 0; 
        
    }    else if ($n == 1) {
        return 1;
    }
    
    $memo = array_fill(0, $n, 0);
    $a = 0;
    $b = 1;
    
    for ($i = 2; $i < $n; $i++) {
        
       $c = $a + $b ;   
        $a = $b;
        $b = $c;
        echo    "c ($c) = a ($a) + b ($b)  \n\r";   
        
    }
    return $a + $b;
Categories
Interview Interview questions

How to Fibonacci Top-Down Memoization PHP ?

Top-Down Memoization PHP Fibonacci Problem

function fibonacci1(int $n) {
    
    $result = array_fill(0, $n + 1, 0);
<?php
function fibonacci1(int $n) {
    
    $result = array_fill(0, $n + 1, 0);
    return fibonacci($n,$result );
}

function fibonacci(int $i, $memo) { 
    
    if ($i == 0 || $i == 1) return $i;
    
    if ($memo[$i] == 0) {
        $memo[$i] = fibonacci($i - 1, $memo) + fibonacci($i - 2, $memo);
    }
    
    echo " memo[$i] ".$memo[$i]."\n\r";
    
    return $memo[$i];
}

echo 'FINAL ' . fibonacci1(9);

Categories
Interview Interview questions

Big O notation Chart

Speed performance is the key of any successful application – use the following charts for understanding the big O nation and for upcoming FAANG interviews

source https://jarednielsen.com/big-o-notation/

https://twitter.com/jarednielsen

Also do not hesitate to prepare your interviews with this book

Categories
Interview questions

DEVELOPER Methodologies to follow

MethodologyDescription
DRYDo not Repeat Yourself
KISSKeep It Studid Simple
SOLIDSolid Principles
Big O NotetationDo not Repeat Yourself
Function not bigger than 30 linessmaller function to make code more readable
PSR ImplementationDescription
PSR-2Coding Style Guide
PSR-3Logger Interface
PSR-4Autoloader