LinkedIn PHP Assessment Answers
The LinkedIn Skill Assessments feature allows you to demonstrate your knowledge of the skills you’ve added on your profile. Job posters on LinkedIn can also add Skill Assessments as part of the job application process. This allows job posters to more efficiently and accurately verify the crucial skills a candidate should have for a role.
The topics in the PHP assessment include:
- Utility Functions
- Control Structures
- Classes
- Language Basics
- Syntax
- Arrays
- Functions
- Sessions and Cookies
- Databases
- Strings
- Math
- Dates
- Operator Precedence
Question Format
Multiple Choice
Language
English
LinkedIn PHP Assessment Questions and Answers
- 1
- -1
- a parser error
- 0
- $encrypted = shal($password);
- $encrypted = crypt($password, \$salt);
- $encrypted = md5($password);
- $encrypted = password_hash($password, PASSWORD_DEFAULT);
- It makes sure the email address is a good and functioning address
- It makes an email safe to input into a database
- It assigns an email to a variable and then removes all illegal characters from the $email variable
- It verifies that an email address is well formed.
- Line 6 will cause an error because you can't reassign a new value to a variable that has already been set.
- Line 7 and 8 will cause an error. Line 7 has whitespace in $will i work and should be $will_i_work. Line 8 cannot start with a number befcause it is a variable.
- Line 5 will cause an error because some_string should be someString.
- Line 3 and 4 will cause an error because a variable cannot start with an underscore(_).
- ||
- &
- <=>
- &&
- &
- %
- _
- $
- GET is used with the HTTP protocol. POST is used with HTTPS.
- GET displays the submitted data as part of the URL. During POST, this information is not shown, as it's encoded in the request body.
- GET is intended for changing the server state and it carries more data than POST.
- GET is more secure than POST and should be used for sensitive information.
- greater-than; right
- spaceship; left
- equality; right
- comparison; left
- try, throw, catch, callable
- try, yield, catch, finally
- yield, throw, catch, finally
- try, throw, catch, finally
- 0
- NULL
- ''
- -1
- The $_REQUEST is missing.
- The $_COOKIES array is missing.
- The cookie session is missing.
- The call to setcookie() is missing.
- 44
- 138
- 126
- 100
- It makes the dot metacharacter match anything, including newline characters.
- It makes the pattern match uppercase letters.
- Both the pattern and subject string are treated as UTF-8.
- It inverts the greediness of the quantifiers in the pattern so they are not greedy by default.
- $dog = new Pet;
- all of these answers
- $horse = (new Pet);
- $cat = new Pet();
- This script times out the session for myusername.
- Cookies are starting to be stored as a result of this script.
- This script validates the username and password.
- This script is on a page that requires the user to be logged in. It checks to see if the user has a valid session.
- all of these answers
- #This is a comment
- /* This is a comment /
- // This is a comment
- for
- do-while
- while
- foreach
- You would use it to stop a user from clicking the back button if they decide not to view as a result of a click. //Maybe
- You would use this function if you have some important processing to do and you do not want to stop it, even if your users click Cancel.
- You would use this function if you wanted to abort the script for all logged-in users, not just the one who disconnected.
- You would use this function if you want a PHP script to run forever.
- [ ]
- [ ]
- [ ]
- [ ]
- /_ Space: the final frontier _/
- / Space: the final frontier /
- #Space: the final frontier
- // Space: the final frontier
- The browser would display nothing due to a syntax error.
- The browser would display an error, since there are no parentheses around the string.
- The browser would display How much are the bananas?
- The browser would display an error, since there is no semicolon at the end of the echo command.
- /
- %
- //
- DIV
- It makes the function variadic, allowing it to accept as an argument an array containing an arbitrary number of values.
- It makes the function variadic, allowing it to accept an arbitrary number of arguments that are converted into an array inside the function.
- It temporarily disables the function while debugging other parts of the script.
- It's a placeholder like a TO DO reminder that automatically triggers a notice when you run a script before completing the function definition.
- class Pegasus extends Horse {}
- class Alicorn imports Pegasus, Unicorn {}
- class Unicorn implements Horse {}
- class Horse inherits Unicorn {}
- compare; doubles;triples
- compare; triples;doubles
- assign; triples;doubles
- assign;doubles;triples
- Add this code to the top of your script:ini_set('display_errors',1);
- check the server error logged
- all of these answers
- make sure you are not missing any semicolons
- seasons=array( 1=>'spring', 2=>'summer', 3=>'autumn', 4=>'winter', );
- $seasons=array(spring,summer,autumn,winter);
- $seasons=('spring','summer','autumn','winter');
- $seasons=['spring','summer','autumn','winter'];
- private, public
- object, primitive
- non-static,static
- concrete,abstract
- euler3
- hypatia5
- hypatia3
- fibonacci4
- check if fav_band is included in the query string at the top of your browser
- all of the answers
- view the source of form and make sure there is an input field with the name 'fav_band'
- print everything that has been transmitted in the request:print_r($_REQUEST);
- all of the answers
- print_r($cupcakes);
- var_dump($cupcakes);
- foreach($cupcakes as &$cupcake) echo $cupcake;
- You are trying to modify a private value
- Semicolon missing
- Using a key on an array that does not exists
- Some html is being sent before a header() command that you are using for a redirect
- else
- break
- return
- continue
- there is an output '2 is an even number
- output '21 is an odd number'
- no output. Syntax error do to missing semicolon at the end
- no output due to % in $num%2!=0
- php -h
- php info
- php -v
- php -m
- 4.167
- 1.5
- 4
- 1
- The controller handles data passed to it by the view, and also passes data to the view. It interprets data sent by the view and disperses that data to the approrpiate models awaiting results to pass back to the view.
- The controller is a mechanism that allows you to create reusable code in languages such as PHP, where multiple inheritance is not supported.
- The controller presents content through the user interface, after communicating directly with the database.
- The controller handles specific tasks related to a specific area of functionality, handles business logic related to the results, and communicates directly with the database.
- Strings should always be wrapped in double quotes; and double quotes inside a string should be escaped by backslashes.
- All single and double quotes inside a string need to be escaped by backslashes to prevent a parse error.
- The opening and closing single quotes should be replaced by double quotes; and the apostrophe should be escaped by a backslash.
- The apostrophe needs to be escaped by a backslash to prevent it from being treated as the closing quote.
- $books = simplexml_load_string('books.xml'); echo $books->book[0]->categories->category[1];
- $books = simplexml_load_file('books.xml'); echo $books->book[0]->categories->category[1];
- $books = SimpleXMLElement('books.xml'); echo $books->book[0]->categories->category[1];
- $books = SimpleXML('books.xml'); echo $books->book[0]->categories->category[1];
- NULL
- TRUE
- FALSE
- 0
- echo $first_name. ' '. $familiy_name;
- print $first_name, ' ', $familiy_name;
- print $first_name. ' '. $familiy_name;
- echo $first_name, ' ', $familiy_name;
- [ ]
- [ ]
- [ ]
- [x]
No comments:
Post a Comment