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 181

EN + हिं Medium
GB Matrix Chain Multiplication uses which technique?
IN मैट्रिक्स श्रृंखला गुणन किस तकनीक का उपयोग करता है?
Greedy लालची
Dynamic Programming गतिशील प्रोग्रामिंग
Divide and Conquer फूट डालो और राज करो
Backtracking बैक ट्रैकिंग
✅ Correct Answer:
💡 Explanation / व्याख्या
Explanation (English) MCM: DP to find optimal parenthesization.
व्याख्या (हिन्दी) एमसीएम: इष्टतम कोष्ठक खोजने के लिए डीपी।
🎯 Exam Perspective
Data Structures and Algorithms ("Introduction to DSA" sub-topic) से जुड़ा यह सवाल — difficulty level "Medium" उन students के लिए काम का है जो SSC CGL, IBPS, RRB और State-level परीक्षाओं की तैयारी कर रहे हैं। बेहतर होगा कि explanation पढ़कर concept clear करें, ताकि exam में similar प्रश्न आने पर confusion न हो।

Question 182

EN + हिं Medium
GB Edit distance (Levenshtein distance) between "kitten" and "sitting" is:
IN "बिल्ली का बच्चा" और "बैठने" के बीच की दूरी (लेवेनशेटिन दूरी) संपादित करें:
3 3
4 4
5 5
6 6
✅ Correct Answer:
💡 Explanation / व्याख्या
Explanation (English) Edit distance is 3 (substitute k→s, substitute e→i, insert g).
व्याख्या (हिन्दी) संपादित दूरी 3 है (k→s प्रतिस्थापित करें, e→i प्रतिस्थापित करें, g डालें)।
🎯 Exam Perspective
UPSC, SSC, Banking और Police भर्ती जैसी परीक्षाओं में Data Structures and Algorithms ("Introduction to DSA" sub-topic) से सवाल अक्सर पूछे जाते हैं — difficulty level "Medium"। इसलिए सिर्फ answer रटने के बजाय, नीचे दी गई explanation को ध्यान से पढ़ें और concept समझें।

Question 183

EN + हिं Medium
GB Coin change problem (minimum coins) uses:
IN सिक्का परिवर्तन समस्या (न्यूनतम सिक्के) का उपयोग:
Greedy always हमेशा लालची
Dynamic Programming for general case सामान्य मामले के लिए गतिशील प्रोग्रामिंग
Only recursion केवल प्रत्यावर्तन
Brute force पाशविक बल
✅ Correct Answer:
💡 Explanation / व्याख्या
Explanation (English) DP coin change: optimal substructure, overlapping subproblems.
व्याख्या (हिन्दी) डीपी सिक्का परिवर्तन: इष्टतम उपसंरचना, अतिव्यापी उपसमस्याएं।
🎯 Exam Perspective
अगर आप Railway, SSC, Banking और Defence परीक्षाओं की तैयारी कर रहे हैं, तो Data Structures and Algorithms ("Introduction to DSA" sub-topic) का यह topic आपके लिए महत्वपूर्ण है — difficulty level "Medium"। Exam में accuracy बढ़ाने के लिए हर सवाल की explanation जरूर पढ़ें।

Question 184

EN + हिं Medium
GB KMP (Knuth-Morris-Pratt) algorithm efficiently solves:
IN KMP (नुथ-मॉरिस-प्रैट) एल्गोरिदम कुशलतापूर्वक हल करता है:
Sorting छंटाई
String pattern matching in O(n+m) O(n+m) में स्ट्रिंग पैटर्न का मिलान
Graph problems ग्राफ़ समस्याएँ
Dynamic programming गतिशील प्रोग्रामिंग
✅ Correct Answer:
💡 Explanation / व्याख्या
Explanation (English) KMP: O(n+m) string search vs O(nm) naive.
व्याख्या (हिन्दी) KMP: O(n+m) स्ट्रिंग खोज बनाम O(nm) अनुभवहीन।
🎯 Exam Perspective
Data Structures and Algorithms ("Introduction to DSA" sub-topic) के इस प्रश्न को — difficulty level "Medium" कई प्रतियोगी परीक्षाओं जैसे SSC, Railway, Banking और State PCS में repeat होते देखा गया है। Concept clarity के लिए explanation section जरूर पढ़ें।

