InterviewSolution
This section includes InterviewSolutions, each offering curated multiple-choice questions to sharpen your knowledge and support exam preparation. Choose a topic below to get started.
| 1. |
In C++, what is the sign of character data type by default?(a) Signed(b) Unsigned(c) Implementation dependent(d) Unsigned ImplementationI have been asked this question in an international level competition.I'm obligated to ask this question of Character Types topic in portion Types, Pointers, Arrays & Structures in C++ of C++ |
|
Answer» The correct CHOICE is (c) Implementation dependent |
|
| 2. |
Which function is used to check whether a character is a number?(a) isalpha()(b) isalnum()(c) isdigit()(d) isblank()I had been asked this question in an international level competition.Enquiry is from Character Classification topic in section Types, Pointers, Arrays & Structures in C++ of C++ |
|
Answer» Right CHOICE is (c) ISDIGIT() |
|
| 3. |
The pointer can point to any variable that is not declared with which of these?(a) const(b) volatile(c) both const & volatile(d) staticThe question was asked in an internship interview.The query is from Pointer to Void in section Types, Pointers, Arrays & Structures in C++ of C++ |
|
Answer» The CORRECT ANSWER is (c) both CONST & volatile |
|
| 4. |
The void pointer can point to which type of objects?(a) int(b) float(c) double(d) all of the mentionedI have been asked this question in an interview.Enquiry is from Pointer to Void topic in division Types, Pointers, Arrays & Structures in C++ of C++ |
|
Answer» Correct choice is (d) all of the mentioned |
|
| 5. |
How do we represent a wide character of the form wchar_t?(a) L’a’(b) l’a’(c) L[a](d) laI have been asked this question in class test.This interesting question is from Character Types topic in section Types, Pointers, Arrays & Structures in C++ of C++ |
|
Answer» The CORRECT answer is (a) L’a’ |
|
| 6. |
What is the size of wchar_t in C++?(a) 2(b) 4(c) 2 or 4(d) Based on the number of bits in the systemThis question was posed to me in an international level competition.This intriguing question comes from Types in section Types, Pointers, Arrays & Structures in C++ of C++ |
|
Answer» CORRECT answer is (d) Based on the number of bits in the system The EXPLANATION is: Compiler wants to MAKE CPU as more efficient in accessing the NEXT value. |
|
| 7. |
What is the index number of the last element of an array with 9 elements?(a) 9(b) 8(c) 0(d) Programmer-definedI have been asked this question in quiz.The question is from Arrays topic in chapter Types, Pointers, Arrays & Structures in C++ of C++ |
|
Answer» Right OPTION is (b) 8 |
|
| 8. |
Which of the following correctly declares an array?(a) int array[10];(b) int array;(c) array{10};(d) array array[10];This question was posed to me in a national level competition.My doubt stems from Arrays in chapter Types, Pointers, Arrays & Structures in C++ of C++ |
|
Answer» Right ANSWER is (a) int array[10]; |
|
| 9. |
Which of the following is a properly defined structure?(a) struct {int a;}(b) struct a_struct {int a;}(c) struct a_struct int a;(d) struct a_struct {int a;};The question was asked by my college director while I was bunking the class.The doubt is from Structures in portion Types, Pointers, Arrays & Structures in C++ of C++ |
|
Answer» Correct OPTION is (d) struct a_struct {int a;}; |
|
| 10. |
What is the difference between references and pointers?(a) References are an alias for a variable whereas pointer stores the address of a variable(b) References and pointers are similar(c) References stores address of variables whereas pointer points to variables(d) Pointers are an alias for a variable whereas references stores the address of a variableThe question was asked by my school principal while I was bunking the class.My doubt stems from References topic in division Types, Pointers, Arrays & Structures in C++ of C++ |
|
Answer» Right choice is (a) References are an ALIAS for a variable whereas POINTER stores the address of a variable |
|
| 11. |
Which one of the following is not a possible state for a pointer.(a) hold the address of the specific object(b) point one past the end of an object(c) zero(d) point to a typeI got this question in an international level competition.My question is based upon Pointers topic in chapter Types, Pointers, Arrays & Structures in C++ of C++ |
|
Answer» The correct ANSWER is (d) POINT to a type |
|
| 12. |
It is guaranteed that a ____ has at least 8 bits and a ____ has at least 16 bits.(a) int, float(b) char, int(c) bool, char(d) char, shortI got this question by my school teacher while I was bunking the class.Query is from Sizes topic in division Types, Pointers, Arrays & Structures in C++ of C++ |
|
Answer» Right choice is (d) char, SHORT |
|
| 13. |
The value 132.54 can be represented using which data type?(a) double(b) void(c) int(d) boolI have been asked this question during a job interview.Question is taken from Types in chapter Types, Pointers, Arrays & Structures in C++ of C++ |
|
Answer» CORRECT option is (a) DOUBLE The explanation: The GIVEN value is with decimal points, so float or double can be used. |
|
| 14. |
Which data type is used to represent the absence of parameters?(a) int(b) short(c) void(d) floatI got this question by my college professor while I was bunking the class.The query is from Types topic in section Types, Pointers, Arrays & Structures in C++ of C++ |
|
Answer» Correct option is (C) VOID |
|
| 15. |
Is the size of character literals different in C and C++?(a) Implementation defined(b) Can’t say(c) Yes, they are different(d) No, they are not differentThis question was posed to me in a job interview.This interesting question is from Character Types in chapter Types, Pointers, Arrays & Structures in C++ of C++ |
|
Answer» Right choice is (C) YES, they are different |
|
| 16. |
What will be used when terminating a structure?(a) :(b) }(c) ;(d) ;;This question was posed to me in an international level competition.Question is from Structures topic in section Types, Pointers, Arrays & Structures in C++ of C++ |
|
Answer» The CORRECT CHOICE is (c) ; |
|
| 17. |
The data elements in the structure are also known as what?(a) objects(b) members(c) data(d) objects & dataI got this question in semester exam.This intriguing question comes from Structures topic in portion Types, Pointers, Arrays & Structures in C++ of C++ |
|
Answer» Right answer is (b) members |
|
| 18. |
What are the references in C++?(a) An alternative name for already existing variables(b) A pointer to a variable(c) A new type of variables(d) A new type of constant variableThis question was posed to me in an internship interview.My question is based upon References in chapter Types, Pointers, Arrays & Structures in C++ of C++ |
|
Answer» Right answer is (a) An alternative name for already existing variables |
|
| 19. |
The constants are also called as _____________(a) const(b) preprocessor(c) literals(d) variablesI had been asked this question in my homework.I'd like to ask this question from Constants in portion Types, Pointers, Arrays & Structures in C++ of C++ |
|
Answer» Correct ANSWER is (C) literals |
|
| 20. |
Which of these expressions will make the rightmost set bit zero in an input integer x?(a) x = x | (x-1)(b) x = x & (x-1)(c) x = x | (x+1)(d) x = x & (x+2)I got this question in an interview for job.Question is from Integer Types in division Types, Pointers, Arrays & Structures in C++ of C++ |
|
Answer» The correct OPTION is (b) x = x & (x-1) |
|
| 21. |
Which of these expressions will return true if the input integer v is a power of two?(a) (v | (v + 1)) == 0;(b) (~v & (v – 1)) == 0;(c) (v | (v – 1)) == 0;(d) (v & (v – 1)) == 0;I got this question in an international level competition.The query is from Integer Types topic in portion Types, Pointers, Arrays & Structures in C++ of C++ |
|
Answer» Right answer is (d) (v & (v – 1)) == 0; |
|
| 22. |
The size_t integer type in C++ is?(a) Unsigned integer of at least 64 bits(b) Signed integer of at least 16 bits(c) Unsigned integer of at least 16 bits(d) Signed integer of at least 64 bitsThis question was addressed to me in final exam.The question is from Integer Types in portion Types, Pointers, Arrays & Structures in C++ of C++ |
|
Answer» The correct answer is (c) Unsigned INTEGER of at least 16 bits |
|
| 23. |
For what values of the expression is an if-statement block not executed?(a) 0 and all negative values(b) 0 and -1(c) 0(d) 0, all negative values, all positive values except 1I have been asked this question at a job interview.My enquiry is from Booleans topic in chapter Types, Pointers, Arrays & Structures in C++ of C++ |
|
Answer» CORRECT choice is (c) 0 Best explanation: The if-statement BLOCK is only not executed when the expression evaluates to 0. its just SYNTACTIC sugar for a branch-if-zero INSTRUCTION. |
|
| 24. |
Pick the odd one out.(a) array type(b) character type(c) boolean type(d) integer typeI have been asked this question during an interview.Question is taken from Types topic in division Types, Pointers, Arrays & Structures in C++ of C++ |
|
Answer» Correct ANSWER is (a) array type |
|
| 25. |
Identify the incorrect statement.(a) Reference is the alternate name of the object(b) A reference value once defined can be reassigned(c) A reference value once defined cannot be reassigned(d) Reference is the alternate name of the variableThis question was posed to me in exam.My enquiry is from References topic in section Types, Pointers, Arrays & Structures in C++ of C++ |
|
Answer» Correct CHOICE is (b) A reference value once defined can be reassigned |
|
| 26. |
The size of an object or a type can be determined using which operator?(a) malloc(b) sizeof(c) malloc(d) callocI got this question in unit test.My question is taken from Sizes topic in portion Types, Pointers, Arrays & Structures in C++ of C++ |
|
Answer» RIGHT choice is (b) sizeof For explanation: The sizeof operator gives the SIZE of the object or type. |
|
| 27. |
Which of the following statements are false?(a) bool can have two values and can be used to express logical expressions(b) bool cannot be used as the type of the result of the function(c) bool can be converted into integers implicitly(d) a bool value can be used in arithmetic expressionsThe question was posed to me by my college director while I was bunking the class.The doubt is from Booleans in portion Types, Pointers, Arrays & Structures in C++ of C++ |
|
Answer» The CORRECT CHOICE is (b) bool cannot be USED as the type of the result of the FUNCTION |
|
| 28. |
A void pointer cannot point to which of these?(a) methods in c++(b) class member in c++(c) methods & class member in c++(d) none of the mentionedI have been asked this question in a job interview.My doubt is from Pointer to Void in portion Types, Pointers, Arrays & Structures in C++ of C++ |
|
Answer» Right CHOICE is (d) none of the mentioned |
|
| 29. |
Pick the correct statement about references.(a) References can be assigned value NULL(b) References once assigned cannot be changed to refer another variable(c) Reference should not be initialized when created(d) Reference is the same as pointersThis question was posed to me during an online exam.This interesting question is from References in section Types, Pointers, Arrays & Structures in C++ of C++ |
|
Answer» The correct option is (b) References once ASSIGNED cannot be changed to refer another variable |
|
| 30. |
Which reference modifier is used to define the reference variable?(a) &(b) $(c) #(d) @This question was addressed to me in an interview for job.Query is from References topic in section Types, Pointers, Arrays & Structures in C++ of C++ |
|
Answer» CORRECT ANSWER is (a) & The EXPLANATION: & aka ‘AMPERSAND’ used to define a reference variable. |
|
| 31. |
The difference between x and ‘x’ is?(a) The first one refers to a variable whose identifier is x and the second one refers to the character constant x(b) The first one is a character constant x and the second one is the string literal x(c) Both are same(d) Both are string literalI had been asked this question in exam.This key question is from Constants topic in portion Types, Pointers, Arrays & Structures in C++ of C++ |
|
Answer» The correct answer is (a) The first one refers to a variable whose identifier is x and the SECOND one refers to the character CONSTANT x |
|
| 32. |
Identify the incorrect option.(a) enumerators are constants(b) enumerators are user-defined types(c) enumerators are same as macros(d) enumerator values start from 0 by defaultI got this question by my college professor while I was bunking the class.I need to ask this question from Enumerations in chapter Types, Pointers, Arrays & Structures in C++ of C++ |
|
Answer» CORRECT choice is (C) enumerators are same as MACROS The EXPLANATION is: Enumerators are used in order to CREATE our own types whereas macros are textual substitutions. |
|
| 33. |
Which function is used to check whether a character is an alphabet or number?(a) isalpha()(b) isalnum()(c) isdigit()(d) isblank()This question was addressed to me during an online interview.The doubt is from Character Classification topic in section Types, Pointers, Arrays & Structures in C++ of C++ |
|
Answer» The correct choice is (B) isalnum() |
|
| 34. |
What will happen when defining the enumerated type?(a) it will not allocate memory(b) it will allocate memory(c) it will not allocate memory to its variables(d) allocate memory to objectsThis question was posed to me in a national level competition.The above asked question is from Enumerations topic in section Types, Pointers, Arrays & Structures in C++ of C++ |
|
Answer» Right CHOICE is (a) it will not allocate MEMORY |
|
| 35. |
Implementation dependent aspects about an implementation can be found in ____(a) (b) (c) (d) I got this question in a job interview.Query is from Sizes in division Types, Pointers, Arrays & Structures in C++ of C++ |
|
Answer» CORRECT ANSWER is (B) For EXPLANATION: The limit header holds the details of the machine dependent details. |
|
| 36. |
Which of the following is a valid floating-point literal?(a) f287.333(b) F287.333(c) 287.e2(d) 287.3.e2I have been asked this question in semester exam.My doubt stems from Floating Point Types topic in section Types, Pointers, Arrays & Structures in C++ of C++ |
|
Answer» RIGHT CHOICE is (c) 287.e2 Explanation: To make a floating point literal, we should attach a suffix of ‘f’ or ‘F’ and there should not be any BLANK space. |
|
| 37. |
Which of three sizes of floating point types should be used when extended precision is required?(a) float(b) double(c) long double(d) extended floatThe question was posed to me in semester exam.My enquiry is from Floating Point Types topic in division Types, Pointers, Arrays & Structures in C++ of C++ |
|
Answer» The correct ANSWER is (c) LONG double |
|
| 38. |
What is the range of the floating point numbers?(a) -3.4E+38 to +3.4E+38(b) -3.4E+38 to +3.4E+34(c) -3.4E+38 to +3.4E+36(d) -3.4E+38 to +3.4E+32This question was addressed to me in examination.The query is from Floating Point Types topic in portion Types, Pointers, Arrays & Structures in C++ of C++ |
|
Answer» The correct choice is (a) -3.4E+38 to +3.4E+38 |
|
| 39. |
Which of the following is not one of the sizes of the floating point types?(a) short float(b) float(c) long double(d) doubleThis question was addressed to me by my school teacher while I was bunking the class.Enquiry is from Floating Point Types in portion Types, Pointers, Arrays & Structures in C++ of C++ |
|
Answer» Right choice is (a) SHORT float |
|
| 40. |
Is bool a fundamental data type in C++?(a) Yes(b) No, it is a typedef of unsigned char(c) No, it is an enum of {false, true}(d) No, it is expanded from macrosThis question was posed to me by my school teacher while I was bunking the class.This key question is from Booleans topic in chapter Types, Pointers, Arrays & Structures in C++ of C++ |
|
Answer» The correct OPTION is (a) Yes |
|
| 41. |
What are the parts of the literal constants?(a) integer numerals(b) floating-point numerals(c) strings and boolean values(d) all of the mentionedThis question was posed to me in class test.The question is from Constants topic in division Types, Pointers, Arrays & Structures in C++ of C++ |
|
Answer» The CORRECT answer is (d) all of the mentioned |
|
| 42. |
Which of the following accesses the seventh element stored in array?(a) array[6];(b) array[7];(c) array(7);(d) array;This question was addressed to me during an online exam.The above asked question is from Arrays topic in section Types, Pointers, Arrays & Structures in C++ of C++ |
|
Answer» Right answer is (a) ARRAY[6]; |
|
| 43. |
To which of these enumerators can be assigned?(a) integer(b) negative(c) enumerator(d) all of the mentionedThis question was addressed to me in an interview.Question is from Enumerations topic in chapter Types, Pointers, Arrays & Structures in C++ of C++ |
|
Answer» Correct OPTION is (d) all of the mentioned |
|
| 44. |
Which of the following will not return a value?(a) null(b) void(c) empty(d) freeI have been asked this question in homework.I want to ask this question from Void in section Types, Pointers, Arrays & Structures in C++ of C++ |
|
Answer» The correct OPTION is (b) void |
|
| 45. |
Find the odd one out.(a) std::vector(b) std::vector(c) std::vector(d) std::vectorThe question was posed to me in an internship interview.My query is from Booleans topic in section Types, Pointers, Arrays & Structures in C++ of C++ |
|
Answer» Right answer is (d) std::VECTOR |
|
| 46. |
Which value can we not assign to reference?(a) integer(b) floating(c) unsigned(d) nullI had been asked this question in final exam.This question is from References in portion Types, Pointers, Arrays & Structures in C++ of C++ |
|
Answer» The correct choice is (d) NULL |
|
| 47. |
When a language has the capability to produce new data type mean, it can be called as(a) overloaded(b) extensible(c) encapsulated(d) reprehensibleThis question was posed to me during an online exam.The question is from Types in portion Types, Pointers, Arrays & Structures in C++ of C++ |
|
Answer» Right CHOICE is (b) EXTENSIBLE |
|
| 48. |
Which of the following is illegal?(a) int *ip;(b) string s, *sp = 0;(c) int i; double* dp = &i;(d) int *pi = 0;I have been asked this question in an international level competition.The above asked question is from Pointers in chapter Types, Pointers, Arrays & Structures in C++ of C++ |
|
Answer» Correct ANSWER is (c) INT i; DOUBLE* DP = &i; |
|
| 49. |
______________ have the return type void.(a) all functions(b) constructors(c) destructors(d) none of the mentionedI have been asked this question during an interview.This interesting question is from Void in division Types, Pointers, Arrays & Structures in C++ of C++ |
|
Answer» The correct OPTION is (d) none of the mentioned |
|
| 50. |
Size of C++ objects are expressed in terms of multiples of the size of a ____ and the size of a char is _______(a) char, 1(b) int, 1(c) float, 8(d) char, 4The question was posed to me in semester exam.I'd like to ask this question from Sizes in portion Types, Pointers, Arrays & Structures in C++ of C++ |
|
Answer» Right OPTION is (a) char, 1 |
|