Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- // 1
- // php arrays knowledge
- // Here are $products array. The owner wants to increase all the prices by 15%
- // please loop through the array and increase each price by 15%
- //
- // you may use http://phptester.net/ and print_r or var_dump to show the results
- $products = [
- 'mop' => [
- 'quantity' => 18,
- 'price' => 12,
- ],
- 'hammer' => [
- 'small' => [ 'quantity' => 2, 'price' => 24 ]
- ],
- 'furniture' => [
- 'kitchen_stuff' => [
- 'chair' => [ 'quantity' => 7, 'price' => 53 ],
- 'table' => [
- 'small' => [ 'quantity' => 8, 'price' => 113 ],
- 'large' => [ 'quantity' => 1, 'price' => 214 ]
- ]
- ],
- 'sofa' => [ 'quantity' => 1, 'price' => 345 ]
- ]
- ];
- // 2
- // MYSQL knowledge
- // here are 3 mysql tables
- // 1. Please make a mysql query to list users, but only those who have a car
- // <name> => <car name>
- //
- // 2. Please make a mysql query to pull out emails of only those users who have bmw model
- //users
- id | name | email
- -------------------
- 1 | John | aaa@bbb.cc
- 2 | Sara | abb@bbb.cc
- 3 | David| abc@bbb.cc
- 4 | Nick | acc@bbb.cc
- 5 | Mike | aac@bbb.cc
- //users_cars
- id | user_id | car_model_id
- ----------------------------
- 1 | 2 | 1
- 2 | 3 | 2
- 3 | 4 | 3
- 4 | 5 | 3
- //car_models
- id | model
- ----------
- 1 | toyota
- 2 | kia
- 3 | bmw
- // 3
- // HTML knowledge
- // Using codepen please create a html layout of a page
- // 80px - (bg yellow) header
- // 200px - (bg gray) bottom pushed to the bottom of the page. Pushed but not a fixed position.
- // 20% of width - (bg red) side bar
- // 80% of width white main content
- // no scroll bar if main content is smaller than 100% of height.
- // footer should remind at the bottom but not overlay the content from main
- |------------------|<-header
- |__________________|
- | | |
- | | |
- | | |<--main block
- | | |
- |------------------|
- | footer |
- |------------------|
- // 4 (optional)
- // JAVASCRIPT knowledge:
- var myNumber = 12;
- // please make chinable function "doubleNumber" (a prototype function) to have these results
- console.log(myNumber.doubleNumber()); //24
- myNumber = 20;
- console.log(myNumber.doubleNumber()); //40
- // 5
- // regex knowledge
- // here is part of a log file. Please retrieve by using regex
- // all emails that have sent us emails ( from=)
- // Please test the result at https://regex101.com/
- //
- received from="aaa@bbb.cc.uk" via="aaabbb.ee" ip="unknown" to="qqq@ccc.uu"
- received from="aab@bgb.cc" ip="11.22.33.44" to="qqq@ccc.uu"
- received from="acaf@hhh.cc" ip="unknown" to="qqq@ccc.uu"
- received from="ac56af@abc22.name" ip="88.55.21.56" to="qqq@ccc.uu"
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement