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 601

EN + हिं
GB The output of: int x=0b10110; cout<<__builtin_popcount(x);
IN इसका आउटपुट: int x=0b10110; अदालत
3 3
4 4
5 5
Error गलती
✅ Correct Answer:
💡 Explanation / व्याख्या
Explanation (English) 10110 has 3 set bits.
व्याख्या (हिन्दी) 10110 में 3 सेट बिट हैं।
🎯 Exam Perspective
Data Structures and Algorithms ("Introduction to DSA" sub-topic) से जुड़ा यह सवाल उन students के लिए काम का है जो UPSC, SSC, Banking और Police भर्ती की तैयारी कर रहे हैं। बेहतर होगा कि explanation पढ़कर concept clear करें, ताकि exam में similar प्रश्न आने पर confusion न हो।

Question 602

EN + हिं Hard
GB What is the time complexity to find if a number is prime (trial division)?
IN यह पता लगाने में समय की जटिलता क्या है कि कोई संख्या अभाज्य है (परीक्षण प्रभाग)?
O(1) हे(1)
O(sqrt(n)) ओ(वर्ग(एन))
O(n) पर)
O(log n) ओ(लॉग एन)
✅ Correct Answer:
💡 Explanation / व्याख्या
Explanation (English) Check divisors up to sqrt(n).
व्याख्या (हिन्दी) sqrt(n) तक के विभाजक की जाँच करें।
🎯 Exam Perspective
Railway, SSC, Banking और Defence परीक्षाओं जैसी परीक्षाओं में Data Structures and Algorithms ("Introduction to DSA" sub-topic) से सवाल अक्सर पूछे जाते हैं — difficulty level "Hard"। इसलिए सिर्फ answer रटने के बजाय, नीचे दी गई explanation को ध्यान से पढ़ें और concept समझें।

Question 603

EN + हिं Medium
GB Sieve of Eratosthenes finds all primes up to n in:
IN एराटोस्थनीज़ की छलनी में n तक के सभी अभाज्य गुण पाए जाते हैं:
O(n) पर)
O(n log log n) ओ(एन लॉग लॉग एन)
O(n^2) ओ(एन^2)
O(sqrt(n)) ओ(वर्ग(एन))
✅ Correct Answer:
💡 Explanation / व्याख्या
Explanation (English) Sieve: O(n log log n) time, O(n) space.
व्याख्या (हिन्दी) चलनी: O(n लॉग लॉग n) समय, O(n) स्थान।
🎯 Exam Perspective
अगर आप SSC, Railway, Banking और State PCS की तैयारी कर रहे हैं, तो Data Structures and Algorithms ("Introduction to DSA" sub-topic) का यह topic आपके लिए महत्वपूर्ण है — difficulty level "Medium"। Exam में accuracy बढ़ाने के लिए हर सवाल की explanation जरूर पढ़ें।

Question 604

EN + हिं
GB The output of: int n=36; cout<<(int)sqrt(n)*(int)sqrt(n)==n?"Perfect Square":"Not";
IN का आउटपुट: int n=36; अदालत
Perfect Square उत्तम वर्ग
Not नहीं
Error गलती
36 36
✅ Correct Answer:
💡 Explanation / व्याख्या
Explanation (English) sqrt(36)=6; 6*6=36; perfect square.
व्याख्या (हिन्दी) sqrt(36)=6; 6*6=36; पूर्ण वर्ग.
🎯 Exam Perspective
Data Structures and Algorithms ("Introduction to DSA" sub-topic) के इस प्रश्न को कई प्रतियोगी परीक्षाओं जैसे SSC CGL, IBPS, RRB और State-level परीक्षाओं में repeat होते देखा गया है। Concept clarity के लिए explanation section जरूर पढ़ें।

Question 605

EN + हिं Medium
GB The number of digits in integer n is:
IN पूर्णांक n में अंकों की संख्या है:
n एन
floor(log10(n))+1 मंजिल(लॉग10(एन))+1
log2(n) लॉग2(एन)
n/10 एन/10
✅ Correct Answer:
💡 Explanation / व्याख्या
Explanation (English) digits = floor(log10(n))+1 for n>0.
व्याख्या (हिन्दी) अंक = मंजिल(लॉग10(एन))+1 n>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 606

