Web Programming

  1. Which HTTP header is used to send cookies from server to client?
    A. Cookie
    B. Set-Cookie
    C. Authorization
    D. Session
    Answer: B
  2. What is the purpose of the defer attribute in script tag?
    A. Executes script immediately
    B. Delays script execution until after HTML parsing
    C. Blocks HTML parsing
    D. Loads script synchronously
    Answer: B
  3. Which JavaScript function is used to execute code repeatedly at fixed intervals?
    A. setTimeout()
    B. setInterval()
    C. loop()
    D. repeat()
    Answer: B
  4. Which CSS property defines the space between elements’ borders?
    A. padding
    B. margin
    C. spacing
    D. border-spacing
    Answer: B
  5. Which HTTP status code indicates “Forbidden”?
    A. 401
    B. 403
    C. 404
    D. 500
    Answer: B
  6. Which HTML5 feature allows offline web applications?
    A. Cookies
    B. Service Workers
    C. WebSockets
    D. LocalStorage
    Answer: B
  7. Which JavaScript method selects an element by ID?
    A. getElement()
    B. querySelector()
    C. getElementById()
    D. selectById()
    Answer: C
  8. Which CSS property is used to make text bold?
    A. font-style
    B. font-weight
    C. text-weight
    D. text-style
    Answer: B
  9. Which protocol is used for secure file transfer over web?
    A. FTP
    B. HTTP
    C. SFTP
    D. SMTP
    Answer: C
  10. Which JavaScript keyword prevents reassignment?
    A. var
    B. let
    C. const
    D. static
    Answer: C
  11. Which HTML tag defines metadata?
    A. head
    B. meta
    C. data
    D. info
    Answer: B
  12. Which CSS property controls element transparency?
    A. visibility
    B. display
    C. opacity
    D. filter
    Answer: C
  13. Which JavaScript array method removes first element?
    A. pop()
    B. shift()
    C. splice()
    D. remove()
    Answer: B
  14. Which HTTP method is used to update partial data?
    A. PUT
    B. POST
    C. PATCH
    D. GET
    Answer: C
  15. Which HTML tag is used for line break?
    A. break
    B. br
    C. lb
    D. hr
    Answer: B
  16. Which CSS property defines element position type?
    A. float
    B. display
    C. position
    D. layout
    Answer: C
  17. Which JavaScript operator checks both value and type?
    A. ==
    B. ===
    C. !=
    D. =
    Answer: B
  18. Which HTTP header is used for authentication?
    A. Accept
    B. Authorization
    C. Content-Type
    D. Cookie
    Answer: B
  19. Which HTML tag defines ordered list?
    A. ul
    B. ol
    C. li
    D. list
    Answer: B
  20. Which CSS property aligns text horizontally?
    A. align
    B. text-align
    C. horizontal-align
    D. justify
    Answer: B
  21. Which JavaScript method merges arrays?
    A. join()
    B. merge()
    C. concat()
    D. combine()
    Answer: C
  22. Which HTTP status code means “Unauthorized”?
    A. 401
    B. 403
    C. 404
    D. 500
    Answer: A
  23. Which HTML tag defines image?
    A. image
    B. img
    C. src
    D. pic
    Answer: B
  24. Which CSS property sets border width?
    A. border-size
    B. border-width
    C. width
    D. outline
    Answer: B
  25. Which JavaScript event occurs when page loads?
    A. onload
    B. onready
    C. load
    D. ready
    Answer: A
  26. Which API is used for making HTTP requests in modern JS?
    A. XMLHttpRequest
    B. Fetch API
    C. DOM API
    D. Web Storage
    Answer: B
  27. Which CSS property controls element floating?
    A. align
    B. float
    C. position
    D. display
    Answer: B
  28. Which JavaScript function parses integer?
    A. parseFloat()
    B. parseInt()
    C. Number()
    D. toInt()
    Answer: B
  29. Which HTTP status code means “Moved Permanently”?
    A. 200
    B. 301
    C. 302
    D. 404
    Answer: B
  30. Which HTML tag defines paragraph?
    A. para
    B. p
    C. text
    D. paragraph
    Answer: B
  31. Which CSS property sets element height?
    A. size
    B. height
    C. length
    D. dimension
    Answer: B
  32. Which JavaScript method checks array condition?
    A. filter()
    B. map()
    C. some()
    D. forEach()
    Answer: C
  33. Which HTTP protocol version introduced multiplexing?
    A. HTTP/1.0
    B. HTTP/1.1
    C. HTTP/2
    D. HTTP/3
    Answer: C
  34. Which HTML attribute specifies alternate text?
    A. title
    B. alt
    C. desc
    D. text
    Answer: B
  35. Which CSS property controls font style?
    A. font-style
    B. text-style
    C. style
    D. font-weight
    Answer: A
  36. Which JavaScript method executes function for each element?
    A. map()
    B. forEach()
    C. filter()
    D. reduce()
    Answer: B
  37. Which HTTP header indicates accepted response types?
    A. Content-Type
    B. Accept
    C. Authorization
    D. Host
    Answer: B
  38. Which HTML tag defines heading level 1?
    A. head
    B. h1
    C. header
    D. title
    Answer: B
  39. Which CSS property creates rounded corners?
    A. border-radius
    B. corner-radius
    C. radius
    D. border-style
    Answer: A
  40. Which JavaScript method filters array elements?
    A. map()
    B. filter()
    C. reduce()
    D. find()
    Answer: B
  41. Which HTTP status code means “Bad Request”?
    A. 200
    B. 300
    C. 400
    D. 500
    Answer: C
  42. Which HTML tag defines footer section?
    A. foot
    B. bottom
    C. footer
    D. section
    Answer: C
  43. Which CSS property controls element display type?
    A. position
    B. display
    C. float
    D. visibility
    Answer: B
  44. Which JavaScript method finds first matching element?
    A. filter()
    B. find()
    C. map()
    D. reduce()
    Answer: B
  45. Which HTTP method deletes resource?
    A. GET
    B. POST
    C. PUT
    D. DELETE
    Answer: D
  46. Which HTML tag defines division section?
    A. span
    B. div
    C. section
    D. block
    Answer: B
  47. Which CSS property controls z-axis stacking?
    A. depth
    B. z-index
    C. layer
    D. position
    Answer: B
  48. Which JavaScript method reduces array to single value?
    A. map()
    B. filter()
    C. reduce()
    D. some()
    Answer: C
  49. Which HTTP status code means “OK”?
    A. 200
    B. 201
    C. 202
    D. 204
    Answer: A
  50. Which HTML tag defines inline container?
    A. div
    B. span
    C. section
    D. inline
    Answer: B

Leave a Comment