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 301

EN + हिं Hard
GB Trie search time complexity?
IN खोज समय जटिलता का प्रयास करें?
O(n) पर)
O(log n) ओ(लॉग एन)
O(L) where L=word length O(L) जहां L=शब्द की लंबाई
O(1) हे(1)
✅ Correct Answer:
💡 Explanation / व्याख्या
Explanation (English) Trie search: O(L) where L is the length of the search string.
व्याख्या (हिन्दी) खोज का प्रयास करें: O(L) जहां L खोज स्ट्रिंग की लंबाई है।
🎯 Exam Perspective
Data Structures and Algorithms से जुड़ा यह सवाल — difficulty level "Hard" उन students के लिए काम का है जो Railway, SSC, Banking और Defence परीक्षाओं की तैयारी कर रहे हैं। बेहतर होगा कि explanation पढ़कर concept clear करें, ताकि exam में similar प्रश्न आने पर confusion न हो।

Question 302

EN + हिं Medium
GB Union-Find find() with path compression?
IN पथ संपीड़न के साथ संघ-खोज खोज()?
O(n) पर)
O(log n) ओ(लॉग एन)
O(α(n)) ≈ O(1) amortized O(α(n)) ≈ O(1) परिशोधन
O(n log n) ओ(एन लॉग एन)
✅ Correct Answer:
💡 Explanation / व्याख्या
Explanation (English) With path compression and union by rank: nearly O(1) amortized.
व्याख्या (हिन्दी) पथ संपीड़न और रैंक द्वारा संघ के साथ: लगभग O(1) परिशोधित।
🎯 Exam Perspective
SSC, Railway, Banking और State PCS जैसी परीक्षाओं में Data Structures and Algorithms से सवाल अक्सर पूछे जाते हैं — difficulty level "Medium"। इसलिए सिर्फ answer रटने के बजाय, नीचे दी गई explanation को ध्यान से पढ़ें और concept समझें।

Question 303

EN + हिं Medium
GB Red-Black tree is?
IN लाल-काला पेड़ है?
Binary tree colored for decoration सजावट के लिए रंगीन बाइनरी ट्री
Self-balancing BST with red/black coloring rules लाल/काले रंग के नियमों के साथ स्व-संतुलन बीएसटी
AVL with two rotations दो घुमावों के साथ एवीएल
B-tree of order 2 क्रम 2 का बी-वृक्ष
✅ Correct Answer:
💡 Explanation / व्याख्या
Explanation (English) Red-Black tree: self-balancing BST with color constraints for O(log n) ops.
व्याख्या (हिन्दी) लाल-काला पेड़: ओ (लॉग एन) ऑप्स के लिए रंग बाधाओं के साथ स्व-संतुलन बीएसटी।
🎯 Exam Perspective
अगर आप SSC CGL, IBPS, RRB और State-level परीक्षाओं की तैयारी कर रहे हैं, तो Data Structures and Algorithms का यह topic आपके लिए महत्वपूर्ण है — difficulty level "Medium"। Exam में accuracy बढ़ाने के लिए हर सवाल की explanation जरूर पढ़ें।

Question 304

EN + हिं Medium
GB LRU Cache best implementation?
IN एलआरयू कैश सर्वोत्तम कार्यान्वयन?
Stack ढेर
Queue कतार
Doubly Linked List + Hash Map डबली लिंक्ड लिस्ट + हैश मैप
BST बीएसटी
✅ Correct Answer:
💡 Explanation / व्याख्या
Explanation (English) LRU Cache: DLL for O(1) insertion/deletion + hash map for O(1) lookup.
व्याख्या (हिन्दी) एलआरयू कैश: ओ(1) सम्मिलन/हटाने के लिए डीएलएल + ओ(1) लुकअप के लिए हैश मैप।
🎯 Exam Perspective
Data Structures and Algorithms के इस प्रश्न को — difficulty level "Medium" कई प्रतियोगी परीक्षाओं जैसे UPSC, SSC, Banking और Police भर्ती में repeat होते देखा गया है। Concept clarity के लिए explanation section जरूर पढ़ें।

Question 305

EN + हिं Medium
GB Segment tree used for?
IN खंड वृक्ष का उपयोग किसके लिए किया जाता है?
Sorting छंटाई
Range queries (sum/min/max) with efficient updates कुशल अद्यतनों के साथ रेंज क्वेरीज़ (योग/न्यूनतम/अधिकतम)।
Graph traversal ग्राफ ट्रैवर्सल
String matching स्ट्रिंग मिलान
✅ Correct Answer:
💡 Explanation / व्याख्या
Explanation (English) Segment tree: O(log n) range queries and point/range updates.
व्याख्या (हिन्दी) सेगमेंट ट्री: O(लॉग एन) रेंज क्वेरीज़ और पॉइंट/रेंज अपडेट।
🎯 Exam Perspective
यह सवाल Data Structures and Algorithms category का है — difficulty level "Medium", और Railway, SSC, Banking और Defence परीक्षाओं के exam pattern में इस तरह के questions common हैं। Answer choose करने के बाद दिया गया explanation जरूर पढ़ें।

Question 306

EN + हिं Medium
GB Fenwick tree (BIT) is?
IN फ़ेनविक वृक्ष (BIT) है?
Balanced BST संतुलित बीएसटी
Efficient prefix sum queries and point updates in O(log n) ओ(लॉग एन) में कुशल उपसर्ग योग प्रश्न और बिंदु अद्यतन
Type of heap ढेर का प्रकार
Circular tree गोलाकार वृक्ष
✅ Correct Answer:
💡 Explanation / व्याख्या
Explanation (English) Fenwick/BIT: prefix sum queries and point updates in O(log n).
व्याख्या (हिन्दी) फेनविक/बीआईटी: ओ(लॉग एन) में उपसर्ग योग प्रश्न और बिंदु अद्यतन।
🎯 Exam Perspective
यह प्रश्न Data Structures and Algorithms की तैयारी करने वाले अभ्यर्थियों के लिए उपयोगी है — difficulty level "Medium"। इस तरह के प्रश्न अक्सर SSC, Railway, Banking और State PCS जैसी परीक्षाओं में पूछे जाते रहे हैं, इसलिए concept और explanation दोनों को ध्यान से समझें, सिर्फ उत्तर याद न करें।

Question 307

EN + हिं Medium
GB KMP algorithm used for?
IN KMP एल्गोरिदम का उपयोग किसके लिए किया जाता है?
Sorting strings तारों को क्रमबद्ध करना
String pattern matching in O(n+m) O(n+m) में स्ट्रिंग पैटर्न का मिलान
Shortest path सबसे छोटा रास्ता
Tree traversal वृक्ष परिभ्रमण
✅ Correct Answer:
💡 Explanation / व्याख्या
Explanation (English) KMP: string pattern matching in O(n+m) using failure function.
व्याख्या (हिन्दी) KMP: विफलता फ़ंक्शन का उपयोग करके O(n+m) में स्ट्रिंग पैटर्न का मिलान।
🎯 Exam Perspective
Data Structures and Algorithms से जुड़ा यह सवाल — difficulty level "Medium" उन students के लिए काम का है जो SSC CGL, IBPS, RRB और State-level परीक्षाओं की तैयारी कर रहे हैं। बेहतर होगा कि explanation पढ़कर concept clear करें, ताकि exam में similar प्रश्न आने पर confusion न हो।

Question 308

EN + हिं Medium
GB Timsort is?
IN टिमसॉर्ट है?
Pure merge sort शुद्ध मर्ज सॉर्ट
Hybrid of merge sort and insertion sort मर्ज सॉर्ट और इंसर्शन सॉर्ट का हाइब्रिड
Quick sort variant त्वरित सॉर्ट संस्करण
Counting sort गिनती क्रम
✅ Correct Answer:
💡 Explanation / व्याख्या
Explanation (English) Timsort: hybrid of merge sort and insertion sort (Python's built-in sort).
व्याख्या (हिन्दी) टिमसॉर्ट: मर्ज सॉर्ट और इंसर्शन सॉर्ट का हाइब्रिड (पायथन का अंतर्निहित सॉर्ट)।
🎯 Exam Perspective
UPSC, SSC, Banking और Police भर्ती जैसी परीक्षाओं में Data Structures and Algorithms से सवाल अक्सर पूछे जाते हैं — difficulty level "Medium"। इसलिए सिर्फ answer रटने के बजाय, नीचे दी गई explanation को ध्यान से पढ़ें और concept समझें।

Question 309

EN + हिं Medium
GB Number of distinct BSTs with 3 keys?
IN 3 कुंजी के साथ विशिष्ट बीएसटी की संख्या?
3 3
5 5
6 6
9 9
✅ Correct Answer:
💡 Explanation / व्याख्या
Explanation (English) Catalan number C(3)=5 distinct BSTs with 3 keys.
व्याख्या (हिन्दी) कैटलन संख्या सी(3)=3 कुंजी के साथ 5 विशिष्ट बीएसटी।
🎯 Exam Perspective
अगर आप Railway, SSC, Banking और Defence परीक्षाओं की तैयारी कर रहे हैं, तो Data Structures and Algorithms का यह topic आपके लिए महत्वपूर्ण है — difficulty level "Medium"। Exam में accuracy बढ़ाने के लिए हर सवाल की explanation जरूर पढ़ें।

Question 310

EN + हिं Medium
GB Comparison-based sorting lower bound?
IN तुलना-आधारित सॉर्टिंग निचली सीमा?
O(n) पर)
O(n log n) ओ(एन लॉग एन)
O(n²) ओ(एन²)
O(log n) ओ(लॉग एन)
✅ Correct Answer:
💡 Explanation / व्याख्या
Explanation (English) O(n log n) is theoretical lower bound for comparison-based sorting.
व्याख्या (हिन्दी) O(n log n) तुलना-आधारित छँटाई के लिए सैद्धांतिक निचली सीमा है।
🎯 Exam Perspective
Data Structures and Algorithms के इस प्रश्न को — difficulty level "Medium" कई प्रतियोगी परीक्षाओं जैसे SSC, Railway, Banking और State PCS में repeat होते देखा गया है। Concept clarity के लिए explanation section जरूर पढ़ें।

Question 311

EN + हिं Medium
GB After inserting 1,2,3 into AVL tree, which rotation?
IN AVL ट्री में 1,2,3 डालने के बाद कौन सा घुमाव?
LL डालूँगा
RR आरआर
LR एलआर
RL आर एल
✅ Correct Answer:
💡 Explanation / व्याख्या
Explanation (English) Inserting 1,2,3 creates right-skewed tree — RR rotation balances it.
व्याख्या (हिन्दी) 1,2,3 डालने से दायीं ओर तिरछा पेड़ बनता है - आरआर रोटेशन इसे संतुलित करता है।
🎯 Exam Perspective
यह सवाल Data Structures and Algorithms category का है — difficulty level "Medium", और SSC CGL, IBPS, RRB और State-level परीक्षाओं के exam pattern में इस तरह के questions common हैं। Answer choose करने के बाद दिया गया explanation जरूर पढ़ें।

Question 312

EN + हिं Medium
GB AVL tree LR rotation applied when?
IN एवीएल ट्री एलआर रोटेशन कब लागू किया गया?
New node in left of left child बाएँ बच्चे के बाएँ में नया नोड
New node in right of right child दाएँ बच्चे के दाएँ में नया नोड
New node in right of left child बाएँ बच्चे के दाएँ में नया नोड
New node in left of right child दाएँ बच्चे के बाएँ में नया नोड
✅ Correct Answer:
💡 Explanation / व्याख्या
Explanation (English) LR: new node in right subtree of left child of unbalanced node.
व्याख्या (हिन्दी) एलआर: असंतुलित नोड के बाएं बच्चे के दाएं उपवृक्ष में नया नोड।
🎯 Exam Perspective
यह प्रश्न Data Structures and Algorithms की तैयारी करने वाले अभ्यर्थियों के लिए उपयोगी है — difficulty level "Medium"। इस तरह के प्रश्न अक्सर UPSC, SSC, Banking और Police भर्ती जैसी परीक्षाओं में पूछे जाते रहे हैं, इसलिए concept और explanation दोनों को ध्यान से समझें, सिर्फ उत्तर याद न करें।

Question 313

EN + हिं Hard
GB All AVL operations time complexity?
IN सभी एवीएल संचालन समय जटिलता?
O(n) पर)
O(log n) ओ(लॉग एन)
O(1) हे(1)
O(n²) ओ(एन²)
✅ Correct Answer:
💡 Explanation / व्याख्या
Explanation (English) AVL tree: all operations O(log n) — always balanced.
व्याख्या (हिन्दी) एवीएल ट्री: सभी ऑपरेशन ओ (लॉग एन) - हमेशा संतुलित।
🎯 Exam Perspective
Data Structures and Algorithms से जुड़ा यह सवाल — difficulty level "Hard" उन students के लिए काम का है जो Railway, SSC, Banking और Defence परीक्षाओं की तैयारी कर रहे हैं। बेहतर होगा कि explanation पढ़कर concept clear करें, ताकि exam में similar प्रश्न आने पर confusion न हो।

Question 314

EN + हिं Medium
GB B-tree insertion always occurs at?
IN बी-ट्री इंसर्शन हमेशा कहां होता है?
Root जड़
Leaf level पत्ती का स्तर
Random यादृच्छिक
Internal nodes आंतरिक नोड्स
✅ Correct Answer:
💡 Explanation / व्याख्या
Explanation (English) B-tree insertion always at the leaf level (bottom-up approach).
व्याख्या (हिन्दी) बी-वृक्ष का सम्मिलन हमेशा पत्ती के स्तर पर (नीचे से ऊपर की ओर) होता है।
🎯 Exam Perspective
SSC, Railway, Banking और State PCS जैसी परीक्षाओं में Data Structures and Algorithms से सवाल अक्सर पूछे जाते हैं — difficulty level "Medium"। इसलिए सिर्फ answer रटने के बजाय, नीचे दी गई explanation को ध्यान से पढ़ें और concept समझें।

Question 315

EN + हिं Medium
GB Full B-tree node during insertion: operation performed?
IN सम्मिलन के दौरान पूर्ण बी-ट्री नोड: ऑपरेशन निष्पादित हुआ?
Delete node नोड हटाएँ
Split at median, push median up माध्यिका पर विभाजित करें, माध्यिका को ऊपर की ओर धकेलें
New sibling arbitrarily नया भाई मनमाने ढंग से
Rebuild from scratch खरोंच से पुनर्निर्माण करें
✅ Correct Answer:
💡 Explanation / व्याख्या
Explanation (English) Full node: split at median, median key goes up, create two children.
व्याख्या (हिन्दी) पूर्ण नोड: मध्य पर विभाजित, मध्य कुंजी ऊपर जाती है, दो बच्चे बनाते हैं।
🎯 Exam Perspective
अगर आप SSC CGL, IBPS, RRB और State-level परीक्षाओं की तैयारी कर रहे हैं, तो Data Structures and Algorithms का यह topic आपके लिए महत्वपूर्ण है — difficulty level "Medium"। Exam में accuracy बढ़ाने के लिए हर सवाल की explanation जरूर पढ़ें।