Data Structures and Algorithms — MCQ Practice

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

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

Question 316

EN + हिं Easy
GB What is the maximum comparisons in binary search for n=1024 elements?
IN n=1024 तत्वों के लिए बाइनरी खोज में अधिकतम तुलना क्या है?
10 10
11 11
512 512
1024 1024
✅ Correct Answer:
💡 Explanation / व्याख्या
Explanation (English) log2(1024)+1=10+1=11 worst case comparisons.
व्याख्या (हिन्दी) log2(1024)+1=10+1=11 सबसे खराब स्थिति तुलना।
🎯 Exam Perspective
Data Structures and Algorithms ("Introduction to DSA" sub-topic) के इस प्रश्न को — difficulty level "Easy" कई प्रतियोगी परीक्षाओं जैसे UPSC, SSC, Banking और Police भर्ती में repeat होते देखा गया है। Concept clarity के लिए explanation section जरूर पढ़ें।

Question 317

EN + हिं Medium
GB Interpolation search works best when:
IN इंटरपोलेशन खोज सबसे अच्छा तब काम करती है जब:
Any data कोई भी डेटा
Data is uniformly distributed (better than binary search) डेटा समान रूप से वितरित किया जाता है (बाइनरी खोज से बेहतर)
Sorted data only केवल क्रमबद्ध डेटा
Random data यादृच्छिक डेटा
✅ Correct Answer:
💡 Explanation / व्याख्या
Explanation (English) Interpolation: O(log log n) for uniform distribution.
व्याख्या (हिन्दी) इंटरपोलेशन: समान वितरण के लिए ओ (लॉग लॉग एन)।
🎯 Exam Perspective
यह सवाल Data Structures and Algorithms ("Introduction to DSA" sub-topic) category का है — difficulty level "Medium", और Railway, SSC, Banking और Defence परीक्षाओं के exam pattern में इस तरह के questions common हैं। Answer choose करने के बाद दिया गया explanation जरूर पढ़ें।

Question 318

EN + हिं Medium
GB Exponential search is useful when:
IN घातीय खोज तब उपयोगी होती है जब:
Any array कोई भी सरणी
Array is sorted and size is unknown (infinite/very large) सरणी क्रमबद्ध है और आकार अज्ञात है (अनंत/बहुत बड़ा)
Small arrays छोटी सारणियाँ
Linked lists लिंक की गई सूचियाँ
✅ Correct Answer:
💡 Explanation / व्याख्या
Explanation (English) Exponential finds range then binary searches it.
व्याख्या (हिन्दी) एक्सपोनेंशियल रेंज ढूंढता है फिर बाइनरी उसे खोजता है।
🎯 Exam Perspective
यह प्रश्न Data Structures and Algorithms ("Introduction to DSA" sub-topic) की तैयारी करने वाले अभ्यर्थियों के लिए उपयोगी है — difficulty level "Medium"। इस तरह के प्रश्न अक्सर SSC, Railway, Banking और State PCS जैसी परीक्षाओं में पूछे जाते रहे हैं, इसलिए concept और explanation दोनों को ध्यान से समझें, सिर्फ उत्तर याद न करें।

Question 319

EN + हिं Medium
GB Jump search works by:
IN जंप सर्च इनके द्वारा कार्य करता है:
Random jumps बेतरतीब छलांग
Jumping ahead by sqrt(n) steps then linear search back sqrt(n) चरणों से आगे बढ़ते हुए फिर रैखिक खोज
Binary then linear बाइनरी फिर रैखिक
Only forward केवल आगे
✅ Correct Answer:
💡 Explanation / व्याख्या
Explanation (English) Jump: O(sqrt(n)) time for sorted arrays.
व्याख्या (हिन्दी) कूदें: क्रमबद्ध सरणियों के लिए O(sqrt(n)) समय।
🎯 Exam Perspective
Data Structures and Algorithms ("Introduction to DSA" sub-topic) से जुड़ा यह सवाल — difficulty level "Medium" उन students के लिए काम का है जो UPSC, SSC, Banking और Police भर्ती की तैयारी कर रहे हैं। बेहतर होगा कि explanation पढ़कर concept clear करें, ताकि exam में similar प्रश्न आने पर confusion न हो।

Question 320

EN + हिं
GB The output of: int a[]={1,1,2,2,3}; cout<
IN इसका आउटपुट: int a[]={1,1,2,2,3}; अदालत
3 3
5 5
2 2
Error गलती
✅ Correct Answer:
💡 Explanation / व्याख्या
Explanation (English) unique removes consecutive duplicates: {1,2,3,?,?}; 3 unique elements.
व्याख्या (हिन्दी) अद्वितीय लगातार डुप्लिकेट हटाता है: {1,2,3,?,?}; 3 अद्वितीय तत्व.
🎯 Exam Perspective
Railway, SSC, Banking और Defence परीक्षाओं जैसी परीक्षाओं में Data Structures and Algorithms ("Introduction to DSA" sub-topic) से सवाल अक्सर पूछे जाते हैं। इसलिए सिर्फ answer रटने के बजाय, नीचे दी गई explanation को ध्यान से पढ़ें और concept समझें।

