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. |
What does the first parameter of the main function represent?(a) Number of command line arguments(b) List of command line arguments(c) Dictionary of command line arguments(d) Stack of command line argumentsThe question was asked during an online interview.The question is from Command Line Arguments topic in section C++ Advanced of C++ |
|
Answer» The correct answer is (a) Number of command LINE arguments |
|
| 2. |
In how many ways we can capture the external variables in the lambda expression?(a) 1(b) 2(c) 3(d) 4This question was posed to me by my school principal while I was bunking the class.The question is from Lambda Expressions topic in portion C++ Advanced of C++ |
|
Answer» The CORRECT ANSWER is (c) 3 |
|
| 3. |
To use command line arguments in C++, how many parameters are passed to the main function?(a) 1(b) 2(c) 3(d) 4I have been asked this question during an interview for a job.Question is taken from Command Line Arguments topic in chapter C++ Advanced of C++ |
|
Answer» The correct answer is (b) 2 |
|
| 4. |
Which of the following operator is used to capture all the external variable by value?(a) &(b) =(c) *(d) &&I have been asked this question in unit test.I want to ask this question from Lambda Expressions in chapter C++ Advanced of C++ |
|
Answer» Correct answer is (b) = |
|
| 5. |
What is the syntax of defining lambda expression?(a) [capture clause](parameters) -> return_type { body of the function }(b) [parameters](capture clause) -> return_type { body of the function }(c) [parameters:capture clause]() -> return_type { body of the function }(d) [capture clause:parameters]() -> return_type { body of the function }I had been asked this question in an interview.My query is from Lambda Expressions topic in portion C++ Advanced of C++ |
|
Answer» Correct answer is (a) [capture CLAUSE](parameters) -> return_type { body of the FUNCTION } |
|
| 6. |
What are command line arguments?(a) Arguments passed to main() function(b) Arguments passed to any function(c) Arguments passed to class functions(d) Arguments passed to structure functionsI got this question during an interview.My question is from Command Line Arguments in section C++ Advanced of C++ |
|
Answer» Correct option is (a) ARGUMENTS passed to main() FUNCTION |
|
| 7. |
What is the correct statement about lambda expression?(a) The return type of lambda expression can be neglected in some cases(b) The return type of lambda expression must be specified in all cases(c) Lambda expression should be very large functions(d) Lambda expression is also available in CThis question was posed to me in an interview for internship.This intriguing question comes from Lambda Expressions in division C++ Advanced of C++ |
|
Answer» Correct answer is (a) The return type of lambda expression can be neglected in some cases |
|
| 8. |
What is the signature of math in function using command line arguments?(a) int main(int argc, char const *argv[]);(b) int main(int argc, char const **argv);(c) int main(int argc, char **argv);(d) all of the mentionedThis question was posed to me in examination.This interesting question is from Command Line Arguments in portion C++ Advanced of C++ |
|
Answer» Right ANSWER is (d) all of the mentioned |
|
| 9. |
Which of the following operator is used to capture all the external variable by reference?(a) &(b) =(c) *(d) &&The question was asked during an interview.This intriguing question originated from Lambda Expressions topic in portion C++ Advanced of C++ |
|
Answer» The correct option is (a) & |
|
| 10. |
What is lambda expression in C++?(a) A technique of C++ that allows us to write inline functions without a name(b) A technique of C++ that allows us to write overloaded functions(c) A technique of C++ that allows us to write functions that are called more than once(d) A technique of C++ that allows us to write functions without parametersI have been asked this question by my school principal while I was bunking the class.The query is from Lambda Expressions in section C++ Advanced of C++ |
|
Answer» Right OPTION is (a) A technique of C++ that allows us to write inline functions without a name |
|