EN + हिं
GB The output of: cout<<(int)(log10(12345))+1;
IN का आउटपुट: कॉउट
5 5
4 4
6 6
Error गलती
✅ Correct Answer:
💡 Explanation / व्याख्या
Explanation (English) log10(12345)≈4.09; (int)=4; 4+1=5 digits.
व्याख्या (हिन्दी) लॉग10(12345)≈4.09; (int)=4; 4+1=5 अंक.
🎯 Exam Perspective
यह प्रश्न Data Structures and Algorithms ("Introduction to DSA" sub-topic) की तैयारी करने वाले अभ्यर्थियों के लिए उपयोगी है। इस तरह के प्रश्न अक्सर Railway, SSC, Banking और Defence परीक्षाओं जैसी परीक्षाओं में पूछे जाते रहे हैं, इसलिए concept और explanation दोनों को ध्यान से समझें, सिर्फ उत्तर याद न करें।

Question 607

EN + हिं Easy
GB What is Eulers totient function phi(6)?
IN यूलर्स टोटिएंट फंक्शन फाई(6) क्या है?
2 2
3 3
4 4
6 6
✅ Correct Answer:
💡 Explanation / व्याख्या
Explanation (English) Numbers coprime to 6 and ≤6: {1,5}; phi(6)=2.
व्याख्या (हिन्दी) 6 और ≤6 से सहअभाज्य संख्याएँ: {1,5}; फ़ि(6)=2.
🎯 Exam Perspective
Data Structures and Algorithms ("Introduction to DSA" sub-topic) से जुड़ा यह सवाल — difficulty level "Easy" उन students के लिए काम का है जो SSC, Railway, Banking और State PCS की तैयारी कर रहे हैं। बेहतर होगा कि explanation पढ़कर concept clear करें, ताकि exam में similar प्रश्न आने पर confusion न हो।

Question 608

EN + हिं
GB The output of: int a=2,b=5,m=7; int result=1; while(b>0){if(b&1)result=result*a%m; a=a*a%m; b>>=1;} cout<
IN का आउटपुट: int a=2,b=5,m=7; पूर्णांक परिणाम=1; जबकि(b>0){if(b&1)result=result*a%m; a=a*a%m; b>>=1;} कोउट
4 4
2 2
3 3
Error गलती
✅ Correct Answer:
💡 Explanation / व्याख्या
Explanation (English) Fast modular exponentiation: 2^5 mod 7 = 32 mod 7 = 4.
व्याख्या (हिन्दी) तेज़ मॉड्यूलर घातांक: 2^5 मॉड 7 = 32 मॉड 7 = 4।
🎯 Exam Perspective
SSC CGL, IBPS, RRB और State-level परीक्षाओं जैसी परीक्षाओं में Data Structures and Algorithms ("Introduction to DSA" sub-topic) से सवाल अक्सर पूछे जाते हैं। इसलिए सिर्फ answer रटने के बजाय, नीचे दी गई explanation को ध्यान से पढ़ें और concept समझें।

Question 609

EN + हिं Medium
GB Modular arithmetic: (a+b) mod m equals:
IN मॉड्यूलर अंकगणित: (ए+बी) मॉड एम बराबर है:
(a mod m + b mod m) (ए मॉड एम + बी मॉड एम)
(a mod m + b mod m) mod m (ए मॉड एम + बी मॉड एम) मॉड एम
(a+b) only (ए+बी) केवल
Not defined परिभाषित नहीं
✅ Correct Answer:
💡 Explanation / व्याख्या
Explanation (English) Mod distributes: (a+b)%m = ((a%m)+(b%m))%m.
व्याख्या (हिन्दी) मॉड वितरित करता है: (a+b)%m = ((a%m)+(b%m))%m।
🎯 Exam Perspective
अगर आप UPSC, SSC, Banking और Police भर्ती की तैयारी कर रहे हैं, तो Data Structures and Algorithms ("Introduction to DSA" sub-topic) का यह topic आपके लिए महत्वपूर्ण है — difficulty level "Medium"। Exam में accuracy बढ़ाने के लिए हर सवाल की explanation जरूर पढ़ें।

Question 610

EN + हिं
GB The output of: int a=INT_MIN; cout<<(a<0?"negative":"positive");
IN का आउटपुट: int a=INT_MIN; अदालत
positive सकारात्मक
negative नकारात्मक
zero शून्य
Error गलती
✅ Correct Answer:
💡 Explanation / व्याख्या
Explanation (English) INT_MIN is the most negative int; it is negative.
व्याख्या (हिन्दी) INT_MIN सबसे नकारात्मक int है; यह नकारात्मक है.
🎯 Exam Perspective
Data Structures and Algorithms ("Introduction to DSA" sub-topic) के इस प्रश्न को कई प्रतियोगी परीक्षाओं जैसे Railway, SSC, Banking और Defence परीक्षाओं में repeat होते देखा गया है। Concept clarity के लिए explanation section जरूर पढ़ें।

