Online Web Development Test for Hiring and Recruitment – Set 2

This online test contains all questions regarding Web Development for Hiring and Recruitment – Set 2. It covers different skills like HTML, CSS, JavaScript, PHP, jQuery, AJAX, XML, XHTML.

Note: More than one options may correct. So, read the questions carefully and analyze their options properly.

Practice Paper | Online Web Development Test for Hiring and Recruitment – Set 2

Let’s start attempting all the questions carefully. Evaluate this test by yourself.

Online Web Development Test for Hiring and Recruitment – Set 2

For Questions 1 to 30 Click HERE!

Q31. What is the difference between inline and block elements?

a) An inline element takes full width, block element doesn’t.
b) A block element always starts on a new line and takes up the full width available but inline doesn’t.
c) Inline elements can be used for one-line text only.
d) A block level element has a top and a bottom margin, whereas an inline element does not.

Answer: b) A block element always starts on a new line and takes up the full width available but inline doesn’t.

Online Web Development Test for Hiring and Recruitment – Set 2

Q32. How can you redirect a client to another page using PHP?

a) redirect(‘Content-Location: /another_page.php’);
b) header(‘Location: /another_page.php’);
c) goto(‘Location: /another_page.php’);
d) redirect(‘Location: /another_page.php’);

Answer: b) header(‘Location: /another_page.php’);

Online Web Development Test for Hiring and Recruitment – Set 2

Q33. Under which circumstances the $_SESSION super-global is available?

a) if session_start() was called
b) if register_global are enabled
c) Always available in PHP 5
d) If a valid seesion_id is passed via GET, POST or COOKIE

Answer: a) if session_start() was called

Online Web Development Test for Hiring and Recruitment – Set 2

Q34. In PHP, which operator should be used to check if two variable are identical?

a) ==
b) ===
c) eq
d) =

Answer: b) ===

Online Web Development Test for Hiring and Recruitment – Set 2

Q35. Can we change CSS properties values using JavaScript or jQuery?

a) Possible using JavaScript but not possible using jQuery.
b) No. They are different languages.
c) Possible using jQuery but not possible using JavaScript.
d) Yes.
e) We can only change CSS properties values if they are set using JavaScript or jQuery.

Answer: d) Yes

Online Web Development Test for Hiring and Recruitment – Set 2

Q36. In CSS, what is “clearfix” and what problem does it fix?

a) Force element to self-clear its children
b) Fixed the HTML layout
c) Clearfix clear the sibling’s elements
d) Fixed the browser specific styles

Answer: a) Force element to self-clear its children

Q37. With jQuery, What gets selected with selector: `$("div.intro")`

a) The first div element with class=”intro”
b) The first div element with id=”intro”
c) All div elements with id=”intro”
d) All div elements with class=”intro”

Answer: d) All div elements with class=”intro”

Q38. What is the purpose of DOCTYPE?

a) It is a document’s mime type
b) It is a new document format
c) It is an HTML tag used to normalize browser styles
d) It is an instruction to the browser about what version of the markup language the page is written in.

Answer: d) It is an instruction to the browser about what version of the markup language the page is written in.

Q39. You are downloading tweets from Twitter API. Twitter API has rate limits. How would you wait/sleep in the code?

a) Use parallel processing within the script, to get around the API limit
b) Run the script multiple times, in parallel, to get around the API limit
c) Keep track of API limits and do bookkeeping
d) Sleep after/before every request

Answer: a)

Q40. Why “reset password” feature on many websites does not give you your original password?

a) When we forget our password, websites also forget it
b) They are prohibited to do so because of privacy laws
c) A secure website doesn’t store your original password
d) This is an IEEE security standard that website follows to become standard compliant

Answer: c)

Q41. How will you prefer to transfer a private file securely to a friend?

a) Asynchronous encryption
b) Hash function with salts
c) Hash function
d) Synchronous encryption

Answer: d) Synchronous encryption

Q42. Is it better to always encrypt data?

a) Yes. Why compromise security!
b) It’s better to use a hash function
c) No. Encryption cannot be trusted anyway
d) Only if we need to protect data

Answer: a) Yes. Why compromise security!

Q43. How can we resize the image in HTML?

a) Using height attribute
b) Using resize attribute
c) Using width attribute
d) Using size attribute

Answer: a), c)

Q44. What is true for HTTPS?

a) An attacker cannot intercept HTTPS traffic
b) HTTPS has performance overhead compared to HTTP
c) An attacker cannot make sense of HTTPS traffic even if is intercepted
d) HTTPS protect users from phishing attack

Answer: d) HTTPS protect users from phishing attack

Q45. What does the below statement evaluate to, in JavaScript?

"1" + 2 + "3" + 4;

a) Error
b) 37
c) 1234
d) 46
e) 10

Answer: c) 1234

Q46. Which programming language is better?

a) It depends on requirement and expertise of programmer
b) Python
c) PHP
d) JavaScript
e) Java

Answer: a) It depends on requirement and expertise of programmer

Q47. In PHP, can we use $_GET and $_POST interchangeably?

a) No. They contain different data.
b) Depends on the PHP version.
c) Yes. They contain the same data.
d) Depends on the HTML version.

Answer: a) No. They contain different data.

Q48. In a client-server application, in response to an AJAX call, what possible data a PHP script can return?

a) Audio
b) HTML
c) JSON
d) Text
e) XML
f) Images
g) Video

Answer: b), c), e)

Q49. What can be PHP used for?

a) Web applications
b) Websites
c) Machine Learning
d) Desktop application
e) Command-line applications

Answer: a), b), d), e)

Q50. Can PHP session work without browser cookies?

a) No. Cookies are required to store session id
b) Yes. Browsers use local storage to store session id by default.
c) Yes. By appending session id in URLs
d) Yes. Session is server side concept and don’t depend on any browser aspect

Answer: c)

Q51. In CSS, what does the #log>span code snippet mean?

a) Any span child of the element with id as log.
b) Logs “span” to the console.
c) Specific span child of id greater than log.
d) Span child after log declaration.

Answer: a) Any span child of the element with id as log.

Q52. Is it compulsory for a server to respond in XML to an AJAX call?

a) Yes. AJAX = Asynchronous JavaScript and XML. So the server must return XML as a response.
b) Depends on server configuration.
c) Yes. XML is the only way a server can respond anyway.
d) No. The Server can send a non-XML response.

Answer: d)

Q53. What are media queries?

a) XQuerysuccessor
b) It helps us make a website mobile-friendly
c) Variant of jQuery
d) Variant of MySQL Query

Answer: b)

Q54. What is the relationship between JavaScript and jQuery?

a) jQuery is an advanced version of JavaScript
b) JavaScript is an advanced version of jQuery
c) jQuery is a different language used for MySQL query
d) jQuery is a JavaScript framework
e) JavaScript is a scripting framework for jQuery

Answer: a), d)

Q55. In MySQL, why is row-level locking better than table-level locking?

a) There is no such thing as table-level locking
b) Actually, table-level locking is better as it prevents the complete table from crashing. Row-level locking safeguards only a row.
c) There is no such thing as row-level locking
d) Two processes can simultaneously lock different row without blocking each other.

Answer: b)

Q56. Difference(s) between a cron job and a background job?

a) Cron job uses queue, background job uses stack
b) Cron job uses stack, background job uses queue
c) Cron job trigger based on time, background job are often event-driven
d) They are the same thing

Answer: a), c)

Q57. Which is better: Array or Linked List?

a) Doubly linked list is the best
b) It depends on application/use-case
c) A linked list is always better as it can grow as per needs
d) An array is always better as it takes less space

Answer: c)

Q58. In CSS, margin collapsing only happens with…

a) The horizontal margins of block elements in the normal flow.
b) The vertical margins of inline elements in the normal flow.
c) The horizontal margins of inline elements in the normal flow.
d) The vertical margins of block elements in the normal flow.

Answer: d)

Q59. Can we do animation using only CSS without using JavaScript or jQuery?

a) Yes. CSS alone can do some animation
b) No. We will need jQuery to animate things
c) Yes. Only if Flash or OpenGL is installed
d) No. We will need JavaScript to animate things

Answer: a) Yes. CSS alone can do some animation

Q60. What is the difference between hashing and encryption?

