Showing posts with label task. Show all posts
Showing posts with label task. Show all posts

task by hasone testdome

==


vuejs task
write the reoraderable list component . the component should recieve an array of elements as items prop and should displa the elements as list items in an unorderseed list
when the user click on a list item it should be sent to the first positionin the unordered list
for example if the component has the item prop ["A","B","C"], the list should look like:

<!DOCTYPE html> <html> <head> <title>Reorderable List</title> <script src="https://cdn.jsdelivr.net/npm/vue@2"></script> </head> <body> <div id="app"> <reorderable-list :items="['A', 'B', 'C']"></reorderable-list> </div> <script> Vue.component('reorderable-list', { props: ['items'], data() { return { list: [...this.items] }; }, methods: { moveToFirst(index) { const item = this.list.splice(index, 1)[0]; this.list.unshift(item); } }, template: ` <ul> <li v-for="(item, index) in list" :key="index" @click="moveToFirst(index)"> {{ item }} </li> </ul> ` }); new Vue({ el: '#app' }); </script> </body> </html>


== 

second task

convert a string of numbers to a sentnce .e ach number represents a aletter. numbers in  the string are seperated by  aspace. and words in the sentence are seperated by a plus characterf/

conversion table:

1 = A

2 =B

--

26 = Z


example numbe to letters (`20 15 19 20+4 15 13 5) should return 'test dome'


<?php function numberToLetters($string) { $conversionTable = [ 1 => 'A', 2 => 'B', 3 => 'C', 4 => 'D', 5 => 'E', 6 => 'F', 7 => 'G', 8 => 'H', 9 => 'I', 10 => 'J', 11 => 'K', 12 => 'L', 13 => 'M', 14 => 'N', 15 => 'O', 16 => 'P', 17 => 'Q', 18 => 'R', 19 => 'S', 20 => 'T', 21 => 'U', 22 => 'V', 23 => 'W', 24 => 'X', 25 => 'Y', 26 => 'Z' ]; $words = explode('+', $string); // Split string into words separated by '+' $result = []; foreach ($words as $word) { $letters = explode(' ', $word); // Split each word into numbers separated by spaces $wordResult = ''; foreach ($letters as $number) { if (isset($conversionTable[$number])) { $wordResult .= $conversionTable[$number]; } } $result[] = $wordResult; } return strtolower(implode(' ', $result)); // Convert result to a sentence in lowercase } // Example usage echo numberToLetters('20 5 19 20+4 15 13 5'); // Outputs: test dome ?>


echo numberToLetters('20 5 19 10+4 15 13 5');

===============================

implement the get view count method .it should accept a json 

a string and sum all vie wcount fields inside the json will alwyas hav ethe same structure as int he example case 

for example calling get view count should return 88270796 for the following $jsonstring 

{

  "apiVersion": "2.1",

  "videos": [

    {

      "id": "253",

      "category": "music",

      "title": "Jingle Bells",

      "duration": 457,

      "viewCount": 88270796

    }

  ]

}

==

<?php function getViewCount(string $jsonString): int { $data = json_decode($jsonString, true); $totalViewCount = 0; if (isset($data['videos']) && is_array($data['videos'])) { foreach ($data['videos'] as $video) { if (isset($video['viewCount'])) { $totalViewCount += $video['viewCount']; } } } return $totalViewCount; } $jsonString = ' { "apiVersion": "2.1", "videos": [ { "id": "253", "category": "music", "title": "Jingle Bells", "duration": 457, "viewCount": 88270796 } ] } '; echo getViewCount($jsonString); ?>


===

writea a function that removes all items that are not integers from the array the function should modify the existing aarray,nmot create a nbew one.

for example, if the input array containes values [1,'a,'b',2], after processing, the array will contain only values [1,2]

<?php function filterNumbersFromArray(array &$arr): void { foreach ($arr as $key => $value) { if (!is_int($value)) { unset($arr[$key]); } } } $arr = [1, 'a', 'b', 2]; filterNumbersFromArray($arr); print_r(array_values($arr)); ?>

==============


an education magazine pulbishee rankings of strudnetns and theire colleges in a acompetitoion in building unmmaned aerial vehical dornes. students whoi participated in the competion in different yeres, their ranking in the competion, and their colleges are contained inthe following tables;

table colleges 

id integer primary key

name varchar(50) not null


table students 

id integer primary key 

name varchar(50) not null 

collegeid integer

foreighn key (collegeid) references colleges(id)


table rankings 

studentid integer 

ranking integer not null

year integer not null

foreign key (studentid) references students(id)


write a query that lists all collges that have atleast one student with a ranking between 1 and 3 ( both inclusive) for the year 2015. the query should return 

the college name,

the rank of their best rnaking studnet for 21015.;

the numer of students who had rankings between 1 and 3 ( both inclusive) for the year 2015

rank 1 is the best rank, rank 2 is the second best an dso on . more than one student can tie for a rank in a ayear


SELECT
c.name AS college_name,
MIN(r.ranking) AS best_rank_2015,
COUNT(*) AS num_students_rank_1_to_3
FROM
rankings r
JOIN
students s ON r.studentid = s.id
JOIN
colleges c ON s.collegeid = c.id
WHERE
r.year = 2015
AND r.ranking BETWEEN 1 AND 3
GROUP BY
c.name;


=



=


As part of a data processing pipeline, complete the implementation of the make_pipeline method:

  • The make_pipeline method should accept a variable number of functions, and it should return a new function that accepts one parameter $arg.
  • The returned function should call the first function in make_pipeline with the parameter $arg, and call the second function with the result of the first function.
  • The returned function should continue calling each function in make_pipeline in order, following the same pattern, and return the value from the last function.

For example, calling make_pipeline(function($x) { return $x * 3; }, function($x) { return $x + 1; }, function($x) { return $x / 2; }), and then calling the returned function with 3 should return 5.

<?php

function make_pipeline(...$funcs)
{
return function ($arg) use ($funcs) {
$result =$arg;
foreach ($funcs as $func){
$result = $func($result);
}
return $result;
};
}

$fun = make_pipeline(
function ($x) {
return $x * 3;
},
function ($x) {
return $x + 1;
},
function ($x) {
return $x / 2;
}
);
echo $fun(3); # should print 5

===

App usage data are kept in the following table:

TABLE sessions
  id INTEGER PRIMARY KEY,
  userId INTEGER NOT NULL,
  duration DECIMAL NOT NULL

Write a query that selects userId and average session duration for each user who has more than one session.


SELECT userid, AVG(duration) AS avg_duration
FROM sessions
GROUP BY userid
HAVING COUNT(id) > 1;

=

questions:

what is abstract and what is interface

why we use abstaract

what is difference

why do we interface

wht is static method


where can use static, where can we declare static

solid principles

design pattern 

whtis service container and service provider

array methods 

what type of array in php supports

session and cookie

what is http only cookie

what is break and continue 

how can we handle exceptions

what is finally in php

whatr is composer

what is composer.lock

how to update the pacakge 

how can we update teh specific pakage

life cycke method in vuejs

how to bind the data 

what is v-model

event emitters

what is props and data functions 

hwo can we declare a method in vuejs

what is pure function in javascript


set time out and set interval

how to stop the setinterval

hosting in javascript

waht is closure in javacript

sql

what are join in sql

what is self join

what is inner  join

what is group by

what is indexing mechanism

what is composite index

aany experience in version control system and what is the workf low








task by v-max

 =

usrs table with some dummy data
users
id,mobile,name, email
after submit mobile number
it will show their data from usres table
and
we have anohter form in same page
dapartment , designation with add more
departments table
id, name
designations table
id, name
user has more departments , more designations
user_has_departments_designations
user,department_id,designation_id

[15:47]
enter mobile no text box
after enter textbox
show by default user details
[15:48]
in down give one form
select department , select designation addmore
[15:48]
submit
[15:48]
if again enter same mobile show by default all details
update details



[15:32]
$string ="fdkfhkhihrekfbkfndfnnfns";
$find=str_split($string);
$count = [];
foreach($find as $s){
if(array_key_exists($s,$count)){
$count[$s]++;
} else {
$count[$s]=1;
}
}
print_r($count);
[15:33]
Array ( [f] => 6 [d] => 2 [k] => 4 [h] => 3 [i] => 1 [r] => 1 [e] => 1 [b] => 1 [n] => 4 [s] => 1 )
[15:37]
select salary from employees order by salary desc limit (2,1)
[15:41]
select salary,count (*)as cnt from employees group by salary having count(*)>3
[15:45]
$.ajax({
url: 'www;google.com/api/xyz',
type'GET',
success:function(response){
console.log(response);
},
error:function(xhr,status,error){
}
}
);


task 2



i created students table with
name,
dob,
roll_number
section
class_name
gender
fathers name
another table
marks table
student_id
subject
marks
relation student_id and id of student_id
writtenquery
if i given roll roll_number
i wil get the co students
then checking the amrks of that student id and
caliculat total
then allot rank

[17:37]
student management system for school
[17:37]
school multilple class, design database , get student name, fa,dob, roll number, and gender, which class and which section
[17:38]
whn there are exams, three subjects , give ranks based on marks


http://127.0.0.1:8000/get_rank_by_roll_number?roll_number=13485401

{"id":1,"name":"vamsi","fathers_name":"nnr","dob":"2024-03-01","roll_number":13485401,"gender":"male","class_name":"First","section_name":"A","created_at":null,"updated_at":null,"total_marks":156,"rank":6,"marks":[{"id":1,"subject":"English","marks":51,"student_id":1,"created_at":null,"updated_at":null},{"id":2,"subject":"Telugu","marks":52,"student_id":1,"created_at":null,"updated_at":null},{"id":3,"subject":"Hindi","marks":53,"student_id":1,"created_at":null,"updated_at":null}]}

-=

task by nitsolution

 <!DOCTYPE html>

<html>
<body>
<?php
findRepeatedCharacters("vamsi krishna narayana");
function findRepeatedCharacters($character){
$each = str_split($character);
$repeated_array=array();
for ($i=0; $i<count($each);$i++){
$count_times = substr_count($character,$each[$i]);
 $repeated_array[]=$each[$i]  .",". $count_times;

}
$final= array_unique($repeated_array);
print_r($final);
return;
}

?>
</body>
</html>

task by inifinityspark.in

 TASK:


1) A hospital with a diabetes clinic wants you to provide a glucose measurement web app for its diabetic patients. Each patient has a name(string), unique database id (int), and doctor's name(string). Several times a day each patient measures their blood glucose level, a number such as 160, and how much they took at that time, for example, 10 units. Your web app should accept there is( our feeble attempt at privacy here) and blood glucose level "glucose" and insulin dose" dose" for one particular time, also recorded by using the current time known by the database. The app should also show the most recent (up to) 8 observations(time, guse, dose)  

2) Create a web app for the stock module. Add stock(10 Products), view stock, and modify stock by giving the vendor details. Inward voucher, outward voucher should be used while the stock is adding and stock is dispersing. A page to view each product and the stock remaining. If the stock is below 5, there should be a warning message next to the stock value saying "Less Quantity"


task by vellanki technologies

 Smit Skill Task Information - Boulevard



Context:


Hi there. Within this document, will be some basic information regarding a skill test to ensure you have the right skills to work at Boulevard. This is a relatively simple task, but demonstrates your knowledge of PHP, Laravel and back-end systems.



The Task:


To complete this task, can you please: 


  • Please upload the code (and all of their progressive commits) to a private Github repository,

  • Setup a fresh Laravel application

  • Code a CSV importer that imports the products and the information within these columns into a database

  • Here is a spreadsheet with some product columns. All of these need to be importable.

The spreadsheet can be found here: 

https://docs.google.com/spreadsheets/d/1UbxTA6Kb2PsVsQmnFmb96gRBLTq235H0jF2AuFUc0l4/edit?usp=sharing

The results:

Once you have completed this task, please upload the code (and all of their progressive commits) to a private Github repository, and then once complete, invite the following users to join:

  • laramoore

  • ConnorHOO

Please also send through a video demonstrating the feature working. 


Thank you. 

We look forward to seeing your results!


excel file 
skutitleeanuk-only
123Breeches HighWaist dark blue, size 380186538314034TRUE
124First aid bag 13 cm 15 cm0186539640647TRUE
125Breeches BasicPlus for Men stone, size 480186530307696TRUE

task by symberity

 PHP Skill Test

1. Create a PHP class representing a basic calculator with methods for addition,

subtraction, multiplication, and division.

2. Write a PHP script to generate a random password of a given length.

3. Develop a PHP script to consume data from a RESTful API (e.g., GitHub API)

and display it in a web application.

4. You are given an array of integers, where each element represents the stock price

on a given day. You need to design a PHP function maxProfit() to find the

maximum profit that can be achieved by buying and selling the stock at most

once. If no profit can be achieved, return 0.

For example, given the array [7, 1, 5, 3, 6, 4], the function should return 5, as the

maximum profit can be achieved by buying on day 2 (price = 1) and selling on day

5 (price = 6).

Requirements:

• Your solution should have a time complexity of O(n), where n is the

number of elements in the array.

• You can assume that the array will contain at least two elements.

5. Write a PHP script to fetch records from a MySQL database table named posts

and display them on a webpage. Additionally, implement functionality to filter

posts by category using URL parameters.

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

Hey Folks, It’s Worse Than We Thought — Claude’s Privacy Mess Just Got Bigger

  What started as a leak of shared Claude chats has turned into something much bigger — and much worse. The same thing is now happening with...