Showing posts with label interveiw. Show all posts
Showing posts with label interveiw. Show all posts

๐–๐ก๐š๐ญ ๐ฐ๐ข๐ฅ๐ฅ ๐›๐ž ๐ฅ๐จ๐ ๐ ๐ž๐ ๐ญ๐จ ๐ญ๐ก๐ž ๐œ๐จ๐ง๐ฌ๐จ๐ฅ๐ž?

 ๐–๐ก๐š๐ญ ๐ฐ๐ข๐ฅ๐ฅ ๐›๐ž ๐ฅ๐จ๐ ๐ ๐ž๐ ๐ญ๐จ ๐ญ๐ก๐ž ๐œ๐จ๐ง๐ฌ๐จ๐ฅ๐ž?


๐–๐ก๐š๐ญ ๐ฐ๐ข๐ฅ๐ฅ ๐›๐ž ๐ฅ๐จ๐ ๐ ๐ž๐ ๐ญ๐จ ๐ญ๐ก๐ž ๐œ๐จ๐ง๐ฌ๐จ๐ฅ๐ž?
Here is the answer & explanation of this question:
First, we have an object named “income” with three properties:
1. “๐ฌ๐ค๐ข๐ฅ๐ฅ๐ฌ”, which is set to 108.
2. “๐ฆ๐จ๐ง๐ญ๐ก๐ฅ๐ฒ”, which is a method that calculates the monthly income based on the “๐ฌ๐ค๐ข๐ฅ๐ฅ๐ฌ” value.
3. “๐ฒ๐ž๐š๐ซ๐ฅ๐ฒ”, which is an arrow function meant to calculate the yearly income.
๐„๐ฑ๐ฉ๐ฅ๐š๐ง๐š๐ญ๐ข๐จ๐ง ๐จ๐Ÿ “๐ฆ๐จ๐ง๐ญ๐ก๐ฅ๐ฒ()” ๐ฆ๐ž๐ญ๐ก๐จ๐:
1. “๐ฆ๐จ๐ง๐ญ๐ก๐ฅ๐ฒ()” is a regular function. When you call “๐ข๐ง๐œ๐จ๐ฆ๐ž.๐ฆ๐จ๐ง๐ญ๐ก๐ฅ๐ฒ()”, this refers to the “๐ข๐ง๐œ๐จ๐ฆ๐ž” object.
2. “๐ญ๐ก๐ข๐ฌ.๐ฌ๐ค๐ข๐ฅ๐ฅ๐ฌ” inside the “๐ฆ๐จ๐ง๐ญ๐ก๐ฅ๐ฒ()” method correctly refers to “๐ข๐ง๐œ๐จ๐ฆ๐ž.๐ฌ๐ค๐ข๐ฅ๐ฅ๐ฌ”, which is 108.
3. So, “๐ญ๐ก๐ข๐ฌ.๐ฌ๐ค๐ข๐ฅ๐ฅ๐ฌ * ๐Ÿ๐ŸŽ๐Ÿ–” becomes “๐Ÿ๐ŸŽ๐Ÿ– * ๐Ÿ๐ŸŽ๐Ÿ–”, which equals 11664.
4. Therefore, “๐ข๐ง๐œ๐จ๐ฆ๐ž.๐ฆ๐จ๐ง๐ญ๐ก๐ฅ๐ฒ()” returns 11664.
๐„๐ฑ๐ฉ๐ฅ๐š๐ง๐š๐ญ๐ข๐จ๐ง ๐จ๐Ÿ “๐ฒ๐ž๐š๐ซ๐ฅ๐ฒ” ๐š๐ซ๐ซ๐จ๐ฐ ๐Ÿ๐ฎ๐ง๐œ๐ญ๐ข๐จ๐ง:
1. “๐ฒ๐ž๐š๐ซ๐ฅ๐ฒ” is defined as an arrow function.
2. Arrow functions do not have their own “๐ญ๐ก๐ข๐ฌ” context; they inherit “๐ญ๐ก๐ข๐ฌ” from the surrounding (lexical) context at the time they are defined.
3. In this case, “๐ญ๐ก๐ข๐ฌ” in “yearly” refers to the global object (“๐ฐ๐ข๐ง๐๐จ๐ฐ” in browsers, “๐ ๐ฅ๐จ๐›๐š๐ฅ” in Node.js), not the “๐ข๐ง๐œ๐จ๐ฆ๐ž” object.
4. Since there is no “๐ฌ๐ค๐ข๐ฅ๐ฅ๐ฌ” property on the global object, “๐ญ๐ก๐ข๐ฌ.๐ฌ๐ค๐ข๐ฅ๐ฅ๐ฌ” is “๐ฎ๐ง๐๐ž๐Ÿ๐ข๐ง๐ž๐”.
5. As a result, “๐Ÿ–๐Ÿ–๐Ÿ– * ๐ญ๐ก๐ข๐ฌ.๐ฌ๐ค๐ข๐ฅ๐ฅ๐ฌ” becomes “๐Ÿ–๐Ÿ–๐Ÿ– * ๐ฎ๐ง๐๐ž๐Ÿ๐ข๐ง๐ž๐”, which is “๐๐š๐” (Not a Number).
6. Therefore, “๐ข๐ง๐œ๐จ๐ฆ๐ž.๐ฒ๐ž๐š๐ซ๐ฅ๐ฒ()” returns “๐๐š๐”.
๐“๐จ ๐ฌ๐ฎ๐ฆ๐ฆ๐š๐ซ๐ข๐ณ๐ž:
1. “๐ข๐ง๐œ๐จ๐ฆ๐ž.๐ฆ๐จ๐ง๐ญ๐ก๐ฅ๐ฒ()” works as expected and returns 11664 because “๐ญ๐ก๐ข๐ฌ” correctly refers to the “๐ข๐ง๐œ๐จ๐ฆ๐ž” object.
2. “๐ข๐ง๐œ๐จ๐ฆ๐ž.๐ฒ๐ž๐š๐ซ๐ฅ๐ฒ()” returns “๐๐š๐” because “๐ญ๐ก๐ข๐ฌ” inside the arrow function does not refer to the “๐ข๐ง๐œ๐จ๐ฆ๐ž” object, leading to “๐ญ๐ก๐ข๐ฌ.๐ฌ๐ค๐ข๐ฅ๐ฅ๐ฌ” being “๐ฎ๐ง๐๐ž๐Ÿ๐ข๐ง๐ž๐”.
๐…๐จ๐ฅ๐ฅ๐จ๐ฐ ๐ญ๐ก๐ข๐ฌ ๐ฉ๐š๐ ๐ž ๐Ÿ๐จ๐ซ ๐ฆ๐จ๐ซ๐ž ๐œ๐จ๐ง๐ญ๐ž๐ง๐ญ ๐ฅ๐ข๐ค๐ž ๐ญ๐ก๐ข๐ฌ.

