376 Question 376 EN + हिं Medium GB C++ placement new syntax: IN C++ प्लेसमेंट नया सिंटैक्स: A new T; नया टी; B new(ptr) T(args); नया(पीटीआर) टी(आर्ग); C alloc T at ptr; पीटीआर पर टी आवंटित करें; D Error गलती ✅ Correct Answer: 💡 Explanation / व्याख्या Explanation (English) Placement new constructs T at pre-allocated memory ptr. व्याख्या (हिन्दी) पूर्व-आवंटित मेमोरी पीटीआर पर नए निर्माण टी को प्लेसमेंट। 🎯 Exam Perspective Data Structures and Algorithms ("Introduction to DSA" sub-topic) के इस प्रश्न को — difficulty level "Medium" कई प्रतियोगी परीक्षाओं जैसे Railway, SSC, Banking और Defence परीक्षाओं में repeat होते देखा गया है। Concept clarity के लिए explanation section जरूर पढ़ें। 🔗 Related Questions std::try_lock() differs from lock() in: Without atomic, same code above would give: The output of: thread t1([]{cout 📚 Related Topic Arrays (16) Linked List (25) Stack (14)
377 Question 377 EN + हिं GB What is the output: int* arr=new int[5]{1,2,3,4,5}; cout< IN आउटपुट क्या है: int* arr=new int[5]{1,2,3,4,5}; अदालत A 2 2 B 3 3 C 1 1 D Error गलती ✅ Correct Answer: 💡 Explanation / व्याख्या Explanation (English) arr[2]=3. व्याख्या (हिन्दी) गिरफ्तार[2]=3. 🎯 Exam Perspective यह सवाल Data Structures and Algorithms ("Introduction to DSA" sub-topic) category का है, और SSC, Railway, Banking और State PCS के exam pattern में इस तरह के questions common हैं। Answer choose करने के बाद दिया गया explanation जरूर पढ़ें। 🔗 Related Questions The output of: mutex m; int x=0; thread t([&]{lock_guar... C++ placement new syntax: std::mutex::lock() blocks until: 📚 Related Topic Arrays (16) Linked List (25) Stack (14)
378 Question 378 EN + हिं GB The output of: auto ptr=make_unique(5); ptr[2]=42; cout< IN इसका आउटपुट: auto ptr=make_unique(5); पीटीआर[2]=42; अदालत A Error गलती B 42 42 D 5 5 ✅ Correct Answer: 💡 Explanation / व्याख्या Explanation (English) unique_ptr supports subscript; ptr[2]=42. व्याख्या (हिन्दी) यूनिक_पीटीआर सबस्क्रिप्ट का समर्थन करता है; पीटीआर[2]=42. 🎯 Exam Perspective यह प्रश्न Data Structures and Algorithms ("Introduction to DSA" sub-topic) की तैयारी करने वाले अभ्यर्थियों के लिए उपयोगी है। इस तरह के प्रश्न अक्सर SSC CGL, IBPS, RRB और State-level परीक्षाओं जैसी परीक्षाओं में पूछे जाते रहे हैं, इसलिए concept और explanation दोनों को ध्यान से समझें, सिर्फ उत्तर याद न करें। 🔗 Related Questions std::try_lock() differs from lock() in: The output of: auto sp=make_shared(10); auto sp2=sp; *s... std::mutex::lock() blocks until: 📚 Related Topic Arrays (16) Linked List (25) Stack (14)
379 Question 379 EN + हिं GB The output of: auto sp=make_shared(10); auto sp2=sp; *sp=20; cout<<*sp2; IN इसका आउटपुट: auto sp=make_shared(10); ऑटो sp2=sp; *एसपी=20; अदालत A 10 10 B 20 20 C Error गलती D Undefined अपरिभाषित ✅ Correct Answer: 💡 Explanation / व्याख्या Explanation (English) sp and sp2 share same object; *sp=20 modifies it; *sp2=20. व्याख्या (हिन्दी) एसपी और एसपी2 एक ही वस्तु साझा करते हैं; *sp=20 इसे संशोधित करता है; *sp2=20. 🎯 Exam Perspective Data Structures and Algorithms ("Introduction to DSA" sub-topic) से जुड़ा यह सवाल उन students के लिए काम का है जो UPSC, SSC, Banking और Police भर्ती की तैयारी कर रहे हैं। बेहतर होगा कि explanation पढ़कर concept clear करें, ताकि exam में similar प्रश्न आने पर confusion न हो। 🔗 Related Questions The output of: auto sp=make_shared(42); auto sp2=sp; co... The output of: auto sp=make_shared(5); weak_ptr wp=sp;... C++ placement new syntax: 📚 Related Topic Arrays (16) Linked List (25) Stack (14)
380 Question 380 EN + हिं GB The output of: auto sp=make_shared(5); weak_ptr wp=sp; sp.reset(); cout< IN इसका आउटपुट: auto sp=make_shared(5); कमजोर_पीटीआर wp=sp; एसपी.रीसेट(); अदालत B 1 1 C Error गलती D Undefined अपरिभाषित ✅ Correct Answer: 💡 Explanation / व्याख्या Explanation (English) sp reset to null; count=0; object deleted; wp.expired()=true=1. व्याख्या (हिन्दी) एसपी शून्य पर रीसेट हो गया; गिनती=0; ऑब्जेक्ट हटा दिया गया; wp.समाप्त()=सत्य=1. 🎯 Exam Perspective Railway, SSC, Banking और Defence परीक्षाओं जैसी परीक्षाओं में Data Structures and Algorithms ("Introduction to DSA" sub-topic) से सवाल अक्सर पूछे जाते हैं। इसलिए सिर्फ answer रटने के बजाय, नीचे दी गई explanation को ध्यान से पढ़ें और concept समझें। 🔗 Related Questions std::try_lock() differs from lock() in: std::call_once guarantees: What is the output: int* arr=new int[5]{1,2,3,4,5}; cou... 📚 Related Topic Arrays (16) Linked List (25) Stack (14)
381 Question 381 EN + हिं GB What is the output: auto sp=make_shared(42); cout< IN आउटपुट क्या है: auto sp=make_shared(42); अदालत B 1 1 C 2 2 D Error गलती ✅ Correct Answer: 💡 Explanation / व्याख्या Explanation (English) One owner sp; use_count=1. व्याख्या (हिन्दी) एक मालिक एसपी; उपयोग_गिनती=1. 🎯 Exam Perspective अगर आप SSC, Railway, Banking और State PCS की तैयारी कर रहे हैं, तो Data Structures and Algorithms ("Introduction to DSA" sub-topic) का यह topic आपके लिए महत्वपूर्ण है। Exam में accuracy बढ़ाने के लिए हर सवाल की explanation जरूर पढ़ें। 🔗 Related Questions std::mutex::lock() blocks until: C++ placement new syntax: The output of: auto sp=make_shared(10); auto sp2=sp; *s... 📚 Related Topic Arrays (16) Linked List (25) Stack (14)
382 Question 382 EN + हिं GB The output of: auto sp=make_shared(42); auto sp2=sp; cout< IN इसका आउटपुट: auto sp=make_shared(42); ऑटो sp2=sp; अदालत A 1 1 B 2 2 C 3 3 D Error गलती ✅ Correct Answer: 💡 Explanation / व्याख्या Explanation (English) Two owners sp and sp2; use_count=2. व्याख्या (हिन्दी) दो मालिक एसपी और एसपी2; उपयोग_गिनती=2. 🎯 Exam Perspective Data Structures and Algorithms ("Introduction to DSA" sub-topic) के इस प्रश्न को कई प्रतियोगी परीक्षाओं जैसे SSC CGL, IBPS, RRB और State-level परीक्षाओं में repeat होते देखा गया है। Concept clarity के लिए explanation section जरूर पढ़ें। 🔗 Related Questions What is the output: int* arr=new int[5]{1,2,3,4,5}; cou... std::call_once guarantees: The output of: mutex m; int x=0; thread t([&]{lock_guar... 📚 Related Topic Arrays (16) Linked List (25) Stack (14)
383 Question 383 EN + हिं GB The output of: thread t1([]{cout<<"A";}); thread t2([]{cout<<"B";}); t1.join(); t2.join(); output is: IN इसका आउटपुट: थ्रेड t1([]{cout A AB always एबी हमेशा B BA always बीए हमेशा C AB or BA (non-deterministic) एबी या बीए (गैर-नियतात्मक) D Error गलती ✅ Correct Answer: 💡 Explanation / व्याख्या Explanation (English) Thread execution order is non-deterministic. व्याख्या (हिन्दी) थ्रेड निष्पादन आदेश गैर-नियतात्मक है। 🎯 Exam Perspective यह सवाल Data Structures and Algorithms ("Introduction to DSA" sub-topic) category का है, और UPSC, SSC, Banking और Police भर्ती के exam pattern में इस तरह के questions common हैं। Answer choose करने के बाद दिया गया explanation जरूर पढ़ें। 🔗 Related Questions The output of: mutex m; int x=0; thread t([&]{lock_guar... What is the output: atomic x=0; thread t1([&]{for(int i... The output of: auto sp=make_shared(42); auto sp2=sp; co... 📚 Related Topic Arrays (16) Linked List (25) Stack (14)
384 Question 384 EN + हिं GB What is the output: atomic x=0; thread t1([&]{for(int i=0;i<1000;i++)x++;}); thread t2([&]{for(int i=0;i<1000;i++)x++;}); t1.join(); t2.join(); cout< IN आउटपुट क्या है: परमाणु x=0; थ्रेड t1([&]{for(int i=0;i A 1000 1000 B 2000 2000 C Undefined (race condition) अपरिभाषित (दौड़ की स्थिति) ✅ Correct Answer: 💡 Explanation / व्याख्या Explanation (English) atomic prevents race; 2000 increments guaranteed. व्याख्या (हिन्दी) परमाणु दौड़ को रोकता है; 2000 वेतन वृद्धि की गारंटी. 🎯 Exam Perspective यह प्रश्न Data Structures and Algorithms ("Introduction to DSA" sub-topic) की तैयारी करने वाले अभ्यर्थियों के लिए उपयोगी है। इस तरह के प्रश्न अक्सर Railway, SSC, Banking और Defence परीक्षाओं जैसी परीक्षाओं में पूछे जाते रहे हैं, इसलिए concept और explanation दोनों को ध्यान से समझें, सिर्फ उत्तर याद न करें। 🔗 Related Questions The output of: auto sp=make_shared(5); weak_ptr wp=sp;... The output of: auto ptr=make_unique(5); ptr[2]=42; cout Condition variable wait(lock, predicate) returns when: 📚 Related Topic Arrays (16) Linked List (25) Stack (14)
385 Question 385 EN + हिं Medium GB Without atomic, same code above would give: IN परमाणु के बिना, उपरोक्त समान कोड देगा: A Always 2000 हमेशा 2000 B Undefined behavior (race condition on non-atomic x) अपरिभाषित व्यवहार (गैर-परमाणु x पर दौड़ की स्थिति) C Always 1000 हमेशा 1000 ✅ Correct Answer: 💡 Explanation / व्याख्या Explanation (English) Data race on non-atomic variable = undefined behavior. व्याख्या (हिन्दी) गैर-परमाणु चर पर डेटा दौड़ = अपरिभाषित व्यवहार। 🎯 Exam Perspective Data Structures and Algorithms ("Introduction to DSA" sub-topic) से जुड़ा यह सवाल — difficulty level "Medium" उन students के लिए काम का है जो SSC, Railway, Banking और State PCS की तैयारी कर रहे हैं। बेहतर होगा कि explanation पढ़कर concept clear करें, ताकि exam में similar प्रश्न आने पर confusion न हो। 🔗 Related Questions The output of: auto sp=make_shared(10); auto sp2=sp; *s... Condition variable wait(lock, predicate) returns when: The output of: mutex m; int x=0; thread t([&]{lock_guar... 📚 Related Topic Arrays (16) Linked List (25) Stack (14)
386 Question 386 EN + हिं Medium GB std::mutex::lock() blocks until: IN std::mutex::lock() तब तक ब्लॉक रहता है: A Always returns हमेशा लौटता है B Mutex is acquired (other thread releases it) म्यूटेक्स का अधिग्रहण कर लिया गया है (अन्य थ्रेड इसे जारी करता है) C Timer expires टाइमर समाप्त हो रहा है D Thread terminates धागा समाप्त हो जाता है ✅ Correct Answer: 💡 Explanation / व्याख्या Explanation (English) lock() waits until mutex is available. व्याख्या (हिन्दी) लॉक() म्यूटेक्स उपलब्ध होने तक प्रतीक्षा करता है। 🎯 Exam Perspective SSC CGL, IBPS, RRB और State-level परीक्षाओं जैसी परीक्षाओं में Data Structures and Algorithms ("Introduction to DSA" sub-topic) से सवाल अक्सर पूछे जाते हैं — difficulty level "Medium"। इसलिए सिर्फ answer रटने के बजाय, नीचे दी गई explanation को ध्यान से पढ़ें और concept समझें। 🔗 Related Questions The output of: auto sp=make_shared(5); weak_ptr wp=sp;... The output of: auto ptr=make_unique(5); ptr[2]=42; cout The output of: auto sp=make_shared(42); auto sp2=sp; co... 📚 Related Topic Arrays (16) Linked List (25) Stack (14)
387 Question 387 EN + हिं Medium GB std::try_lock() differs from lock() in: IN std::try_lock() लॉक() से भिन्न है: A Same behavior वही व्यवहार B try_lock returns immediately (true if acquired, false if not) Try_lock तुरंत लौटाता है (यदि प्राप्त हुआ तो सही, नहीं तो गलत) C try_lock blocks ट्राई_लॉक ब्लॉक D try_lock throws ट्राई_लॉक फेंकता है ✅ Correct Answer: 💡 Explanation / व्याख्या Explanation (English) try_lock: non-blocking attempt to acquire mutex. व्याख्या (हिन्दी) प्रयास_लॉक: म्यूटेक्स प्राप्त करने का गैर-अवरुद्ध प्रयास। 🎯 Exam Perspective अगर आप UPSC, SSC, Banking और Police भर्ती की तैयारी कर रहे हैं, तो Data Structures and Algorithms ("Introduction to DSA" sub-topic) का यह topic आपके लिए महत्वपूर्ण है — difficulty level "Medium"। Exam में accuracy बढ़ाने के लिए हर सवाल की explanation जरूर पढ़ें। 🔗 Related Questions The output of: auto sp=make_shared(5); weak_ptr wp=sp;... What is the output: atomic x=0; thread t1([&]{for(int i... The output of: auto sp=make_shared(42); auto sp2=sp; co... 📚 Related Topic Arrays (16) Linked List (25) Stack (14)
388 Question 388 EN + हिं GB The output of: mutex m; int x=0; thread t([&]{lock_guard lg(m); x=42;}); t.join(); cout< IN का आउटपुट: म्यूटेक्स एम; int x=0; थ्रेड t([&]{lock_guard lg(m); x=42;}); टी.जुड़ें(); अदालत B 42 42 C Error गलती D Undefined अपरिभाषित ✅ Correct Answer: 💡 Explanation / व्याख्या Explanation (English) Thread safely sets x=42 under mutex; main reads 42. व्याख्या (हिन्दी) थ्रेड सुरक्षित रूप से म्यूटेक्स के अंतर्गत x=42 सेट करता है; मुख्य पाठ 42. 🎯 Exam Perspective Data Structures and Algorithms ("Introduction to DSA" sub-topic) के इस प्रश्न को कई प्रतियोगी परीक्षाओं जैसे Railway, SSC, Banking और Defence परीक्षाओं में repeat होते देखा गया है। Concept clarity के लिए explanation section जरूर पढ़ें। 🔗 Related Questions std::call_once guarantees: Condition variable wait(lock, predicate) returns when: std::mutex::lock() blocks until: 📚 Related Topic Arrays (16) Linked List (25) Stack (14)
389 Question 389 EN + हिं Medium GB Condition variable wait(lock, predicate) returns when: IN कंडीशन वेरिएबल wait(lock, predicate) तब लौटता है जब: A Always immediately हमेशा तुरंत B Predicate returns true (spurious wakeups handled) विधेय सत्य लौटाता है (नकली वेकअप संभाला गया) C Mutex unlocks म्यूटेक्स अनलॉक हो जाता है D Thread signals थ्रेड सिग्नल ✅ Correct Answer: 💡 Explanation / व्याख्या Explanation (English) wait releases lock, waits for notification, rechecks predicate. व्याख्या (हिन्दी) प्रतीक्षा लॉक जारी करती है, अधिसूचना की प्रतीक्षा करती है, विधेय की पुनः जाँच करती है। 🎯 Exam Perspective यह सवाल Data Structures and Algorithms ("Introduction to DSA" sub-topic) category का है — difficulty level "Medium", और SSC, Railway, Banking और State PCS के exam pattern में इस तरह के questions common हैं। Answer choose करने के बाद दिया गया explanation जरूर पढ़ें। 🔗 Related Questions std::try_lock() differs from lock() in: The output of: thread t1([]{cout std::mutex::lock() blocks until: 📚 Related Topic Arrays (16) Linked List (25) Stack (14)
390 Question 390 EN + हिं Medium GB std::call_once guarantees: IN std::call_once गारंटी: A Function called multiple times फ़ंक्शन को कई बार कॉल किया गया B Function called exactly once across all threads फ़ंक्शन सभी थ्रेड्स में बिल्कुल एक बार कॉल किया जाता है C Per-thread call प्रति-थ्रेड कॉल D No guarantee कोई गारंटी नहीं ✅ Correct Answer: 💡 Explanation / व्याख्या Explanation (English) Exactly one thread executes the function. व्याख्या (हिन्दी) बिल्कुल एक थ्रेड फ़ंक्शन निष्पादित करता है। 🎯 Exam Perspective यह प्रश्न Data Structures and Algorithms ("Introduction to DSA" sub-topic) की तैयारी करने वाले अभ्यर्थियों के लिए उपयोगी है — difficulty level "Medium"। इस तरह के प्रश्न अक्सर SSC CGL, IBPS, RRB और State-level परीक्षाओं जैसी परीक्षाओं में पूछे जाते रहे हैं, इसलिए concept और explanation दोनों को ध्यान से समझें, सिर्फ उत्तर याद न करें। 🔗 Related Questions C++ placement new syntax: Condition variable wait(lock, predicate) returns when: std::mutex::lock() blocks until: 📚 Related Topic Arrays (16) Linked List (25) Stack (14)