Data Structures and Algorithms — MCQ Practice

Hindi aur English dono mein practice karo — click karo answer check karne ke liye.

📚 1018 Questions 🌐 Hindi + English ✅ Free
भाषा / Language:
1018 questions

Question 856

EN + हिं
GB The output of: bitset<4> a("1010"), b("1100"); cout<<(a^b);
IN का आउटपुट: बिटसेट a("1010"), b("1100"); अदालत
0110 0110
1110 1110
0010 0010
1000 1000
✅ Correct Answer:
💡 Explanation / व्याख्या
Explanation (English) 1010^1100=0110.
व्याख्या (हिन्दी) 1010^1100=0110.
🎯 Exam Perspective
Data Structures and Algorithms के इस प्रश्न को कई प्रतियोगी परीक्षाओं जैसे UPSC, SSC, Banking और Police भर्ती में repeat होते देखा गया है। Concept clarity के लिए explanation section जरूर पढ़ें।

Question 857

EN + हिं
GB What is the output: bitset<8> bs(42); cout<
IN आउटपुट क्या है: बिटसेट बीएस(42); अदालत
00101010 00101010
10101000 10101000
00110100 00110100
Error गलती
✅ Correct Answer:
💡 Explanation / व्याख्या
Explanation (English) 42 = 00101010 in 8-bit binary.
व्याख्या (हिन्दी) 8-बिट बाइनरी में 42 = 00101010।
🎯 Exam Perspective
यह सवाल Data Structures and Algorithms category का है, और Railway, SSC, Banking और Defence परीक्षाओं के exam pattern में इस तरह के questions common हैं। Answer choose करने के बाद दिया गया explanation जरूर पढ़ें।

Question 858

EN + हिं
GB The output of: cout<(0xFF);
IN का आउटपुट: कॉउट
11111111 11111111
00000000 00000000
10101010 10101010
01010101 01010101
✅ Correct Answer:
💡 Explanation / व्याख्या
Explanation (English) 0xFF = 255 = all 8 bits set.
व्याख्या (हिन्दी) 0xFF = 255 = सभी 8 बिट्स सेट।
🎯 Exam Perspective
यह प्रश्न Data Structures and Algorithms की तैयारी करने वाले अभ्यर्थियों के लिए उपयोगी है। इस तरह के प्रश्न अक्सर SSC, Railway, Banking और State PCS जैसी परीक्षाओं में पूछे जाते रहे हैं, इसलिए concept और explanation दोनों को ध्यान से समझें, सिर्फ उत्तर याद न करें।

Question 859

EN + हिं
GB The output of: vector v(5); generate(v.begin(),v.end(),[n=0]()mutable{return n++;} ); cout<
IN का आउटपुट: वेक्टर v(5); generate(v.begin(),v.end(),[n=0]()mutable{return n++;} ); अदालत
3 3
4 4
Error गलती
✅ Correct Answer:
💡 Explanation / व्याख्या
Explanation (English) generates 0,1,2,3,4; v[3]=3.
व्याख्या (हिन्दी) 0,1,2,3,4 उत्पन्न करता है; वी[3]=3.
🎯 Exam Perspective
Data Structures and Algorithms से जुड़ा यह सवाल उन students के लिए काम का है जो SSC CGL, IBPS, RRB और State-level परीक्षाओं की तैयारी कर रहे हैं। बेहतर होगा कि explanation पढ़कर concept clear करें, ताकि exam में similar प्रश्न आने पर confusion न हो।

Question 860

EN + हिं
GB The output of: int x=0; function f=[&](int n){return n<=0?x:(x+=n,f(n-1));}; cout<
IN का आउटपुट: int x=0; फ़ंक्शन f=[&](int n){रिटर्न n
15 15
5 5
10 10
Error गलती
✅ Correct Answer:
💡 Explanation / व्याख्या
Explanation (English) Recursive lambda via std::function: 5+4+3+2+1=15.
व्याख्या (हिन्दी) std::function के माध्यम से पुनरावर्ती लैम्ब्डा: 5+4+3+2+1=15।
🎯 Exam Perspective
UPSC, SSC, Banking और Police भर्ती जैसी परीक्षाओं में Data Structures and Algorithms से सवाल अक्सर पूछे जाते हैं। इसलिए सिर्फ answer रटने के बजाय, नीचे दी गई explanation को ध्यान से पढ़ें और concept समझें।

Question 861

EN + हिं
GB What is the output: struct A{int x; A(int x):x(x){} A(A&&a):x(move(a.x)){cout<<"M";} }; A a(1); A b(move(a));
IN आउटपुट क्या है: struct A{int x; A(int x):x(x){} A(A&&a):x(move(a.x)){cout
M printed एम मुद्रित
No output उत्पादन नही
Error गलती
Undefined अपरिभाषित
✅ Correct Answer:
💡 Explanation / व्याख्या
Explanation (English) Move constructor called; prints M.
व्याख्या (हिन्दी) मूव कंस्ट्रक्टर को बुलाया गया; एम प्रिंट करता है
🎯 Exam Perspective
अगर आप Railway, SSC, Banking और Defence परीक्षाओं की तैयारी कर रहे हैं, तो Data Structures and Algorithms का यह topic आपके लिए महत्वपूर्ण है। Exam में accuracy बढ़ाने के लिए हर सवाल की explanation जरूर पढ़ें।

Question 862

EN + हिं
GB What is the output: int x=10; auto f=[=]()mutable->int&{return x;}; f()=20; cout<
IN आउटपुट क्या है: int x=10; ऑटो f=[=]()mutable->int&{return x;}; एफ()=20; अदालत
20 20
10 10
Error गलती
Undefined अपरिभाषित
✅ Correct Answer:
💡 Explanation / व्याख्या
Explanation (English) Lambda captures by value; returning reference to copy; original x unchanged.
व्याख्या (हिन्दी) लैम्ब्डा मूल्य के आधार पर कब्जा करता है; प्रतिलिपि का संदर्भ लौटाना; मूल x अपरिवर्तित.
🎯 Exam Perspective
Data Structures and Algorithms के इस प्रश्न को कई प्रतियोगी परीक्षाओं जैसे SSC, Railway, Banking और State PCS में repeat होते देखा गया है। Concept clarity के लिए explanation section जरूर पढ़ें।

Question 863

EN + हिं
GB The output of: int x=10; auto f=[&x]()->int&{return x;}; f()=20; cout<
IN का आउटपुट: int x=10; ऑटो f=[&x]()->int&{return x;}; एफ()=20; अदालत
10 10
20 20
Error गलती
Undefined अपरिभाषित
✅ Correct Answer:
💡 Explanation / व्याख्या
Explanation (English) Lambda captures x by reference; f()=20 modifies original x.
व्याख्या (हिन्दी) लैम्ब्डा संदर्भ द्वारा x को कैप्चर करता है; f()=20 मूल x को संशोधित करता है।
🎯 Exam Perspective
यह सवाल Data Structures and Algorithms category का है, और SSC CGL, IBPS, RRB और State-level परीक्षाओं के exam pattern में इस तरह के questions common हैं। Answer choose करने के बाद दिया गया explanation जरूर पढ़ें।

Question 864

EN + हिं
GB The output of: class C{public:int operator()(int x){return x*x;} }; C sq; cout<
IN इसका आउटपुट: वर्ग C{सार्वजनिक:int ऑपरेटर()(int x){रिटर्न x*x;} }; सी वर्ग; अदालत
2516 2516
254 254
25 16 25 16
Error गलती
✅ Correct Answer:
💡 Explanation / व्याख्या
Explanation (English) sq(5)=25; sq(2)=4; sq(4)=16; 25 then 16: 2516.
व्याख्या (हिन्दी) वर्ग(5)=25; वर्ग(2)=4; वर्ग(4)=16; 25 फिर 16:2516.
🎯 Exam Perspective
यह प्रश्न Data Structures and Algorithms की तैयारी करने वाले अभ्यर्थियों के लिए उपयोगी है। इस तरह के प्रश्न अक्सर UPSC, SSC, Banking और Police भर्ती जैसी परीक्षाओं में पूछे जाते रहे हैं, इसलिए concept और explanation दोनों को ध्यान से समझें, सिर्फ उत्तर याद न करें।

Question 865

EN + हिं
GB What is the output: auto curry=[](int a){return [a](int b){return a+b;};};cout<
IN आउटपुट क्या है: auto curry=[](int a){return [a](int b){return a+b;};};cout
12 12
7 7
3 3
4 4
✅ Correct Answer:
💡 Explanation / व्याख्या
Explanation (English) curry(3) returns lambda that adds 3; called with 4: 3+4=7.
व्याख्या (हिन्दी) करी(3) लैम्ब्डा लौटाता है जो 3 जोड़ता है; 4:3+4=7 के साथ बुलाया गया।
🎯 Exam Perspective
Data Structures and Algorithms से जुड़ा यह सवाल उन students के लिए काम का है जो Railway, SSC, Banking और Defence परीक्षाओं की तैयारी कर रहे हैं। बेहतर होगा कि explanation पढ़कर concept clear करें, ताकि exam में similar प्रश्न आने पर confusion न हो।

Question 866

EN + हिं Easy
GB What is currying in functional programming?
IN कार्यात्मक प्रोग्रामिंग में करींग क्या है?
Merging functions कार्यों का विलय
Transforming multi-argument function into sequence of single-argument functions बहु-तर्क फ़ंक्शन को एकल-तर्क कार्यों के अनुक्रम में बदलना
Recursion pattern प्रत्यावर्तन पैटर्न
Template pattern टेम्पलेट पैटर्न
✅ Correct Answer:
💡 Explanation / व्याख्या
Explanation (English) Currying: f(a,b) becomes f(a)(b).
व्याख्या (हिन्दी) करी: f(a,b) f(a)(b) बन जाता है।
🎯 Exam Perspective
SSC, Railway, Banking और State PCS जैसी परीक्षाओं में Data Structures and Algorithms से सवाल अक्सर पूछे जाते हैं — difficulty level "Easy"। इसलिए सिर्फ answer रटने के बजाय, नीचे दी गई explanation को ध्यान से पढ़ें और concept समझें।

Question 867

EN + हिं
GB The output of: vector v={1,2,3,4,5}; auto it=partition(v.begin(),v.end(),[](int x){return x%2==0;}); cout<
IN का आउटपुट: वेक्टर v={1,2,3,4,5}; ऑटो आईटी=विभाजन(v.begin(),v.end(),[](int x){रिटर्न x%2==0;}); अदालत
2 2
3 3
4 4
5 5
✅ Correct Answer:
💡 Explanation / व्याख्या
Explanation (English) Even elements {2,4} moved to front; partition point at index 2.
व्याख्या (हिन्दी) यहां तक ​​कि तत्व {2,4} भी सामने चले गए; सूचकांक 2 पर विभाजन बिंदु।
🎯 Exam Perspective
अगर आप SSC CGL, IBPS, RRB और State-level परीक्षाओं की तैयारी कर रहे हैं, तो Data Structures and Algorithms का यह topic आपके लिए महत्वपूर्ण है। Exam में accuracy बढ़ाने के लिए हर सवाल की explanation जरूर पढ़ें।

Question 868

EN + हिं
GB The output of: vector v={1,2,3,4,5}; rotate(v.begin(),v.begin()+3,v.end()); for(auto x:v)cout<
IN का आउटपुट: वेक्टर v={1,2,3,4,5}; रोटेट(v.begin(),v.begin()+3,v.end()); for(ऑटो x:v)cout
45123 45123
12345 12345
34512 34512
54321 54321
✅ Correct Answer:
💡 Explanation / व्याख्या
Explanation (English) Rotate left by 3: {4,5,1,2,3}.
व्याख्या (हिन्दी) 3 से बाएँ घुमाएँ: {4,5,1,2,3}।
🎯 Exam Perspective
Data Structures and Algorithms के इस प्रश्न को कई प्रतियोगी परीक्षाओं जैसे UPSC, SSC, Banking और Police भर्ती में repeat होते देखा गया है। Concept clarity के लिए explanation section जरूर पढ़ें।

Question 869

EN + हिं
GB The output of: int arr[]={3,1,4,1,5}; cout<<*max_element(arr,arr+5)<<" "<<*min_element(arr,arr+5);
IN इसका आउटपुट: int arr[]={3,1,4,1,5}; अदालत
5 1 5 1
3 1 3 1
4 1 4 1
Error गलती
✅ Correct Answer:
💡 Explanation / व्याख्या
Explanation (English) Max=5, Min=1.
व्याख्या (हिन्दी) अधिकतम=5, न्यूनतम=1.
🎯 Exam Perspective
यह सवाल Data Structures and Algorithms category का है, और Railway, SSC, Banking और Defence परीक्षाओं के exam pattern में इस तरह के questions common हैं। Answer choose करने के बाद दिया गया explanation जरूर पढ़ें।

Question 870

EN + हिं
GB The output of: int a=5,b=3; cout<
IN का आउटपुट: int a=5,b=3; अदालत
15 15
8 8
2 2
5 5
✅ Correct Answer:
💡 Explanation / व्याख्या
Explanation (English) Values: 5,3,8,15,2; max=15.
व्याख्या (हिन्दी) मान: 5,3,8,15,2; अधिकतम=15.
🎯 Exam Perspective
यह प्रश्न Data Structures and Algorithms की तैयारी करने वाले अभ्यर्थियों के लिए उपयोगी है। इस तरह के प्रश्न अक्सर SSC, Railway, Banking और State PCS जैसी परीक्षाओं में पूछे जाते रहे हैं, इसलिए concept और explanation दोनों को ध्यान से समझें, सिर्फ उत्तर याद न करें।