Question 185

EN + हिं Medium
GB The failure function in KMP is used to:
IN KMP में विफलता फ़ंक्शन का उपयोग इसके लिए किया जाता है:
Handle failures विफलताओं को संभालें
Skip unnecessary comparisons by tracking longest proper prefix-suffix सबसे लंबे उचित उपसर्ग-प्रत्यय को ट्रैक करके अनावश्यक तुलना छोड़ें
Match patterns मिलान पैटर्न
Build suffix array प्रत्यय सरणी बनाएँ
✅ Correct Answer:
💡 Explanation / व्याख्या
Explanation (English) Failure function: longest proper prefix that is also suffix.
व्याख्या (हिन्दी) विफलता फ़ंक्शन: सबसे लंबा उचित उपसर्ग जो प्रत्यय भी है।
🎯 Exam Perspective
यह सवाल Data Structures and Algorithms ("Introduction to DSA" sub-topic) category का है — difficulty level "Medium", और SSC CGL, IBPS, RRB और State-level परीक्षाओं के exam pattern में इस तरह के questions common हैं। Answer choose करने के बाद दिया गया explanation जरूर पढ़ें।

Question 186

EN + हिं Medium
GB Rabin-Karp algorithm uses:
IN राबिन-कार्प एल्गोरिथ्म का उपयोग करता है:
Sorting छंटाई
Rolling hash for efficient multi-pattern search कुशल बहु-पैटर्न खोज के लिए रोलिंग हैश
Binary search द्विआधारी खोज
DP डी पी
✅ Correct Answer:
💡 Explanation / व्याख्या
Explanation (English) Rabin-Karp: hash-based string matching.
व्याख्या (हिन्दी) राबिन-कार्प: हैश-आधारित स्ट्रिंग मिलान।
🎯 Exam Perspective
यह प्रश्न Data Structures and Algorithms ("Introduction to DSA" sub-topic) की तैयारी करने वाले अभ्यर्थियों के लिए उपयोगी है — difficulty level "Medium"। इस तरह के प्रश्न अक्सर UPSC, SSC, Banking और Police भर्ती जैसी परीक्षाओं में पूछे जाते रहे हैं, इसलिए concept और explanation दोनों को ध्यान से समझें, सिर्फ उत्तर याद न करें।

Question 187

EN + हिं Medium
GB Boyer-Moore algorithm searches string from:
IN बॉयर-मूर एल्गोरिदम यहां से स्ट्रिंग खोजता है:
Left to right बाएं से दायां
Right to left (more efficient skips) दाएं से बाएं (अधिक कुशल स्किप)
Middle out मध्य बाहर
Random position यादृच्छिक स्थिति
✅ Correct Answer:
💡 Explanation / व्याख्या
Explanation (English) Boyer-Moore scans pattern from right to left.
व्याख्या (हिन्दी) बॉयर-मूर दाएँ से बाएँ पैटर्न को स्कैन करता है।
🎯 Exam Perspective
Data Structures and Algorithms ("Introduction to DSA" sub-topic) से जुड़ा यह सवाल — difficulty level "Medium" उन students के लिए काम का है जो Railway, SSC, Banking और Defence परीक्षाओं की तैयारी कर रहे हैं। बेहतर होगा कि explanation पढ़कर concept clear करें, ताकि exam में similar प्रश्न आने पर confusion न हो।

Question 188