task by b2broker

 Test task: Financial transactions system


We expect you to use SOLID, GRASP principles, design

patterns. Code check must be passed by phpstan, phpcs

analyzers. In README file in the test task you should

describe which patterns did you use and why.

Only business logic code required. MVC pattern is

forbidden, UI Interface is not required because there

is no reason for start application. That means you

should not write controllers and views.


Task Question:

Implement a set of classes for managing the financial

operations of an account.

There are three types of transactions: deposits, withdrawals

and transfer from account to account.

The transaction contains a comment, an amount, and a due

date.

Required methods:

 get all accounts in the system.

 get the balance of a specific account


 perform an operation

 get all account transactions sorted by comment in

alphabetical order.

 get all account transactions sorted by date.


The test task must be implemented without the use of

frameworks and databases. This is necessary in order to see

your coding style, ability to understand and implement the

task and demonstrate your skills.




task by myverkoper.com

 <!-- SELECT Rank

FROM Persons
WHERE Rank < (SELECT MAX(Rank) FROM Persons)
ORDER BY Rank DESC -->

task:2
With out using limit in query, display 2nd highest rank person

is it right

implement sorting without sort in php

task


task 1:<?php //Complete sorting functionality without using any inbuilt sorting related functions $arr = [50,20,35,15,45]; echo "Before Sorting <br/>"; print_r($arr); //sorting logic start //write your code here //sorting logic end echo "After Sorting <br/>" print_r($arr); ?>

task:2
With out using limit in query, display 2nd highest rank person
task 

programm

<?php
$arr = [50, 20, 35, 15, 45];

echo "Before Sorting <br/>";
print_r($arr);

// sorting logic start

$length = count($arr);
for ($i = 0; $i < $length - 1; $i++) {
    for ($j = 0; $j < $length - $i - 1; $j++) {
        if ($arr[$j] > $arr[$j + 1]) {
            // swap elements
            $temp = $arr[$j];
            $arr[$j] = $arr[$j + 1];
            $arr[$j + 1] = $temp;
        }
    }
}

// sorting logic end

echo "After Sorting <br/>";
print_r($arr);
?>

<!-- With out using limit in query, display 2nd highest rank person -->

<!-- SELECT Rank
FROM Persons
WHERE Rank < (SELECT MAX(Rank) FROM Persons)
ORDER BY Rank DESC -->

laravel tables

 add column

move from old column to new column

drop column

rename column

Laravel tip. When typing `make:migration` command, you usually use underscore symbol between parts, like `create_transactions_table`. But, alternatively, you can also put the name in quotes and use a SPACE as a delimiter.





how to remove cloumn with new migration file

how to craete
public function up(): void { Schema::table('settings_site', function (Blueprint $table) { $table->string('retailer_signatory')->nullable(); }); Schema::table('delivery_locations', function (Blueprint $table) { $table->dropColumn('test'); }); } write down method for this


what is down method for this

use Illuminate\Database\Migrations\Migration; use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; class UpdateSiteSettingsAndDeliveryLocations extends Migration { public function up() { Schema::table('settings_site', function (Blueprint $table) { $table->string('retailer_signatory')->nullable(); }); Schema::table('delivery_locations', function (Blueprint $table) { $table->dropColumn('test'); }); } public function down() { Schema::table('settings_site', function (Blueprint $table) { $table->dropColumn('retailer_signatory'); }); Schema::table('delivery_locations', function (Blueprint $table) { $table->string('test')->nullable(); }); } }


====================
$table->string('retailer_signatory')->nullable()->change();


what is the down method fo rthis

$table->string('retailer_signatory')->nullable()->change();

$table->string('retailer_signatory')->nullable(false)->change();


==




AI Tools

 Midjourney oter.ai aiva googlegemin dall-e copilot jasper copilot openaiplayground