25 questions · about 30 minutes. Press End Mock any time to see your score and the correct answers.
In Python .......... function returns the number of characters in string argument.
पायथन में यह फंक्शन स्ट्रिंग में कैरेक्टर की संख्या बताता है :
Correct answer: B. Len
len() returns the number of items in a sequence; for a string that is the number of characters — len('HTET') is 4.
len() किसी अनुक्रम में आइटम की संख्या देता है; स्ट्रिंग के लिए यह कैरेक्टर की संख्या है — len('HTET') = 4।
Which programming pays more attention on data rather than functions?
कौन-सी प्रोग्रामिंग फंक्शन्स की बजाय डेटा पर अधिक ध्यान देती है?
Correct answer: C. Object Oriented Programming
Object-oriented programming builds programs around objects, which bundle data with the methods that act on it. Procedural and structured programming are organised around functions.
ऑब्जेक्ट ओरिएंटेड प्रोग्रामिंग प्रोग्राम को ऑब्जेक्ट्स (डेटा + उस पर काम करने वाले मेथड) के इर्द-गिर्द बनाती है। प्रोसीजरल/स्ट्रक्चर्ड प्रोग्रामिंग फंक्शन्स पर केंद्रित होती है।
.......... refers to the procedure of representing essential features without including the background details.
.......... बैकग्राउंड डिटेल्स को शामिल किए बिना आवश्यक विशेषताओं का प्रतिनिधित्व करने की प्रक्रिया को रिप्रेजेंट करता है।
Correct answer: A. Abstraction
Abstraction shows only the essential features and hides the details, like driving a car without knowing how the engine works. Encapsulation is wrapping data and methods together in one unit.
एब्स्ट्रैक्शन केवल आवश्यक विशेषताएँ दिखाता है और अंदरूनी विवरण छिपाता है — जैसे इंजन जाने बिना कार चलाना। एनकैप्सुलेशन डेटा और मेथड को एक यूनिट में बाँधना है।
In Python Dictionaries organize the information by ........, not position.
पायथन में Dictionaries जानकारी को स्थिति के अनुसार नहीं, ........ द्वारा व्यवस्थित करता है।
Correct answer: D. Association
A dictionary stores key–value pairs and finds a value through its associated key (d['name']), not by index position as in a list. Dictionaries are therefore called associative arrays.
डिक्शनरी key–value जोड़े रखती है और मान उसकी संबद्ध key से मिलता है (d['name']), लिस्ट की तरह इंडेक्स से नहीं — इसीलिए इसे associative array कहते हैं।
In Python "==" operator returns true if :
पायथन में "==" ऑपरेटर सत्य देता है यदि :
Correct answer: B. Content of two different objects are sameदो भिन्न ऑब्जेक्ट्स के कंटेंट समान हैं
== compares values (equality), so it is True when two different objects have the same content: [1, 2] == [1, 2]. Testing whether two names are aliases for the same object is the job of 'is'. (== is also True for aliases, but the expected answer separates the two operators.)
== मानों की तुलना करता है, इसलिए दो अलग ऑब्जेक्ट्स का कंटेंट समान होने पर True देता है: [1, 2] == [1, 2]। दो नाम एक ही ऑब्जेक्ट के उपनाम हैं या नहीं — यह 'is' जाँचता है। (उपनाम होने पर भी == True होगा, पर प्रश्न दोनों ऑपरेटरों का अंतर पूछ रहा है।)
A .......... is the specification of legal values for variable of the type.
एक वेरिएबल की मान्य मूल्यों का विनिर्देश है :
Correct answer: A. Data Types
A data type specifies the set of legal values a variable can hold (and the operations allowed on them) — e.g. int, float, char.
डेटा टाइप यह निर्धारित करता है कि वेरिएबल कौन-से मान्य मान रख सकता है (और उन पर कौन-से ऑपरेशन संभव हैं) — जैसे int, float, char।
In Python .......... operator is used to determine the element's presence or absence in list.
पायथन में .......... ऑपरेटर का उपयोग लिस्ट में एलीमेंट की उपस्थिति एवं अनुपस्थिति को निर्धारित करने के लिए किया जाता है।
Correct answer: B. in
The membership operators 'in' and 'not in' test whether an element is in a sequence: 3 in [1, 2, 3] gives True.
मेंबरशिप ऑपरेटर 'in' (और 'not in') जाँचता है कि एलिमेंट अनुक्रम में है या नहीं: 3 in [1, 2, 3] → True।
In Python, .......... is the type of sequence that resembles a list, except that, unlike a list, it is immutable.
पायथन में .......... एक प्रकार का अनुक्रम है जो एक सूची जैसा दिखता है, सिवाय इसके कि, एक सूची के विपरीत, यह अपरिवर्तनीय है।
Correct answer: D. Tuple
A tuple is an ordered sequence like a list but immutable: (1, 2, 3) cannot be changed after it is created. A list [1, 2, 3] is mutable.
टपल लिस्ट जैसा क्रमबद्ध अनुक्रम है पर अपरिवर्तनीय (immutable) है — (1, 2, 3) बनने के बाद बदला नहीं जा सकता; लिस्ट [1, 2, 3] परिवर्तनीय है।
.......... is a set of rules for carrying out some calculation either by hand or by machine.
हाथ या मशीन पर कुछ गणना करने के लिए नियमों का सेट .......... कहलाता है।
Correct answer: C. Algorithm
An algorithm is a finite, step-by-step set of rules for solving a problem or doing a calculation, whether by hand or by machine.
एल्गोरिदम किसी समस्या को हल करने या गणना करने के लिए नियमों/चरणों का सीमित और क्रमबद्ध सेट है — चाहे हाथ से किया जाए या मशीन से।
Which procedure is characterized by the fact that the procedure calls itself again and again till the base condition is met?
किस प्रक्रिया की यह विशेषता होती है कि वह प्रक्रिया स्वयं को बार-बार कॉल करती है जब तक कि आधार शर्त पूरी नहीं हो जाती है?
Correct answer: C. Recursive
A recursive procedure calls itself with a smaller input until it reaches a base case: factorial(n) = n × factorial(n − 1), with factorial(0) = 1.
रिकर्सिव प्रक्रिया आधार स्थिति (base case) तक पहुँचने तक छोटे इनपुट के साथ खुद को कॉल करती है: factorial(n) = n × factorial(n − 1), factorial(0) = 1।
If a class contains at least one pure virtual function, it is called as ............. class.
यदि किसी क्लास में कम से कम एक प्योर वर्चुअल फंक्शन हो, तो उस क्लास को कहा जाता है :
Correct answer: B. Abstractएब्सट्रैक्ट
A class with at least one pure virtual function (virtual void f() = 0;) is an abstract class; it cannot be instantiated.
जिस क्लास में कम से कम एक प्योर वर्चुअल फंक्शन (virtual void f() = 0;) हो वह एब्स्ट्रैक्ट क्लास है; उसका ऑब्जेक्ट नहीं बनता।
Tuples in Python are :
पायथन में टपल्स हैं :
Correct answer: B. immutableइमम्युटेबल
A tuple cannot be changed after it is created — it is immutable. Lists are mutable.
टपल बनने के बाद बदला नहीं जा सकता, यानी इम्म्यूटेबल है। लिस्ट म्यूटेबल होती है।
In python elements of the list are written inside :
पायथन में लिस्ट के एलीमेंट्स ---------- के अंदर लिखे जाते हैं।
Correct answer: A. [ ]
A Python list is written in square brackets: [1, 2, 3]. ( ) makes a tuple and { } a set or dictionary.
पायथन लिस्ट वर्गाकार कोष्ठक [ ] में लिखी जाती है; ( ) से टपल और { } से सेट/डिक्शनरी बनती है।
Pictorial representation of an algorithm is called as :
किसी एल्गोरिथ्म का सचित्र निरूपण कहलाता है :
Correct answer: C. Flowchartफ्लोचार्ट
A flowchart is the pictorial (diagram) form of an algorithm; pseudocode is its text form.
फ्लोचार्ट एल्गोरिथ्म का चित्रात्मक रूप है; स्यूडोकोड उसका लिखित रूप है।
In Python dictionary key value pairs are separated by :
पायथन में Dictionary Key Value जोड़े को अलग किया जाता है :
Correct answer: A. :: द्वारा
In a dictionary each pair is key: value, e.g. {'a': 1, 'b': 2}.
डिक्शनरी में हर जोड़ी key: value लिखी जाती है, जैसे {'a': 1, 'b': 2}।
In Python instance methods use ........... as first default parameter.
इंस्टेंस मैथड्स प्रथम डिफॉल्ट पैरामीटर के रूप में ------------- का उपयोग करते हैं।
Correct answer: C. self
Instance methods receive the object itself as the first parameter, named self by convention.
इंस्टेंस मेथड का पहला पैरामीटर स्वयं ऑब्जेक्ट होता है, जिसे परंपरा से self कहते हैं।
Step by step description of how to arrive at a solution to a given problem is known as :
किसी दी गई समस्या के समाधान तक पहुँचने के स्टेप-बाइ-स्टेप विवरण को कहा जाता है :
Correct answer: A. Algorithmएल्गोरिथ्म
An algorithm is a finite, step-by-step procedure for solving a problem.
एल्गोरिथ्म किसी समस्या को हल करने की चरणबद्ध, सीमित प्रक्रिया है।
This module converts the python source file into .pyc file :
यह मॉड्यूल पायथन सोर्स फाइल को .pyc फाइल में परिवर्तित करता है :
Correct answer: D. py_compile
The py_compile module compiles a .py source file to byte code (.pyc): python -m py_compile file.py.
py_compile मॉड्यूल .py सोर्स फाइल को बाइट कोड (.pyc) में बदलता है।
The software containing an interpreter that converts the byte code into machine code where the python program runs is called as :
वह सॉफ्टवेयर जिसमें एक इन्टरप्रेटर होता है जो बाइट कोड को मशीन कोड में परिवर्तित करता है जहाँ पायथन प्रोग्राम रन होता है, उसे कहा जाता है :
Correct answer: B. Python Virtual Machineपायथन वर्चुअल मशीन
The Python Virtual Machine (PVM) is the interpreter that runs the compiled byte code.
पायथन वर्चुअल मशीन (PVM) कंपाइल हुए बाइट कोड को चलाने वाला इंटरप्रेटर है।
Which of the following constructor related concept is non-relevant in C++ ?
कन्स्ट्रक्टर संबंधी सिद्धान्तों में निम्न में से कौन-सा C++ में अप्रासंगिक है ?
Correct answer: D. virtual constructorवर्चुअल कन्स्ट्रक्टर
C++ has copy, conversion and overloaded constructors, but a constructor can never be virtual (the object's type is not yet known while it is being built). Only destructors can be virtual.
C++ में कॉपी, कन्वर्जन और ओवरलोडेड कन्स्ट्रक्टर होते हैं, पर कन्स्ट्रक्टर कभी virtual नहीं हो सकता। केवल डिस्ट्रक्टर virtual हो सकता है।
In C++, which of the following is not a derived container under STL ?
C++ में, निम्न में से कौन-सा STL के अन्तर्गत एक डिराइव्ड कंटेनर नहीं है ?
Correct answer: B. dequeडीक्यु
stack, queue and priority_queue are container adaptors (derived containers) built on other containers. deque is a basic sequence container.
stack, queue और priority_queue डिराइव्ड कंटेनर (कंटेनर एडेप्टर) हैं, जबकि deque एक मूल सीक्वेंस कंटेनर है।
In C++, an overloaded unary operator defined as a member function requires how many variables to be passed as function argument ?
C++ में, सदस्य फलन के रूप में परिभाषित एक ओवरलोडेड युनरी ऑपरेटर को फंक्शन आर्ग्युमेंट के तौर पर कितने चर पास किये जाने की आवश्यकता होगी ?
Correct answer: A. Zeroशून्य
A unary operator overloaded as a member function takes no argument — the operand is the calling object (this). As a friend function it would take one.
सदस्य फलन के रूप में ओवरलोड किया गया युनरी ऑपरेटर कोई आर्ग्युमेंट नहीं लेता; ऑपरेंड स्वयं ऑब्जेक्ट (this) होता है। फ्रेंड फलन में एक आर्ग्युमेंट लगता है।
How many times 'save trees' will be displayed by C++ loop ?
do { cout << "save trees"; } while(0);
C++ लूप के द्वारा 'save trees' कितनी बार प्रदर्शित किया जायेगा ?
Correct answer: A. Oneएक
A do-while loop runs its body once before testing the condition. while(0) is false, so "save trees" prints exactly once.
do-while लूप शर्त जाँचने से पहले एक बार चलता है। while(0) असत्य है, इसलिए "save trees" केवल एक बार छपेगा।
Consider Column-I and Column-II in context of C++ :
Match of Column-I and Column-II is :
C++ के संदर्भ में स्तम्भ-I तथा स्तम्भ-II पर विचार कीजिए :
स्तम्भ-I तथा स्तम्भ-II का सुमेल है :
Correct answer: D. i-b, ii-c, iii-d, iv-a
private → visibility specifier, sizeof → operator, static → storage class, long → data type modifier: i-b, ii-c, iii-d, iv-a.
private → विज़िबिलिटी स्पेसिफायर, sizeof → ऑपरेटर, static → स्टोरेज क्लास, long → डेटा टाइप मॉडिफायर: i-b, ii-c, iii-d, iv-a।
Choose true statements about virtual functions in C++ :
I : The virtual functions must be member of some class.
II : They cannot be static members.
III: A virtual function can be a friend of another class.
C++ में वर्चुअल फलनों के बारे में सत्य कथनों का चुनाव कीजिए :
I : वर्चुअल फलन किसी क्लास के सदस्य फलन होने ही चाहिए।
II : वे स्टेटिक सदस्य नहीं हो सकते।
III: एक वर्चुअल फलन अन्य क्लास का मित्र फलन हो सकता है।
Correct answer: D. I, II and IIII, II तथा III
All three are standard rules: a virtual function must be a member of some class, it cannot be a static member, and it can be declared a friend of another class.
तीनों नियम सही हैं: वर्चुअल फलन किसी क्लास का सदस्य होना चाहिए, स्टेटिक नहीं हो सकता और किसी अन्य क्लास का फ्रेंड हो सकता है।