- Which HTTP method is idempotent but not safe?
A. GET
B. POST
C. PUT
D. CONNECT
Answer: C - What does the Same-Origin Policy primarily prevent?
A. SQL Injection
B. Cross-site scripting
C. Unauthorized DOM access across domains
D. DNS spoofing
Answer: C - In REST architecture, which constraint enforces statelessness?
A. Cacheable
B. Client-Server
C. Stateless
D. Uniform Interface
Answer: C - Which JavaScript feature allows asynchronous code execution?
A. Closure
B. Callback Queue
C. Prototype
D. Hoisting
Answer: B - What is the default port for HTTPS?
A. 21
B. 80
C. 443
D. 25
Answer: C - Which CSS property creates a stacking context?
A. display
B. position with z-index
C. margin
D. padding
Answer: B - Which HTML5 API is used for drawing graphics?
A. WebGL
B. Canvas
C. SVG
D. DOM
Answer: B - Which HTTP header is used to control caching?
A. Authorization
B. Content-Type
C. Cache-Control
D. Accept
Answer: C - What does CORS stand for?
A. Cross-Origin Resource Sharing
B. Cross Object Rendering System
C. Client Object Request System
D. Cross-Origin Response Security
Answer: A - Which JavaScript keyword creates block scope?
A. var
B. let
C. function
D. global
Answer: B - Which protocol is used for real-time web communication?
A. HTTP
B. FTP
C. WebSocket
D. SMTP
Answer: C - Which CSS unit is relative to root element?
A. em
B. px
C. rem
D. %
Answer: C - Which tag is used for embedding video in HTML5?
A. media
B. video
C. embed
D. object
Answer: B - Which JavaScript method converts JSON string to object?
A. JSON.stringify()
B. JSON.parse()
C. parseJSON()
D. toObject()
Answer: B - Which HTTP status code means “Created”?
A. 200
B. 201
C. 204
D. 301
Answer: B - What is the main purpose of a Service Worker?
A. Styling
B. Background scripts and caching
C. Database management
D. DOM manipulation
Answer: B - Which CSS property controls flex direction?
A. align-items
B. flex-direction
C. justify-content
D. flex-wrap
Answer: B - Which attack injects malicious scripts into web pages?
A. CSRF
B. XSS
C. SQL Injection
D. MITM
Answer: B - Which database is commonly used with Node.js?
A. Oracle
B. MySQL
C. MongoDB
D. DB2
Answer: C - Which JavaScript concept refers to function retaining access to outer scope?
A. Inheritance
B. Closure
C. Callback
D. Binding
Answer: B - Which HTML element defines navigation links?
A. nav
B. link
C. menu
D. section
Answer: A - Which CSS property is used to create grid layout?
A. display: flex
B. display: grid
C. float
D. position
Answer: B - Which HTTP method is not idempotent?
A. GET
B. PUT
C. DELETE
D. POST
Answer: D - Which JavaScript method adds element to end of array?
A. push()
B. pop()
C. shift()
D. unshift()
Answer: A - Which security mechanism protects against CSRF?
A. Tokens
B. Encryption
C. Hashing
D. Cookies
Answer: A - Which HTML attribute specifies inline styles?
A. class
B. id
C. style
D. css
Answer: C - Which protocol sends emails?
A. HTTP
B. SMTP
C. FTP
D. DNS
Answer: B - Which JavaScript keyword refers to current object?
A. self
B. this
C. current
D. object
Answer: B - Which CSS property controls overflow?
A. overflow
B. clip
C. hidden
D. visible
Answer: A - Which HTTP status code means “Not Found”?
A. 200
B. 301
C. 404
D. 500
Answer: C - Which API allows storing key-value pairs in browser?
A. DOM
B. Web Storage
C. WebRTC
D. Fetch API
Answer: B - Which JavaScript loop executes at least once?
A. for
B. while
C. do-while
D. foreach
Answer: C - Which CSS property sets text color?
A. font-color
B. text-style
C. color
D. background-color
Answer: C - Which HTML tag defines form input?
A. form
B. input
C. field
D. text
Answer: B - Which HTTP method retrieves data?
A. POST
B. GET
C. PUT
D. DELETE
Answer: B - Which JavaScript method removes last element?
A. shift()
B. pop()
C. push()
D. splice()
Answer: B - Which CSS property controls element visibility?
A. display
B. opacity
C. visibility
D. hide
Answer: C - Which JavaScript object handles asynchronous HTTP requests?
A. XMLHttpRequest
B. DOM
C. JSON
D. BOM
Answer: A - Which HTML tag is used for hyperlink?
A. link
B. href
C. a
D. url
Answer: C - Which protocol resolves domain names?
A. HTTP
B. DNS
C. FTP
D. TCP
Answer: B - Which JavaScript feature allows inheritance?
A. Prototype
B. Closure
C. Scope
D. Hoisting
Answer: A - Which CSS property aligns items horizontally in flexbox?
A. align-items
B. justify-content
C. flex-direction
D. align-content
Answer: B - Which HTTP header defines content type?
A. Accept
B. Content-Type
C. Authorization
D. Host
Answer: B - Which JavaScript function delays execution?
A. setTimeout()
B. setInterval()
C. delay()
D. wait()
Answer: A - Which HTML tag defines table row?
A. td
B. tr
C. th
D. table
Answer: B - Which CSS property sets background color?
A. bg-color
B. color
C. background-color
D. fill
Answer: C - Which JavaScript method converts object to JSON?
A. JSON.parse()
B. JSON.stringify()
C. toJSON()
D. convert()
Answer: B - Which HTTP status code means server error?
A. 300
B. 400
C. 500
D. 600
Answer: C - Which HTML tag defines unordered list?
A. ol
B. ul
C. li
D. list
Answer: B - Which CSS property controls font size?
A. text-size
B. font-size
C. size
D. text-style
Answer: B
Pages: 1 2