EN + हिं Medium
GB Aho-Corasick algorithm enables:
IN अहो-कोरासिक एल्गोरिदम सक्षम करता है:
Single pattern search एकल पैटर्न खोज
Multiple pattern search simultaneously in O(n+m+z) O(n+m+z) में एक साथ एकाधिक पैटर्न खोज
Graph search ग्राफ़ खोज
Number theory संख्या सिद्धांत
✅ Correct Answer:
💡 Explanation / व्याख्या
Explanation (English) Aho-Corasick: simultaneous multi-pattern matching.
व्याख्या (हिन्दी) अहो-कोरासिक: एक साथ बहु-पैटर्न मिलान।
🎯 Exam Perspective
SSC CGL, IBPS, RRB और State-level परीक्षाओं जैसी परीक्षाओं में Data Structures and Algorithms ("Introduction to DSA" sub-topic) से सवाल अक्सर पूछे जाते हैं — difficulty level "Medium"। इसलिए सिर्फ answer रटने के बजाय, नीचे दी गई explanation को ध्यान से पढ़ें और concept समझें।

Question 189

EN + हिं Medium
GB Z-algorithm computes for each position:
IN Z-एल्गोरिदम प्रत्येक स्थिति के लिए गणना करता है:
Hash value हैश मान
Length of longest substring starting from position that is also a prefix स्थिति से शुरू होने वाली सबसे लंबी उपस्ट्रिंग की लंबाई भी एक उपसर्ग है
Suffix rank प्रत्यय रैंक
Pattern match पैटर्न मिलान
✅ Correct Answer:
💡 Explanation / व्याख्या
Explanation (English) Z-array: Z[i] = length of longest match with prefix.
व्याख्या (हिन्दी) Z-सरणी: Z[i] = उपसर्ग के साथ सबसे लंबे मिलान की लंबाई।
🎯 Exam Perspective
अगर आप UPSC, SSC, Banking और Police भर्ती की तैयारी कर रहे हैं, तो Data Structures and Algorithms ("Introduction to DSA" sub-topic) का यह topic आपके लिए महत्वपूर्ण है — difficulty level "Medium"। Exam में accuracy बढ़ाने के लिए हर सवाल की explanation जरूर पढ़ें।

Question 190

EN + हिं Medium
GB Manacher algorithm finds:
IN मनचेर एल्गोरिदम पाता है:
Patterns पैटर्न्स
Longest palindromic substring in O(n) O(n) में सबसे लंबा पैलिंड्रोमिक सबस्ट्रिंग
Anagrams अनाग्रामज़
Permutations क्रमपरिवर्तन
✅ Correct Answer:
💡 Explanation / व्याख्या
Explanation (English) Manacher: O(n) palindrome finding using symmetry.
व्याख्या (हिन्दी) मनचेर: समरूपता का उपयोग करके ओ(एन) पैलिंड्रोम खोजना।
🎯 Exam Perspective
Data Structures and Algorithms ("Introduction to DSA" sub-topic) के इस प्रश्न को — difficulty level "Medium" कई प्रतियोगी परीक्षाओं जैसे Railway, SSC, Banking और Defence परीक्षाओं में repeat होते देखा गया है। Concept clarity के लिए explanation section जरूर पढ़ें।

Question 191

EN + हिं Medium
GB Two-pointer technique is used for:
IN टू-पॉइंटर तकनीक का उपयोग इसके लिए किया जाता है:
Sorting छंटाई
Efficiently solving array/string problems with two indices moving toward each other दो सूचकांकों के एक-दूसरे की ओर बढ़ने के साथ सरणी/स्ट्रिंग समस्याओं को कुशलतापूर्वक हल करना
Graph traversal ग्राफ ट्रैवर्सल
DP problems डीपी समस्याएं
✅ Correct Answer:
💡 Explanation / व्याख्या
Explanation (English) Two-pointer: O(n) for problems like pair sum, palindrome check.
व्याख्या (हिन्दी) दो-सूचक: जोड़ी योग, पैलिंड्रोम जांच जैसी समस्याओं के लिए ओ(एन)।
🎯 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 जरूर पढ़ें।

Question 192

EN + हिं Medium
GB Sliding window technique is used for:
IN स्लाइडिंग विंडो तकनीक का उपयोग निम्न के लिए किया जाता है:
Graph problems ग्राफ़ समस्याएँ
Finding optimal subarray/substring of fixed or variable size निश्चित या परिवर्तनीय आकार की इष्टतम उपसरणी/सबस्ट्रिंग ढूँढना
Sorting छंटाई
DP tables डीपी टेबल
✅ Correct Answer:
💡 Explanation / व्याख्या
Explanation (English) Sliding window: O(n) for subarray problems.
व्याख्या (हिन्दी) स्लाइडिंग विंडो: उपसरणी समस्याओं के लिए O(n)।
🎯 Exam Perspective
यह प्रश्न Data Structures and Algorithms ("Introduction to DSA" sub-topic) की तैयारी करने वाले अभ्यर्थियों के लिए उपयोगी है — difficulty level "Medium"। इस तरह के प्रश्न अक्सर SSC CGL, IBPS, RRB और State-level परीक्षाओं जैसी परीक्षाओं में पूछे जाते रहे हैं, इसलिए concept और explanation दोनों को ध्यान से समझें, सिर्फ उत्तर याद न करें।

Question 193

EN + हिं Medium
GB Kadane algorithm maintains:
IN कडेन एल्गोरिदम बनाए रखता है:
Global minimum वैश्विक न्यूनतम
Current subarray sum and global maximum वर्तमान उपसरणी योग और वैश्विक अधिकतम
All subarray sums सभी उपसरणी योग
Average sum औसत योग
✅ Correct Answer:
💡 Explanation / व्याख्या
Explanation (English) Kadane: maxEndingHere = max(arr[i], maxEndingHere + arr[i]).
व्याख्या (हिन्दी) कदाने: maxEndingHere = max(arr[i], maxEndingHere + arr[i]).
🎯 Exam Perspective
Data Structures and Algorithms ("Introduction to DSA" sub-topic) से जुड़ा यह सवाल — difficulty level "Medium" उन students के लिए काम का है जो Railway, SSC, Banking और Defence परीक्षाओं की तैयारी कर रहे हैं। बेहतर होगा कि explanation पढ़कर concept clear करें, ताकि exam में similar प्रश्न आने पर confusion न हो।

Question 194

EN + हिं Medium
GB The stock buy-sell problem (one transaction) is solved in:
IN स्टॉक खरीदने-बेचने की समस्या (एक लेनदेन) को हल किया जाता है:
O(n^2) ओ(एन^2)
O(n) by tracking minimum price seen so far O(n) अब तक देखी गई न्यूनतम कीमत पर नज़र रखकर
O(n log n) ओ(एन लॉग एन)
O(1) हे(1)
✅ Correct Answer:
💡 Explanation / व्याख्या
Explanation (English) One pass: track min, compute max profit at each step.
व्याख्या (हिन्दी) एक पास: न्यूनतम ट्रैक करें, प्रत्येक चरण पर अधिकतम लाभ की गणना करें।
🎯 Exam Perspective
SSC, Railway, Banking और State PCS जैसी परीक्षाओं में Data Structures and Algorithms ("Introduction to DSA" sub-topic) से सवाल अक्सर पूछे जाते हैं — difficulty level "Medium"। इसलिए सिर्फ answer रटने के बजाय, नीचे दी गई explanation को ध्यान से पढ़ें और concept समझें।

Question 195

EN + हिं Medium
GB Finding majority element (appearing > n/2 times) is solved by:
IN बहुसंख्यक तत्व ढूँढना (प्रकट होना > n/2 बार) निम्न द्वारा हल किया जाता है:
Sorting छंटाई
Boyer-Moore Voting Algorithm in O(n) ओ(एन) में बॉयर-मूर वोटिंग एल्गोरिदम
Hash map हैश मानचित्र
Binary search द्विआधारी खोज
✅ Correct Answer:
💡 Explanation / व्याख्या
Explanation (English) Boyer-Moore Voting: O(n) time, O(1) space.
व्याख्या (हिन्दी) बॉयर-मूर वोटिंग: O(n) समय, O(1) स्थान।
🎯 Exam Perspective
अगर आप UPSC, SSC, Banking और Police भर्ती की तैयारी कर रहे हैं, तो Data Structures and Algorithms ("Introduction to DSA" sub-topic) का यह topic आपके लिए महत्वपूर्ण है — difficulty level "Medium"। Exam में accuracy बढ़ाने के लिए हर सवाल की explanation जरूर पढ़ें।