Você está na página 1de 8

Back-End Web Developer Test

150 Minutes

A. GENERAL QUESTION (60Min)


1.

Example :

Rent per night is $200

cleaning is $50

pet fee is $10 (Should be included into cleaning)

tax is 10% from rent and cleaning

a. Write a function to calculate total for house rental (including tax) by nights input paramater .
b. How many total calculation for house rental during 5 nights ?

2. Write a sql syntax from schema table in below

Table :

Employee (employee_id,first_name,last_name,email,phone,departement_id,salary)

Department (departement_id,department_name, location_id)

Location (location_id, street_address, state, city, country)

Question :

Show employee first name, employee last name, department name, and all location info who have name
"Bambang" placement on "IT Department" and location in "Yogyakarta"

3. There are two people who often go to the post office. Person A goes to the post office every 3 days and B
once every 7 days. Person A in 2015 started from 3 January 2015 and B started on January 5, 2015. The
question was in 2015, on the date of any Person A and B meet at the post office?
4. Please write using PHP to display this result :
-------------------------
54321
5432
543
54
5
-------------------------
5. Coordinates of 4 Cities in below :

City X Y

A 5 0

B 15 0

C 5 15

D 15 15
Calculate the shortest distance that must be traversed if they have been in four cities.
For example the most close to that (DCBA).
Write a function that coordinates the city can be edited and the output is automaticly not writen by
human(programmer):

hint :
1. Starting from city A

2. The distance formula : (√(xa-xb)^2 + (ya-yb)^2)

B. ADDITIONAL QUESTIONS (30Min) *


*(would be a great advantage if you answered this question)

I. WORDPRESS
1. A static front page is created using the ______ conditional template tag function.
a. home_page() c. is_static()
b. is_home() d. none of these
2. _______ refers to the various structured data that is maintained in the WordPress posts table.
a. metadata c. post excerpt
b. none of these d. post type
3. Which of the following code snippets can be used to create custom POST status in wordpress 3.0 +?
a. register_new_post() c. add_new_post_status()
b. register_post_status() d. modify_post_status()
4. Which PHP method(s) can be used to send form data that is persistent across succeeding page views
(such as for a language selection feature) in WordPress?
a. POST c. SESSION or COOKIE
b. GET d. POST or GET
5. Which of the following is the correct way to assign a category to a WordPress post?
a. wp_set_post_categories($postId,$categories)
b. wp_set_category($catId,$postId)
c. By XML-RPC call to wpc.newPost
d. This is not possible
6. Which of the functions below is required to create a new taxonomy?
a. add_taxonomy c. create_taxonomy
b. register_taxonomy d.new_taxonomy
7. What is the function of add_filter in WordPress?
a. It registers a filter for a tag.
b. It removes line breaks from the pages list.
c. It is a companion function to apply_filters().
d. All of the above.
8. Which of the following functions are used when adding CSS and jQuery codes on a WordPress plugin?
a. wp_register_style c. wp_enqueue_script
b. wp_enqueue_style d. None of these.
9. Company information and accessibility statements are best written as a _____.
a.Page c.Comment
b.Post d. Declaration
10. Themes typically reside in the ______ directory.
a.wp-content/ c.wp-content/styles
b.wp-content/main d.wp-content/themes
II. LARAVEL
1. How can we check input parameters before adding it to a query in the controller?
a. if (Input::has('search')) {

$queryString = Input::get('search');

$builder->where('name', 'LIKE', "%$queryString%");

b. if (request('search')) {
$queryString = Input::get('search');
$builder->where('name', 'LIKE', "%$queryString%");
}
c. if (Input::get('search')) {

$queryString = Input::get('search');

$builder->where('name', 'LIKE', "%$queryString%");

d. if (input::('search')) {

$queryString = Input::get('search');

$builder->where('name', 'LIKE', "%$queryString%");

2. Which of these methods is actually supported in Laravel routes?


a. Route::api()
b. Route::all()
c. Route::match()
d. Route::destroy()
3. What is the correct way to describe optional parameter in a route, so that both URLs "/companies"
and "/companies/1" would be covered?
a. Route::get(['companies', 'companies/{company_id}'], ...
b. Route::get('companies/{company_id?}', ...
c. Route::post('companies/{company_id}', ...
d. Route::any('companies/{company_id}', ...
4. Look at code snippet. What would be displayed?

Controller code:
-----------------
$name = '<strong>Taylor</strong>';
return view('welcome', compact('name'));

welcome.blade.php code:
------------------------
{!! $name !!}

a. It would throw an error


b. <strong>Taylor</strong>
c. Empty string
d. Taylor
5. What is Blade syntax to show a variable, avoiding error if the variable is not defined? (and then
showing empty string)
a. {{ $var | '' }}
b. {!! $var !!}
c. {{ $var or '' }}
d. {{ $var('') }}
6. See code snippet. What's the word behind XXXXXXXX?

@XXXXXXXX ($users as $user)


This is user {{ $user->id }}
@empty
No users found.
@endXXXXXXXX

a. forelse
b. foreach
c. if
d. while
7. To enable maintenance mode, simply execute this Artisan command:
a. artisan maintenance
b. artisan reset
c. artisan down
d. artisan stop
8. What command will show you all available routes in Laravel?
a. artisan route:all
b. artisan route:get
c. artisan route:list
d. artisan routes
9. Php artisan key:generate Typically, it generates a string of what length?
a. 32 characters
b. 6 characters
c. 16 characters
d. random length
10. Where can you find a default timezone set?
a. config/env.php
b. config/app.php
c. config/carbon.php
d. config/timezone.php
C. CODING (PHP & MYSQL) (60Min)
1. Create db gruneasia_devtest
2. Create employees, employee_types tables refer on design below :

3. Create file employees.php to display employees list


4. Create file employees-form.php to add and/or edit employee

5. Create file employees-delete.php to delete employee from list

NB :

- Please do coding (C) using php hardcode.

- After add, edit, delete process success it’s should be redirect back to employees list page
(employees.php)

- Please dump your local db as "gruneasia_devtest.sql" , then zip (all your code files + sql) as coding.zip

-[GOOD LUCK]-

Você também pode gostar