Skip to main content

Interview questions for Senior PHP Developer particle41.com

1.Self Introduction
2.Basic questions on session and cookie.
3.Where is session stored?
4.Difference between Cookie and session.
5.Will there be any session before session start?
6.Post Max execution time.How can we modify it?
7.We have a string, "BJFSJK".Without any php function reverse it with half the string length.
 

To reverse the string with half the string length without using any PHP functions, you can implement a simple algorithm to achieve the desired result. Here's how you can do it:

  1. Initialize two pointers, one at the beginning of the string and the other at the midpoint of the string.
  2. Swap characters between these two pointers iteratively, moving the pointers towards each other until they meet or cross each other.

Here's the PHP code to implement this algorithm:

 <?php
$string = "ABC100";
$length = strlen($string);

// Calculate the midpoint of the string
$midpoint = (int)($length / 2);

// Initialize pointers
$start = 0;
$end = $length - 1;

// Swap characters until the pointers meet or cross each other
while ($start < $midpoint) {
// Swap characters
$temp = $string[$start];
$string[$start] = $string[$end];
$string[$end] = $temp;

// Move pointers
$start++;
$end--;
}

echo $string; // Output: "01CBA00"
?>

 

 
8.We have an array [1,3,0,43,3].Need to make it with ascending order without any array functions.
9.htaccess file,explain the file contants and why do we need it? 

Comments

Popular posts from this blog

Interview questions related to Laravel 8 updates- Laravel Interview questions

 Laravel 8 brought several updates and features to the framework. If you are preparing for an interview and expecting questions related to Laravel 8 updates, here are some potential questions: 1. What are the major features introduced in Laravel 8? Laravel Jetstream: A new application scaffolding for Laravel, providing teams with a starting point for building robust applications. Laravel Breeze: A lightweight and minimalistic front-end starter kit. Model Factory Classes: Introduction of factory classes for model factories, allowing for better organization of data seeding logic. Job Batching: A feature that allows you to easily run a batch of jobs and then perform some action when all the jobs have completed. Dynamic Blade Components: The ability to render Blade components dynamically. 2. Explain the improvements made to the Laravel job queue in version 8. Laravel 8 introduced Job Batching, which allows you to group multiple jobs into a batch and perform actions upon the completion ...

AWS Lambda functions within a Laravel application

O ne common scenario for using AWS Lambda functions within a Laravel application is to offload specific tasks or processes that are either time-consuming, resource-intensive, or need to be executed asynchronously. Here are some common use cases: Image Processing: You can use Lambda functions to resize, crop, or manipulate images uploaded by users. For example, when a user uploads an image, trigger a Lambda function to process it and generate thumbnails or apply filters asynchronously. Email Notifications: Lambda functions can be used to send email notifications, such as welcome emails, password reset emails, or transactional emails. You can trigger Lambda functions from events within your Laravel application, such as user registration or order placement. Data Processing and Transformation: Perform data processing tasks, such as parsing CSV files, transforming data formats, or aggregating data from multiple sources. Lambda functions can be invoked by events like file uploads to S3 or by...