Question 321

EN + हिं Easy
GB What is Big Theta of the best sort algorithm for general data?
IN सामान्य डेटा के लिए सर्वश्रेष्ठ सॉर्ट एल्गोरिदम का बिग थीटा क्या है?
O(n) पर)
O(n log n) ओ(एन लॉग एन)
O(n^2) ओ(एन^2)
O(log n) ओ(लॉग एन)
✅ Correct Answer:
💡 Explanation / व्याख्या
Explanation (English) Lower bound for comparison sorts is Omega(n log n).
व्याख्या (हिन्दी) तुलना प्रकारों के लिए निचली सीमा ओमेगा (एन लॉग एन) है।
🎯 Exam Perspective
अगर आप SSC, Railway, Banking और State PCS की तैयारी कर रहे हैं, तो Data Structures and Algorithms ("Introduction to DSA" sub-topic) का यह topic आपके लिए महत्वपूर्ण है — difficulty level "Easy"। Exam में accuracy बढ़ाने के लिए हर सवाल की explanation जरूर पढ़ें।

Question 322

EN + हिं
GB The output of: int n; cin>>n; cout<<(n%15==0?"FizzBuzz":n%3==0?"Fizz":n%5==0?"Buzz":to_string(n)); with n=15:
IN का आउटपुट: int n; सीन>>एन; अदालत
Fizz सीटी
Buzz भनभनाना
FizzBuzz फ़िज़बज़
15 15
✅ Correct Answer:
💡 Explanation / व्याख्या
Explanation (English) 15%15==0 is true; outputs FizzBuzz.
व्याख्या (हिन्दी) 15%15==0 सत्य है; फ़िज़बज़ आउटपुट करता है।
🎯 Exam Perspective
Data Structures and Algorithms ("Introduction to DSA" sub-topic) के इस प्रश्न को कई प्रतियोगी परीक्षाओं जैसे SSC CGL, IBPS, RRB और State-level परीक्षाओं में repeat होते देखा गया है। Concept clarity के लिए explanation section जरूर पढ़ें।

Question 323

EN + हिं Medium
GB FizzBuzz for n=9 outputs:
IN n=9 आउटपुट के लिए FizzBuzz:
9 9
Fizz सीटी
Buzz भनभनाना
FizzBuzz फ़िज़बज़
✅ Correct Answer:
💡 Explanation / व्याख्या
Explanation (English) 9%3==0 but 9%5!=0; outputs Fizz.
व्याख्या (हिन्दी) 9%3==0 लेकिन 9%5!=0; फ़िज़ आउटपुट करता है।
🎯 Exam Perspective
यह सवाल Data Structures and Algorithms ("Introduction to DSA" sub-topic) category का है — difficulty level "Medium", और UPSC, SSC, Banking और Police भर्ती के exam pattern में इस तरह के questions common हैं। Answer choose करने के बाद दिया गया explanation जरूर पढ़ें।

Question 324

EN + हिं Medium
GB FizzBuzz for n=10 outputs:
IN n=10 आउटपुट के लिए FizzBuzz:
10 10
Fizz सीटी
Buzz भनभनाना
FizzBuzz फ़िज़बज़
✅ Correct Answer:
💡 Explanation / व्याख्या
Explanation (English) 10%5==0 but 10%3!=0; outputs Buzz.
व्याख्या (हिन्दी) 10%5==0 लेकिन 10%3!=0; बज़ आउटपुट करता है।
🎯 Exam Perspective
यह प्रश्न Data Structures and Algorithms ("Introduction to DSA" sub-topic) की तैयारी करने वाले अभ्यर्थियों के लिए उपयोगी है — difficulty level "Medium"। इस तरह के प्रश्न अक्सर Railway, SSC, Banking और Defence परीक्षाओं जैसी परीक्षाओं में पूछे जाते रहे हैं, इसलिए concept और explanation दोनों को ध्यान से समझें, सिर्फ उत्तर याद न करें।

Question 325

EN + हिं Medium
GB FizzBuzz for n=7 outputs:
IN n=7 आउटपुट के लिए FizzBuzz:
7 7
Fizz सीटी
Buzz भनभनाना
FizzBuzz फ़िज़बज़
✅ Correct Answer:
💡 Explanation / व्याख्या
Explanation (English) 7%3!=0 and 7%5!=0; outputs 7.
व्याख्या (हिन्दी) 7%3!=0 और 7%5!=0; आउटपुट 7.
🎯 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 न हो।

