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
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.
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’);
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
Q34. In PHP, which operator should be used to check if two variable are identical?
Answer: b) ===
b) No. They are different languages.
Answer: d) Yes
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:
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
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
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
"1" + 2 + "3" + 4;
Answer: c) 1234
Q46. Which programming language is better?
a) It depends on requirement and expertise of programmer
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?
Answer: b), c), e)
Q49. What can be PHP used for?
a) Web applications
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
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?
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.
Q53. What are media queries?
b) It helps us make a website mobile-friendly
c) Variant of jQuery
d) Variant of MySQL Query
c) jQuery is a different language used for MySQL query
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.
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
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.
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
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
a) Depends on the server setting
Q62. Which PHP function can help prevent cross-site scripting?
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
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
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
a) No. That will be a duplication of efforts.
c) Yes. PHP also supports validation.
d) Yes. Client-side validation cannot be trusted.
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?
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
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
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?
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
Answer: b), c)
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.