a) Hashing can be used to compute the signature, while encryption can be used to transfer data securely
b) Encryption is better than hashing
c) Hashing is used to store data, while encryption is used to manipulate data
d) Hashing is better than encryption

Answer: a)

Q61. Can a user disable JavaScript in the browser?

a) Depends on the server setting
b) No
c) Yes
d) Depends on the JavaScript version

Answer: c)

Q62. Which PHP function can help prevent cross-site scripting?

a) quotemeta()
b) strip_tags()
c) htmlspecialchars()
d) addslashes()

Answer: b), c), d)

Q63. How google search manages to return results so fast?

a) It has a very fast super-computer
b) It uses its trademark Pagerank algorithm
c) It indexes web pages in advance
d) It uses fiber optics for networks

Answer: b)

Q64. What is a box model in CSS?

a) Nothing related to CSS
b) The box is a CSS property
c) It is a CSS3 feature used to draw a box
d) It is the way the browser allocates space for HTML elements

Answer: d)

Q65. How will you prefer to store a private file securely for yourself?

a) Hash function with salts
b) Hash function
c) Asynchronous encryption
d) Synchronous encryption

Answer: d)

Q66. If you add a JavaScript validation on a contact form, do you need to validate data again in PHP?

a) No. That will be a duplication of efforts.
b) No. Validation can be done in JavaScript only. Not in PHP.
c) Yes. PHP also supports validation.
d) Yes. Client-side validation cannot be trusted.

Answer: d)

Q67. Which statement(s) is/are true for HTTP GET and POST requests?

a) It doesn’t matter if we replace HTTP GET with POST or vice-versa.
b) Search forms should use HTTP GET so result pages can be bookmarked.
c) Request parameters are visible in the URL for the GET request. HTTP POST request parameters are not visible in the URL.
d) GET requests can handle limited data. POST requests can handle generally much large input data.
e) Login forms should use HTTP POST requests for security.

Answer: b), c), d), e)

Q68. What can go wrong when with a PHP script handling a web request?

a) Network error – makes an upstream API call which fails
b) Memory limit – exceeds memory limit configured on server
c) Timeout – exceeds max execution configured on server
d) Disk error – attempts to make a local file read/write which can fail

Answer: b), c)

Q69. Which of the following attributes is needed for file upload via a form?

a) enctype=’multipart/form-data’
b) enctype=’singlepart/data’
c) enctype=’file’
d) enctype=’form-data/file’

Answer: a) enctype=’multipart/form-data’

Q70. How do we speed up/improve the performance of a web application?

a) Use better hardware for server infrastructure
b) Use caching
c) Add inline comments in the code
d) Write better codes

Answer: a), b), d)

Q71. Can we upload a file of any size to a PHP application?

a) Yes. Since PHP 7
b) Depends on configuration
c) If we specify unlimited file size in the HTML header
d) Depends on file type being uploaded

Answer: c)

Q72. How will you prefer to store passwords in an application?

a) Synchronous encryption
b) Asynchronous encryption
c) Hash function
d) Hash function with salts

Answer: d)

Q73. In CSS, what z-index would you give to an HTML positioned element to make it stack on top of another positioned element that has a z-index of 1?

a) 10
b) 2
c) -1
d) 0
e) 100

Answer: a), b), e)

Q74. In HTML, which statement(s) is/are true regarding <div> and <span> tag?

a) Both are block elements
b) <div> is inline element
c) <span> is block element
d) Both are inline elements
e) <span> is inline element
f) <div> is block element

Answer: e), f)

Q75. How PHP can be used in an AJAX application?

a) Can not be used because AJAX came after PHP
b) PHP can be used on the client-side to make AJAX calls
c) PHP can be used on the server-side to respond to AJAX calls
d) Can not be used at all as AJAX is asynchronous JavaScript and XML

Answer: b), c)


For Questions 1 to 30 Click HERE!


Explore! Artificial Intelligence Foundations Exams answers – SkillUp

The above question set contains all the correct answers. But in any case, you find any typographical, grammatical or any other error then kindly inform us.

Thanks in advance.

If you need answers of any exam then let me know through contact us page.

For discussion about any question, join the below comment section. And get the solution of your query. Also, try to share your thoughts about the topics covered in this particular quiz.

Leave a Comment

Your email address will not be published. Required fields are marked *