Question 611

EN + हिं
GB What is the output: cout<::max();
IN आउटपुट क्या है: cout
2147483647 2147483647
INT_MAX INT_MAX
2^31-1 2^31-1
All correct सभी सही
✅ Correct Answer:
💡 Explanation / व्याख्या
Explanation (English) All represent the same maximum int value.
व्याख्या (हिन्दी) सभी समान अधिकतम पूर्णांक मान का प्रतिनिधित्व करते हैं।
🎯 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 612

EN + हिं
GB The output of: double x=1.0/3.0; cout<
IN का आउटपुट: डबल x=1.0/3.0; अदालत
0.333333333333333 0.333333333333333
0.333 0.333
1.0 1.0
Error गलती
✅ Correct Answer:
💡 Explanation / व्याख्या
Explanation (English) High precision shows repeating decimal pattern.
व्याख्या (हिन्दी) उच्च परिशुद्धता दोहराए जाने वाले दशमलव पैटर्न को दर्शाती है।
🎯 Exam Perspective
यह प्रश्न Data Structures and Algorithms ("Introduction to DSA" sub-topic) की तैयारी करने वाले अभ्यर्थियों के लिए उपयोगी है। इस तरह के प्रश्न अक्सर SSC CGL, IBPS, RRB और State-level परीक्षाओं जैसी परीक्षाओं में पूछे जाते रहे हैं, इसलिए concept और explanation दोनों को ध्यान से समझें, सिर्फ उत्तर याद न करें।

Question 613

EN + हिं Easy
GB What is epsilon comparison for floating point?
IN फ़्लोटिंग पॉइंट के लिए ईपीएसलॉन तुलना क्या है?
a==b ए==बी
abs(a-b)<epsilon (for small epsilon) पेट(ए-बी)
a-b==0 ए-बी==0
(float)a==(float)b (फ्लोट)ए==(फ्लोट)बी
✅ Correct Answer:
💡 Explanation / व्याख्या
Explanation (English) Floating point equality: compare difference to small epsilon.
व्याख्या (हिन्दी) फ़्लोटिंग पॉइंट समानता: अंतर की तुलना छोटे ईपीएसलॉन से करें।
🎯 Exam Perspective
Data Structures and Algorithms ("Introduction to DSA" sub-topic) से जुड़ा यह सवाल — difficulty level "Easy" उन students के लिए काम का है जो UPSC, SSC, Banking और Police भर्ती की तैयारी कर रहे हैं। बेहतर होगा कि explanation पढ़कर concept clear करें, ताकि exam में similar प्रश्न आने पर confusion न हो।

Question 614

EN + हिं
GB The output of: cout<<(0.1+0.2==0.3);
IN का आउटपुट: कॉउट
1 1
Error गलती
True सत्य
✅ Correct Answer:
💡 Explanation / व्याख्या
Explanation (English) Floating point precision: 0.1+0.2 ≠ 0.3 exactly.
व्याख्या (हिन्दी) फ़्लोटिंग पॉइंट परिशुद्धता: 0.1+0.2 ≠ 0.3 बिल्कुल।
🎯 Exam Perspective
Railway, SSC, Banking और Defence परीक्षाओं जैसी परीक्षाओं में Data Structures and Algorithms ("Introduction to DSA" sub-topic) से सवाल अक्सर पूछे जाते हैं। इसलिए सिर्फ answer रटने के बजाय, नीचे दी गई explanation को ध्यान से पढ़ें और concept समझें।

Question 615

EN + हिं
GB Which is the output: double a=0.1+0.2; cout<
IN आउटपुट कौन सा है: डबल a=0.1+0.2; अदालत
0.30000000000000000000 0.30000000000000000
0.30000000000000004440 0.300000000000000004440
0.30000000000000001110 0.3000000000000001110
0.30000000000000000001 0.30000000000001
✅ Correct Answer:
💡 Explanation / व्याख्या
Explanation (English) IEEE 754 double precision shows small error.
व्याख्या (हिन्दी) आईईईई 754 दोहरी परिशुद्धता छोटी त्रुटि दिखाती है।
🎯 Exam Perspective
अगर आप SSC, Railway, Banking और State PCS की तैयारी कर रहे हैं, तो Data Structures and Algorithms ("Introduction to DSA" sub-topic) का यह topic आपके लिए महत्वपूर्ण है। Exam में accuracy बढ़ाने के लिए हर सवाल की explanation जरूर पढ़ें।