Skip to content

Instantly share code, notes, and snippets.

@RazinTeqB
Created December 19, 2022 10:10
Show Gist options
  • Save RazinTeqB/284b33c00f7a8b37868063c06440a23a to your computer and use it in GitHub Desktop.
Save RazinTeqB/284b33c00f7a8b37868063c06440a23a to your computer and use it in GitHub Desktop.

Interview Questions

Set 1

PHP

  1. Name any five array functions.
  2. What are the types of arrays.
  3. What is extract() function?
    • Extracts the values from an array into variables
  4. Name any five string functions.
  5. What is strstr() function?
    • Finds the first occurrence of a string within another string
  6. What are the access modifiers in php?
  7. What is the difference between include and include_once?
  8. Explain php errors.
    • Warning
      • Calling on an external file that does not exist in the directory
      • Wrong parameters in a function
    • Notice
      • Called on an undefined variable
    • Parse error
      • Parse errors are caused by misused or missing symbols in a syntax.
        • Unclosed brackets or quotes
        • Missing or extra semicolons or parentheses
    • Fatal error
      • Fatal errors are ones that crash your program and are classified as critical errors
        • call to undefined function
  9. What is traits?
    • Traits are a way to group functionality into reusable components.
    • Traits can be used to share functionality between classes.
  10. What is the difference between echo and print in PHP?
  11. What is a session in PHP?
  12. Difference between session and cookies in PHP?
  13. What is the difference between unlink and unset??
  14. What is Composer?

Laravel

  1. What template engine is used in Laravel?
  2. What is artisan command?
  3. What is migration in Laravel?
  4. What is seeder in Laravel?
  5. What is Eloquent in Laravel?
  6. What are named routes in Laravel?
  7. What is middleware in Laravel?
  8. Any five artisan commands.
  9. Explain resource routes in Laravel.

Docker

  1. What is Docker?
  2. What is a container?
  3. Name essential Docker commands.
  4. How to ssh into a container?

VueJs

  1. What is vue.js?
  2. list some off the features of vue.js .
  3. Explain any 5 vue directives.
  4. What is computed property?
  5. How to print rendered html code in vue template?

MySql

users

id name
1 User 1
2 User 2
3 User 3
4 User 4
5 User 5
6 User 6
7 User 7
8 User 8
9 User 9
10 User 10

user_info

id user_id email age active
1 1 [email protected] 85 1
2 2 [email protected] 10 0
3 3 [email protected] 81 1
4 4 [email protected] 26 0
5 5 [email protected] 39 1
6 6 [email protected] 23 0
6 7 [email protected] 51 1
6 8 [email protected] 85 0
6 9 [email protected] 27 1
6 10 [email protected] 68 0
  • Write an sql query to print name and email of all users who are active

Symfony

  1. Which template engine Symfony supports?
  2. What is the form helper function in Symfony?
  3. What is the use of Flash Bag?
  4. How to get the request parameters using Http/Request?
  5. Does Laravel use Symfony?
  6. What are Bundles in Symfony?
  7. Explain an environment in the Symfony framework?

Set 2

PHP

  1. What is interface in PHP?
  2. Is there any way to create a class so it cannot be instantiated?
  3. What is abstract class in PHP?
  4. What is difference between traits and interface in PHP?
  5. Is there a way to get value of a private property of a class in another class?
  6. What is the difference between “= =” and “= = =” operators.
  7. What is the meaning of a final class and a final method?
  8. What is ::class?
    • used to return full qualified name of the class including namespace.

Laravel

  1. Name aggregates methods of query builder.
  2. What are the factories.
  3. How to listen for model events.
  4. How to register observer.
  5. How to define relationships.
  6. Name any 5 laravel facades.
  7. Define custom intermediate table for many to many relationship. link
  8. What is N+1 query problem? || What is eager loading?
  9. What is rate limiting?
  10. Name any 5 laravel packages.
  11. Explain package.

Set 3

PHP & MySQL

  1. What are the other commands to know the structure of a table using MySQL command?

  2. What is SQL injection? and how to prevent it?

  3. What is the difference between execution time of the left join and inner join.

  4. How we use ceil() and floor() function in PHP?

  5. How to redirect https to HTTP URL and vice versa in .htaccess?

    Redirect https to http

    RewriteEngine On
    RewriteCond %{HTTPS} on
    RewriteRule (.*) https://%{HTTP_HOST}%{REQUEST_URI} [R=301,L]

    Redirect http to https

    RewriteEngine on
    RewriteCond %{HTTPS} off
    RewriteRule ^(.*)$ https://%{HTTP_HOST}/$1 [R=301,L]
  1. What are Traits?

  2. What is the interface?

  3. What is abstract class? and abstract method?

  4. What is the difference between abstract class and interface?

  5. Can we have non abstract methods inside an abstract class?

  6. Is typecasting supported in PHP?

  7. Does PHP support variable length argument functions?

  • function add(...$num) {$sum =0; foreach ($num as $n) { $sum += $n; } return $sum;} add(1,2,3)
  1. How can you get the IP address of a client in PHP?
  • $_SERVER["REMOTE_ADDR"];
  1. What is named arguments and how to use it?

  2. What is Null safe Operator?

Laravel

  1. What is dependency injection in Laravel ?

  2. How to enable query log in Laravel?

  3. What is N+1 query problem?

  4. Are migrations necessary in Laravel?

  5. How to cache views,routes , configs etc in Laravel? How to clear them? how to clear them all at once?

  6. Is there any way to execute some code when model is saved or updated? How to listen for model events. ? what is the observers?

  7. Define custom intermediate table for many to many relationship. link

  8. What are the accessor and mutator in Laravel?

  9. What are the available validation rules in Laravel?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment