[ PHP Programming MCQS ]

झारखंड में आयोजित होने वाली JPSC, JSSC, JET, झारखंड पुलिस भर्ती परीक्षा आदि के लिए उपयोगी सामान्य अध्ययन।

[ PHP Programming MCQS ]

Useful GK for JPSC, JSSC, JET, Jharkhand Police and other exams.
361. Mediator Pattern का उद्देश्य क्या है?
[A] Reduce Direct Dependencies
[B] Increase Coupling
[C] Manage CSS
[D] Store Files
361. What is the purpose of Mediator Pattern?
[A] Reduce Direct Dependencies
[B] Increase Coupling
[C] Manage CSS
[D] Store Files
सही उत्तर: Reduce Direct Dependencies
व्याख्या: Objects के बीच communication simplify करता है।
Correct Answer: Reduce Direct Dependencies
Explanation: Simplifies communication between objects.
362. Command Pattern किस concept पर आधारित है?
[A] Encapsulate Requests as Objects
[B] Store Sessions
[C] Manage Images
[D] Optimize CSS
362. What concept is Command Pattern based on?
[A] Encapsulate Requests as Objects
[B] Store Sessions
[C] Manage Images
[D] Optimize CSS
सही उत्तर: Encapsulate Requests as Objects
व्याख्या: Requests को objects में encapsulate करता है।
Correct Answer: Encapsulate Requests as Objects
Explanation: Encapsulates requests as objects.
363. Saga Pattern किस architecture में लोकप्रिय है?
[A] Microservices
[B] MVC Only
[C] Monolithic UI
[D] Static Websites
363. In which architecture is Saga Pattern popular?
[A] Microservices
[B] MVC Only
[C] Monolithic UI
[D] Static Websites
सही उत्तर: Microservices
व्याख्या: Distributed transactions manage करने के लिए।
Correct Answer: Microservices
Explanation: Used to manage distributed transactions.
364. Anti-Corruption Layer का उद्देश्य क्या है?
[A] Protect Domain Model
[B] Delete Old Data
[C] Increase Queries
[D] Manage Cache
364. What is the purpose of an Anti-Corruption Layer?
[A] Protect Domain Model
[B] Delete Old Data
[C] Increase Queries
[D] Manage Cache
सही उत्तर: Protect Domain Model
व्याख्या: External systems से domain model को बचाता है।
Correct Answer: Protect Domain Model
Explanation: Protects the domain model from external systems.
365. Software Architecture में Separation of Concerns का अर्थ क्या है?
[A] Different Responsibilities in Different Components
[B] All Logic in One File
[C] No Abstraction
[D] No Layers
365. What does Separation of Concerns mean in software architecture?
[A] Different Responsibilities in Different Components
[B] All Logic in One File
[C] No Abstraction
[D] No Layers
सही उत्तर: Different Responsibilities in Different Components
व्याख्या: प्रत्येक component की अलग responsibility होनी चाहिए।
Correct Answer: Different Responsibilities in Different Components
Explanation: Each component should have a distinct responsibility.
366. SQL Injection से बचाव के लिए सबसे अच्छा तरीका क्या है?
[A] addslashes()
[B] Prepared Statements
[C] htmlspecialchars()
[D] base64_encode()
366. What is the best way to prevent SQL Injection?
[A] addslashes()
[B] Prepared Statements
[C] htmlspecialchars()
[D] base64_encode()
सही उत्तर: Prepared Statements
व्याख्या: Prepared Statements और Parameterized Queries SQL Injection से सुरक्षा प्रदान करते हैं।
Correct Answer: Prepared Statements
Explanation: Prepared Statements and parameterized queries protect against SQL Injection.
367. PHP में password hash करने के लिए कौन-सा function recommended है?
[A] md5()
[B] sha1()
[C] password_hash()
[D] crypt_old()
367. Which function is recommended for password hashing in PHP?
[A] md5()
[B] sha1()
[C] password_hash()
[D] crypt_old()
सही उत्तर: password_hash()
व्याख्या: password_hash() bcrypt/argon आधारित सुरक्षित hashing प्रदान करता है।
Correct Answer: password_hash()
Explanation: Provides secure bcrypt/argon based hashing.
368. Password verify करने के लिए कौन-सा function उपयोग किया जाता है?
[A] password_match()
[B] password_check()
[C] password_verify()
[D] hash_verify()
368. Which function is used to verify passwords?
[A] password_match()
[B] password_check()
[C] password_verify()
[D] hash_verify()
सही उत्तर: password_verify()
व्याख्या: Hashed password को verify करने के लिए।
Correct Answer: password_verify()
Explanation: Used to verify hashed passwords.
369. XSS attack से बचने के लिए कौन-सा function उपयोगी है?
[A] htmlspecialchars()
[B] md5()
[C] trim()
[D] implode()
369. Which function helps prevent XSS attacks?
[A] htmlspecialchars()
[B] md5()
[C] trim()
[D] implode()
सही उत्तर: htmlspecialchars()
व्याख्या: HTML entities encode करके XSS रोकता है।
Correct Answer: htmlspecialchars()
Explanation: Encodes HTML entities to prevent XSS.
370. CSRF protection के लिए सबसे सामान्य तरीका क्या है?
[A] CSRF Token
[B] MD5 Hash
[C] Session Destroy
[D] Base64 Encoding
370. What is the most common CSRF protection method?
[A] CSRF Token
[B] MD5 Hash
[C] Session Destroy
[D] Base64 Encoding
सही उत्तर: CSRF Token
व्याख्या: Unique token request validation के लिए।
Correct Answer: CSRF Token
Explanation: Unique token validation mechanism.