Question 326

EN + हिं
GB The output of: int n=4; int count=0; for(int i=1;i<=n;i++) for(int j=1;j<=n;j++) if(i!=j) count++; cout<
IN का आउटपुट: int n=4; पूर्णांक गिनती=0; for(int i=1;i
12 12
16 16
4 4
8 8
✅ Correct Answer:
💡 Explanation / व्याख्या
Explanation (English) 4*4=16 pairs; 4 same pairs (i==j); 16-4=12.
व्याख्या (हिन्दी) 4*4=16 जोड़े; 4 समान जोड़े (i==j); 16-4=12.
🎯 Exam Perspective
SSC CGL, IBPS, RRB और State-level परीक्षाओं जैसी परीक्षाओं में Data Structures and Algorithms ("Introduction to DSA" sub-topic) से सवाल अक्सर पूछे जाते हैं। इसलिए सिर्फ answer रटने के बजाय, नीचे दी गई explanation को ध्यान से पढ़ें और concept समझें।

Question 327

EN + हिं
GB The output of: string s="aabbcc"; map m; for(char c:s) m[c]++; for(auto [k,v]:m) if(v==1) cout<
IN इसका आउटपुट: स्ट्रिंग s='aabbcc'; मानचित्र एम; for(char c:s) m[c]++; for(auto [k,v]:m) if(v==1) cout
No output (all appear twice) कोई आउटपुट नहीं (सभी दो बार दिखाई देते हैं)
abc एबीसी
aabbcc aabbcc
Error गलती
✅ Correct Answer:
💡 Explanation / व्याख्या
Explanation (English) All chars appear twice; no unique chars.
व्याख्या (हिन्दी) सभी वर्ण दो बार दिखाई देते हैं; कोई अद्वितीय वर्ण नहीं.
🎯 Exam Perspective
अगर आप UPSC, SSC, Banking और Police भर्ती की तैयारी कर रहे हैं, तो Data Structures and Algorithms ("Introduction to DSA" sub-topic) का यह topic आपके लिए महत्वपूर्ण है। Exam में accuracy बढ़ाने के लिए हर सवाल की explanation जरूर पढ़ें।

Question 328

EN + हिं
GB The output of: int arr[]={1,2,3,4,5}; cout<<*prev(end(arr));
IN इसका आउटपुट: int arr[]={1,2,3,4,5}; अदालत
5 5
4 4
1 1
Error गलती
✅ Correct Answer:
💡 Explanation / व्याख्या
Explanation (English) prev(end(arr)) points to last element = 5.
व्याख्या (हिन्दी) पिछला(अंत(arr)) अंतिम तत्व को इंगित करता है = 5।
🎯 Exam Perspective
Data Structures and Algorithms ("Introduction to DSA" sub-topic) के इस प्रश्न को कई प्रतियोगी परीक्षाओं जैसे Railway, SSC, Banking और Defence परीक्षाओं में repeat होते देखा गया है। Concept clarity के लिए explanation section जरूर पढ़ें।

Question 329

EN + हिं
GB The output of: vector v={1,2,3}; v.insert(v.end(),{4,5,6}); cout<
IN का आउटपुट: वेक्टर v={1,2,3}; v.insert(v.end(),{4,5,6}); अदालत
3 3
6 6
9 9
Error गलती
✅ Correct Answer:
💡 Explanation / व्याख्या
Explanation (English) Insert {4,5,6} at end; total 6 elements.
व्याख्या (हिन्दी) अंत में {4,5,6} डालें; कुल 6 तत्व.
🎯 Exam Perspective
यह सवाल Data Structures and Algorithms ("Introduction to DSA" sub-topic) category का है, और SSC, Railway, Banking और State PCS के exam pattern में इस तरह के questions common हैं। Answer choose करने के बाद दिया गया explanation जरूर पढ़ें।

Question 330

EN + हिं
GB The output of: array a={1,2,3,4,5}; cout<
IN का आउटपुट: array a={1,2,3,4,5}; अदालत
1 1
5 5
4 4
Error गलती
✅ Correct Answer:
💡 Explanation / व्याख्या
Explanation (English) back() returns last element = 5.
व्याख्या (हिन्दी) वापस() अंतिम तत्व = 5 लौटाता है।
🎯 Exam Perspective
यह प्रश्न Data Structures and Algorithms ("Introduction to DSA" sub-topic) की तैयारी करने वाले अभ्यर्थियों के लिए उपयोगी है। इस तरह के प्रश्न अक्सर SSC CGL, IBPS, RRB और State-level परीक्षाओं जैसी परीक्षाओं में पूछे जाते रहे हैं, इसलिए concept और explanation दोनों को ध्यान से समझें, सिर्फ उत्तर याद न करें।