प्रोग्रामिङ – Programming MCQ
प्रोग्रामिङ – कम्प्युटर र IT
Programming · Computer & IT (Technical) · १,५६५ प्रश्न
१,५६५ प्रश्न उपलब्ध। मोड छान्नुहोस्:
प्रोग्रामिङ: प्रश्न र उत्तर
सही लागेको विकल्पमा थिच्नुहोस्। सही भए हरियो, गलत भए रातो देखिन्छ; ३ सेकेन्डपछि सही उत्तर र व्याख्या देखिन्छ।
सही: ० / ०
-
Using the usual stack-based conversion, A * (B + C) / D becomes which postfix string?
सही उत्तर: ग) A B C + * D /
The bracket makes B + C (B C +) come first; it is multiplied by A, and the result is divided by D.
💬 टिप्पणी / गल्ती रिपोर्ट (०)
-
Which infix expression corresponds to the postfix (reverse Polish) expression A B + C D - * ?
सही उत्तर: घ) (A + B) * (C - D)
A B + is (A + B) and C D - is (C - D); the final * multiplies these two results.
💬 टिप्पणी / गल्ती रिपोर्ट (०)
-
Starting with an empty queue, the operations enqueue 5, enqueue 6, enqueue 7, dequeue, enqueue 8, dequeue are performed. Which element is now at the front?
सही उत्तर: क) 7
The two dequeues remove 5 and 6 in arrival order, leaving 7, 8 with 7 at the front.
💬 टिप्पणी / गल्ती रिपोर्ट (०)
-
How many element shifts (swaps of adjacent elements) does insertion sort make to sort [4, 3, 2, 1] into ascending order?
सही उत्तर: क) 6
Insertion sort makes one shift per inversion; a fully reversed list of 4 elements has 4 x 3 / 2 = 6 inversions.
💬 टिप्पणी / गल्ती रिपोर्ट (०)
-
Which design pattern lets classes with incompatible interfaces work together by wrapping one of them in a class that converts its interface?
सही उत्तर: ख) Adapter
An Adapter translates the interface of an existing class into the interface the client expects.
💬 टिप्पणी / गल्ती रिपोर्ट (०)
-
The Interface Segregation Principle of object-oriented design says that:
सही उत्तर: ग) clients should not be forced to depend on methods they do not use
ISP favours several small, specific interfaces over one large general-purpose interface.
💬 टिप्पणी / गल्ती रिपोर्ट (०)
-
In Java, the fields declared in an interface are implicitly:
सही उत्तर: घ) public, static and final
Interface fields are constants: the compiler treats them as public static final even if the modifiers are not written.
💬 टिप्पणी / गल्ती रिपोर्ट (०)
-
In Java, what is printed by: StringBuilder sb = new StringBuilder("abc"); sb.reverse().append("d"); System.out.println(sb); ?
सही उत्तर: घ) cbad
reverse() changes the builder to "cba" and returns it, then append("d") gives "cbad".
💬 टिप्पणी / गल्ती रिपोर्ट (०)
-
In Java, what is printed by: String s = "abc"; s.concat("d"); System.out.println(s); ?
सही उत्तर: क) abc
concat() returns a new String; since the result is not assigned, the immutable s still refers to "abc".
💬 टिप्पणी / गल्ती रिपोर्ट (०)
-
In Java, what is printed by: int x = 5; System.out.println(x++ + ++x); ?
सही उत्तर: ख) 12
Java evaluates operands left to right: x++ gives 5 (x becomes 6), then ++x makes x 7 and gives 7; 5 + 7 = 12.
💬 टिप्पणी / गल्ती रिपोर्ट (०)
यी अभ्यास प्रश्न हुन्, आधिकारिक प्रश्न होइनन्। पाठ्यक्रम, विज्ञापन र नतिजाका लागि सम्बन्धित निकायको आधिकारिक वेबसाइट हेर्नुहोस्। उत्तरमा गल्ती भेटे प्रश्नमुनिको "टिप्पणी / गल्ती रिपोर्ट" मा लेख्नुहोस्।
नमस्ते! पाठ्यक्रम, सामान्य ज्ञान, भाषा परीक्षा वा कुनै प्रश्नको उत्तर बुझ्न सोध्नुहोस्।
AI ले गल्ती गर्न सक्छ। महत्वपूर्ण कुरा आधिकारिक स्रोतमा जाँच्नुहोस्।