FPSC Past Papers MCQs

FPSC Programmer (BS 17) PMD High Yield 2026  — 350 MCQs  (Page 35 of 35)

Practice FPSC Past Papers MCQs with solved questions from real past exams. These MCQs cover FPSC Programmer (BS 17) PMD High Yield 2026 past papers and are ideal for candidates preparing for competitive exams.

View Tests (30 MCQs each)
What is CSRF (Cross-Site Request Forgery)?
  • Tricking a logged-in user's browser into sending an unwanted request to a site where the user is authenticated
  • Guessing passwords
  • Stealing a database through SQL
  • Injecting scripts into pages
How should user passwords be stored?
  • Encrypted with AES, so they can be decrypted later
  • In plain text in a secure database
  • As salted hashes using a slow algorithm such as bcrypt, scrypt, or Argon2
  • As MD5 hashes
Does a correct CORS configuration protect an API from being called by scripts or tools such as curl?
  • Yes, but only for POST requests
  • No; CORS only controls which web origins a browser lets read the responses. Server-side authentication is still required
  • CORS encrypts API traffic
  • Yes, it blocks all unauthorized clients
In PHP, how do variables start, and what does == do compared with ===?
  • With $; == compares after type juggling, while === also requires the same type
  • With no prefix; == is strict
  • With #; === is assignment
  • With @; both are strict
Which statement about REST APIs is correct?
  • They keep session state on the server for each request
  • They must use XML
  • They require SOAP envelopes
  • They expose resources through URLs, use HTTP methods (GET, POST, PUT, DELETE), and are stateless
What is the difference between PUT and PATCH?
  • They are identical
  • PATCH creates new resources only
  • PUT replaces the whole resource; PATCH applies a partial update
  • PUT is used for reading
What does "" == 0 evaluate to in JavaScript?
  • true
  • TypeError
  • undefined
  • false
Which statement about cookies and localStorage is correct?
  • Cookies are sent to the server with every matching HTTP request; localStorage stays in the browser and is never sent automatically
  • localStorage is sent; cookies are not
  • Both are sent with every request
  • Neither is ever accessible to JavaScript