<<
Home , C99

-questions

1. C99 standard guarantees uniqueness of ______characters for internal names. a) 31 b) 63 c) 12 ) 14

2. C99 standard guarantees uniqueness of ______characters for external names. a) 31 b) 6 c) 12 d) 14

3. Which of the following is not a valid variable name declaration? a) int __a3; b) int __3a; c) int __A3; d) None of the mentioned 4. Variable name resolution (number of significant characters for the uniqueness of variable) depends on ______a) Compiler and linker implementations b) Assemblers and loaders implementations c) C language d) None of the mentioned

5. What will be the output of the following C code? #include int main() { int a[5] = {1, 2, 3, 4, 5}; int i; for (i = 0; i < 5; i++) if ((char)a[i] == '5') printf("%d\n", a[i]); else printf("FAIL\n"); } a) The compiler will flag an error b) The program will compile and print the output 5 c) The program will compile and print the ASCII value of 5 d) The program will compile and print FAIL for 5 times

6. The format identifier ‘%i’ is also used for _____ . a) char b) int c) float d) double

7. What will be the output of the following C code? #include int main() { signed char chr; chr = 128; printf("%d\n", chr); return 0; } a) 128 b) -128 c) Depends on the compiler d) None of the mentioned 8. enum types are processed by ______a) Compiler b) Preprocessor c) Linker d) Assembler

9. What will be the output of the following C code? #include int main() { const int p; p = 4; printf("p is %d", p); return 0; } a) p is 4 b) Compile time error c) Run time error d) p is followed by a garbage value 10 Which of the following statement is false? a) Constant variables need not be defined as they are declared and can be defined later b) Global constant variables are initialized to zero c) const keyword is used to define constant values d) You cannot reassign a value to a constant variable

11.What will be the output of the following C code? #include int main() { const int i = 10; int *ptr = &i; *ptr = 20; printf("%d\n", i); return 0; } a) Compile time error b) Compile time warning and printf displays 20 c) Undefined behaviour d) 10 12. Which of the following declaration is not supported by C? a) String str; b) char *str; c) float str = 3e2; d) Both String str; & float str = 3e2;

13. What will be the output of the following C code? #include int main() { int i = 3; int l = i / -2; int k = i % -2; printf("%d %d\n", l, k); return 0; } a) Compile time error b) -1 1 c) 1 -1 d) Implementation defined

14. What will be the final value of x in the following C code? #include void main() { int x = 5 * 9 / 3 + 9; } a) 3.75 b) Depends on compiler c) 24 d) 3

15. In which stage the following code #include gets replaced by the contents of the file stdio.h

A. During editing

B. During linking

C. During execution

D. During preprocessing

16. What will happen if in a C program you assign a value to an array element whose subscript exceeds the size of array?

A. The element will be set to 0. B. The compiler would report an error.

C. The program may crash if some important data gets overwritten.

D. The array size would appropriately grow.

17. What does the following declaration mean? int (*ptr)[10];

A. ptr is array of pointers to 10 integers

B. ptr is a pointer to an array of 10 integers

C. ptr is an array of 10 integers

D. ptr is an pointer to array

18. In C, if you pass an array as an argument to a function, what actually gets passed?

A. Value of elements in array

B. First element of the array

C. Base address of the array

D. Address of the last element of array

19. How will you free the allocated memory ?

A. remove(var-name);

B. free(var-name);

C. delete(var-name);

D. dalloc(var-name);

20. What is the similarity between a structure, union and enumeration?

A. All of them let you define new values

B. All of them let you define new data types

C. All of them let you define new pointers

D. All of them let you define new structures

21. What will be the output of the program ? #include int main() { union a { int i; char ch[2]; }; union a u; u.ch[0]=3; u.ch[1]=2; printf("%d, %d, %d\n", u.ch[0], u.ch[1], u.i); return 0; }

A. 3, 2, 515

B. 515, 2, 3

C. 3, 2, 5

D. 515, 515, 4

22. What will be the output of the program ? #include int main() { struct value { int bit1:1; int bit3:4; int bit4:4; }bit={1, 2, 13};

printf("%d, %d, %d\n", bit.bit1, bit.bit3, bit.bit4); return 0; }

A. 1, 2, 13

B. 1, 4, 4

C. -1, 2, -3

D. -1, -2, -13

23. Point out the error in the program? struct emp { int ecode; struct emp *e; };

A. Error: in structure declaration

B. Linker Error

C. No Error

D. None of above

24. Point out the error in the program? struct data mystruct; struct data { int x; mystruct *b; };

A. Error: in structure declaration

B. Linker Error

C. No Error

D. None of above

25. Which of the following statements correct about the below program? #include int main() { struct emp { char name[25]; int age; float sal; }; struct emp e[2]; int i=0; for(i=0; i<2; i++) scanf("%s %d %f", e[i].name, &e[i].age, &e[i].sal);

for(i=0; i<2; i++) scanf("%s %d %f", e[i].name, e[i].age, e[i].sal); return 0; }

A. Error: scanf() function cannot be used for structures elements.

B. The code runs successfully.

C. Error: Floating point formats not linked Abnormal program termination.

D. Error: structure variable must be initialized.

26.

If the two strings are identical, then strcmp() function returns

A. -1

B. 1

C. 0

D. Yes

27. The function used to find the last occurrence of a character in a string is

A. strnstr()

B. laststr()

C. strrchr()

D. strstr()

28.

What will be the output of the program ? #include #include int main() { char str1[20] = "Hello", str2[20] = " World"; printf("%s\n", strcpy(str2, strcat(str1, str2))); return 0; } A. Hello

B. World

C. Hello World

D. WorldHello

29.

What will be the output of the program ? #include int main() { char p[] = "%d\n"; p[1] = 'c'; printf(p, 65); return 0; }

A. A

B. a

C. c

D. 65

30. What will be the output of the program ? #include #include int main() { printf("%d\n", strlen("123456")); return 0; }

A. 6

B. 12

C. 7

D. 2

31. Which of the following statements are correct about the below declarations? char *p = "Sanjay"; char a[] = "Sanjay"; 1: There is no difference in the declarations and both serve the same purpose. 2: p is a non-const pointer pointing to a non-const string, whereas a is a const pointer pointing to a non-const pointer. 3: The pointer p can be modified to point to another string, whereas the individual characters within array a can be changed. 4: In both cases the '\0' will be added at the end of the string "Sanjay".

A. 1, 2

B. 2, 3, 4

C. 3, 4

D. 2, 3

32. Will the program compile successfully? #include int main() { char a[] = "India"; char *p = "BIX"; a = "BIX"; p = "India"; printf("%s %s\n", a, p); return 0; }

A. Yes

B. No

33.

The keyword used to transfer control from a function back to the calling function is

A. switch

B. goto

C. go back

D. return

34. What will be the output of the program? #include void fun(int*, int*); int main() { int i=5, j=2; fun(&i, &j); printf("%d, %d", i, j); return 0; } void fun(int *i, int *j) { *i = *i**i; *j = *j**j; }

A. 5, 2

B. 10, 4

C. 2, 5

D. 25, 4

35. Which of the following statements are correct about the program? #include int main() { printf("%p\n", main()); return 0; }

A. It prints garbage values infinitely

B. Runs infinitely without printing anything

C. Error: main() cannot be called inside printf()

D. No Error and print nothing

36. Which of the following statements are correct about the function? long fun(int num) { int i; long f=1; for(i=1; i<=num; i++) f = f * i; return f; }

A. The function calculates the value of 1 raised to power num.

B. The function calculates the square root of an integer

C. The function calculates the factorial value of an integer

D. None of above

37. Which of the following statements are correct about the program? #include int main() { printf("%p\n", main()); return 0; }

A. It prints garbage values infinitely

B. Runs infinitely without printing anything

C. Error: main() cannot be called inside printf()

D. No Error and print nothing

38. Which of the following statements are correct about the function? long fun(int num) { int i; long f=1; for(i=1; i<=num; i++) f = f * i; return f; }

A. The function calculates the value of 1 raised to power num.

B. The function calculates the square root of an integer

C. The function calculates the factorial value of an integer

D. None of above

39.

Will the following functions work? int f1(int a, int b) { return ( f2(20) ); } int f2(int a) { return (a*a); }

A. Yes

B. No

40. How many times the while loop will get executed if a short int is 2 byte wide? #include int main() { int j=1; while(j <= 255) { printf("%c %d\n", j, j); j++; } return 0; }

A. Infinite times

B. 255 times

C. 256 times

D. 254 times

41. Which of the following is not logical operator?

A. &

B. &&

C. ||

D. !

42. Which of the following cannot be checked in a switch-case statement? A. Character

B. Integer

C. Float

D. enum

43. What will be the output of the program? #include int main() { int i=0; for(; i<=5; i++); printf("%d", i); return 0; }

A. 0, 1, 2, 3, 4, 5

B. 5

C. 1, 2, 3, 4

D. 6

44. What will be the output of the program? #include int main() { char str[]="C-program"; int a = 5; printf(a >10?"Ps\n":"%s\n", str); return 0; }

A. C-program

B. Ps

C. Error

D. None of above

45. What will be the output of the program? #include int main() { unsigned int i = 65535; /* Assume 2 byte integer*/ while(i++ != 0) printf("%d",++i); printf("\n"); return 0; }

A. Infinite loop

B. 0 1 2 ... 65535

C. 0 1 2 ... 32767 - 32766 -32765 -1 0

D. No output

46. What will be the output of the program? #include int main() { int x = 3; float y = 3.0; if(x == y) printf("x and y are equal"); else printf("x and y are not equal"); return 0; }

A. x and y are equal

B. x and y are not equal

C. Unpredictable

D. No output

47. What will be the output of the program, if a short int is 2 bytes wide? #include int main() { short int i = 0; for(i<=5 && i>=-1; ++i; i>0) printf("%u,", i); return 0; } A. 1 ... 65535

B. Expression syntax error

C. No output

D. 0, 1, 2, 3, 4, 5

48. What will be the output of the program? #include int main() { char ch; if(ch = printf("")) printf("It matters\n"); else printf("It doesn't matters\n"); return 0; }

A. It matters

B. It doesn't matters

C. matters

D. No output

49. What will be the output of the program ? #include int main() { int a[5] = {5, 1, 15, 20, 25}; int i, j, m; i = ++a[1]; j = a[1]++; m = a[i++]; printf("%d, %d, %d", i, j, m); return 0; }

A. 2, 1, 15

B. 1, 2, 5

C. 3, 2, 15 D. 2, 3, 20

50. What will be the output of the program ? #include int main() { void fun(int, int[]); int arr[] = {1, 2, 3, 4}; int i; fun(4, arr); for(i=0; i<4; i++) printf("%d,", arr[i]); return 0; } void fun(int n, int arr[]) { int *p=0; int i=0; while(i++ < n) p = &arr[i]; *p=0; }

A. 2, 3, 4, 5

B. 1, 2, 3, 4

C. 0, 1, 2, 3

D. 3, 2, 1 0

Answers 1. C 12. A 2. A 13. B 3. D 14. C 4. A 15. D 5. D 16. C 6. B 17. B 7. B 18. C 8. A 19. B 9. B 20. B 10. A 21. A 11. B 22. C 23. C 24. C 25. C 26. C 27. C 28. C 29. A 30. A 31. B 32. B 33. D 34. D 35. B 36. C 37. B 38. C 39. A 40. B 41. A 42. C 43. D 44. A 45. A 46. A 47. A 48. B 49. C 50. B

Test-II C++ Questions 1. Which of the following is the correct syntax of including a user defined header files in C++? a) #include b) #include c) #include “userdefined” d) #include [userdefined] 2. Which of the following is a correct identifier in C++? a) 7var_name b) 7VARNAME c) VAR_1234 d) $var_name 3. Which of the following is called address operator? a) * b) & c) _ d) % 4. Which of the following is used for comments in C++? a) // comment b) /* comment */ c) both // comment or /* comment */ d) // comment */ 5. What are the actual parameters in C++? a) Parameters with which functions are called b) Parameters which are used in the definition of a function c) Variables other than passed parameters in a function d) Variables that are never used in the function 6. What are the formal parameters in C++? a) Parameters with which functions are called b) Parameters which are used in the definition of the function c) Variables other than passed parameters in a function d) Variables that are never used in the function 7. Which function is used to read a single character from the console in C++? a) cin.get(ch) b) getline(ch) c) read(ch) d) scanf(ch) 8. Which function is used to write a single character to console in C++? a) cout.put(ch) b) cout.putline(ch) c) write(ch) d) printf(ch) 9. What are the escape sequences? a) Set of characters that convey special meaning in a program b) Set of characters that whose use are avoided in C++ programs c) Set of characters that are used in the name of the main function of the program d) Set of characters that are avoided in cout statements 10. Which of the following escape sequence represents carriage return? a) \r b) \n c) \n\r d) \c 11. Who created C++? a) Bjarne Stroustrup b) Dennis Ritchie c) Ken Thompson d) Brian Kernighan 12. A language which has the capability to generate new data types are called ______a) Extensible b) Overloaded c) Encapsulated d) Reprehensible 13. Wrapping data and its related functionality into a single entity is known as ______a) Abstraction b) Encapsulation c) Polymorphism d) Modularity 14. How structures and classes in C++ differ? a) In Structures, members are public by default whereas, in Classes, they are private by default b) In Structures, members are private by default whereas, in Classes, they are public by default c) Structures by default hide every member whereas classes do not d) Structures cannot have private members whereas classes can have 15. What does polymorphism in OOPs mean? a) Concept of allowing overiding of functions b) Concept of hiding data c) Concept of keeping things in differnt modules/files d) Concept of wrapping things into a single unit 16. Which concept allows you to reuse the written code? a) Encapsulation b) Abstraction c) Inheritance d) Polymorphism 17. Which of the following shows multiple inheritances? a) A->B->C b) A->B; A->C c) A,B->C d) B->A 18. C++ is ______a) procedural programming language b) object oriented programming language c) functional programming language d) both procedural and object oriented programming language 19. What does modularity mean? a) Hiding part of program b) Subdividing program into small independent parts c) Overriding parts of program d) Wrapping things into single unit 20. Which of the following feature of OOPs is not used in the following C++ code? class A { int i; public: void print(){cout<<"hello"<

class B: public A { int j; public: void assign(int a){j = a;} } a) Abstraction b) Encapsulation c) Inheritance d) Polymorphism 21. Which of the following is not a fundamental type is not present in C but present in C++? a) int b) float c) bool d) void 22. Which of the following is an -controlled loop? a) for b) while c) do-while d) all of the mentioned 23. Which of the following is an entry-controlled loop? a) for b) while c) do-while d) both while and for 24. What is dynamic binding? a) The process of linking the actual code with a procedural call during run-time b) The process of linking the actual code with a procedural call during compile-time c) The process of linking the actual code with a procedural call at any-time d) All of the mentioned 25. What is name mangling in C++? a) The process of adding more information to a function name so that it can be distinguished from other functions by the compiler b) The process of making common names for all the function of C++ program for better use c) The process of changing the names of variable d) The process of declaring variables of different types 26. What will be the output of the following program in both C and C++? #include int main(int argc, char const *argv[]) { printf("%d\n", (int)('a')); return 0; } a) Output in C is 1 and in C++ is 4 b) Output in C is 4 and in C++ is 1 c) Output in C is 1 and in C++ is 1 d) Output in C is 4 and in C++ is 4

27. What will be the output of the following C++ code? #include int main(int argc, char const *argv[]) { char a = 'a'; printf("%d\n", (int)sizeof(a)); return 0; } a) Output in C is 1 and in C++ is 4 b) Output in C is 4 and in C++ is 1 c) Output in C is 1 and in C++ is 1 d) Output in C is 4 and in C++ is 4 28. Which of the following syntax for declaring a variable of struct STRUCT can be used in both C and C++? a) struct STRUCT S; b) STRUCT S; c) Both struct STRUCT S; and STRUCT S; d) Both C and C++ have different syntax 29. Which operator is having the right to left associativity in the following? a) Array subscripting b) Function call c) Addition and subtraction d) Type cast 30. What is this operator called ?:? a) conditional b) relational c) casting operator d) unrelational

What will be the output of the following C++ code? 1. #include 2. using std; 3. int main() 4. { 5. int a; 6. a = 5 + 3 * 5; 7. cout << a; 8. return 0; 9. } a) 35 b) 20 c) 25 d) 30 31. The switch statement is also called as? a) choosing structure b) selective structure c) certain structure d) bitwise structure 32. What will be the output of the following C++ code?

1. #include 2. using namespace std; 3. int main () 4. { 5. int n; 6. for (n = 5; n > 0; n--) 7. { 8. cout << n; 9. if (n == 3) 10. break; 11. } 12. return 0; 13. } a) 543 b) 54 c) 5432 d) 53 33. How many types of loops are there in C++? a) 4 b) 2 c) 3 d) 1 34. What is an ? a) A function that is expanded at each call during execution b) A function that is called during compile time c) A function that is not checked for syntax errors d) A function that is not checked for semantic analysis 35. Where should default parameters appear in a ? a) To the rightmost side of the parameter list b) To the leftmost side of the parameter list c) Anywhere inside the parameter list d) Middle of the parameter list 36. If an argument from the parameter list of a function is defined constant then ______a) It can be modified inside the function b) It cannot be modified inside the function c) Error occurs d) Segmentation fault 37. In which of the following we cannot overload the function? a) return function b) caller c) called function d) main function 38. Function overloading is also similar to which of the following? a) operator overloading b) constructor overloading c) destructor overloading d) function overloading 39. What will be the output of the following C++ code? 1. #include 2. using namespace std; 3. int Add(int X, int Y, int Z) 4. { 5. return X + Y; 6. } 7. double Add(double X, double Y, double Z) 8. { 9. return X + Y; 10. } 11. int main() 12. { 13. cout << Add(5, 6); 14. cout << Add(5.5, 6.6); 15. return 0; 16. } a) 11 12.1 b) 12.1 11 c) 11 12 d) compile time error 40. Which keyword is used to check exception in the block of code? a) catch b) throw c) try d) handlers 41. What will be the output of the following C++ code?

1. #include 2. using namespace std; 3. int main() 4. { 5. int age = 0; 6. try 7. { 8. if (age < 0) 9. { 10. throw "Positive Number Required"; 11. } 12. cout << age; 13. } 14. catch(const char *Message) 15. { 16. cout << "Error: " << Message; 17. } 18. return 0; 19. } a) 0 b) error:Positive Number Required c) compile time error d) runtime error 42. What will we not do with function pointers? a) allocation of memory b) deallocation of memory c) both allocation & deallocation of memory d) finds memory status 43. What does a class in C++ holds? a) data b) functions c) both data & functions d) arrays 44. Which of the following is a valid class declaration? a) class A { int x; }; b) class B { } c) public class A { } d) object A { int x; }; 45. The data members and functions of a class in C++ are by default ______a) protected b) private c) public d) public & protected 46. Constructors are used to ______a) initialize the objects b) construct the data members c) both initialize the objects & construct the data members d) delete the objects 47. When struct is used instead of the keyword class means, what will happen in the program? a) access is public by default b) access is private by default c) access is protected by default d) access is denied

48. What will be the output of the following C++ code? #include #include using namespace std; class Box { int capacity; public: Box(int cap){ capacity = cap; }

friend void show(); };

void show() { Box b(10); cout<<"Value of capacity is: "<

int main(int argc, char const *argv[]) { show(); return 0; } a) Value of capacity is: 10 b) Value of capacity is: 100 c) Error d) Segmentation fault

49. How many member functions are there in this C++ class excluding constructors and destructors? class Box { int capacity; public: void print(); friend void show(); bool compare(); friend bool lost(); }; a) 1 b) 2 c) 3 d) 4 50. Which of the following is the default mode of the opening using the ofstream class? a) ios::in b) ios::out c) ios::app d) ios::trunc

Answers 1. C 2. C 3. B 4. C 5. A 6. B 7. A 8. A 9. A 10. A 11. A 12. A 13. B 14. A 15. A 16. C 17. C 18. D 19. B 20. D 21. C 22. C 23. D 24. A 25. A 26. C 27. A 28. D 29. A 30. B 31. B 32. A 33. A 34. A 35. A 36. B 37. A 38. B 39. D 40. C 41. A 42. C 43. C 44. A 45. B 46. A 47. A 48. A 49. B 50. B

Artificial Intelligence 1. What is the term used for describing the judgmental or commonsense part of problem solving?

A. Heuristic

B. Critical

C. Value based

D. Analytical

E. None of the above

2.

What stage of the manufacturing process has been described as "the mapping of function onto form"?

A. Design

B. Distribution

C. project management

D. field service

E. None of the above

3. Which kind of planning consists of successive representations of different levels of a plan?

A. hierarchical planning

B. non-hierarchical planning

C. All of the above

D. project planning E. None of the above

4.

What was originally called the "imitation game" by its creator?

A. The Turing Test

B. LISP

C. The Logic Theorist

D. Cybernetics

E. None of the above

5. Decision support programs are designed to help managers make:

A. budget projections

B. visual presentations

C. business decisions

D. vacation schedules

E. None of the above

6.

PROLOG is an AI programming language which solves problems with a form of symbolic logic known as predicate calculus. It was developed in 1972 at the University of Marseilles by a team of specialists. Can you name the person who headed this team?

A. Alain Colmerauer

B. Nicklaus Wirth

C. Seymour Papert

D. John McCarthy

E. None of the above

7. Programming a robot by physically moving it through the trajectory you want it to follow is called:

A. contact sensing control B. continuous-path control

C. robot vision control

D. pick-and-place control

E. None of the above

8.

To invoke the LISP system, you must enter

A. AI

B. LISP

C. CL (Common Lisp)

D. both b and c

E. None of the above

9.

DEC advertises that it helped to create "the world's first expert system routinely used in an industrial environment," called XCON or:

A. PDP-11

B. Rl

C. VAX

D. MAGNOM

E. None of the above

10.

Prior to the invention of time sharing, the prevalent method of computer access was:

A. batch processing

B. telecommunication

C. remote access

D. All of the above

E. None of the above

11. The Strategic Computing Program is a project of the:

A. Defense Advanced Research Projects Agency

B. National Science Foundation

C. Jet Propulsion Laboratory

D. All of the above

E. None of the above

12. Seymour Papert of the MIT AI lab created a programming environment for children called:

A. BASIC

B. LOGO

C. MYCIN

D. FORTRAN

E. None of the above

13. The original LISP machines produced by both LMI and Symbolics were based on research performed at:

A. CMU

B. MIT

C. Stanford University

D. RAMD

E. None of the above

14.

In LISP, the addition 3 + 2 is entered as

A. 3 + 2

B. 3 add 2

C. 3 + 2 =

D. (+ 3 2)

E. None of the above

15. Weak AI is

A. the embodiment of human intellectual capabilities within a computer.

a set of computer programs that produce output that would be considered to reflect

B. intelligence if it were generated by humans.

the study of mental faculties through the use of mental models implemented on a

C. computer.

D. All of the above

E. None of the above

16. In LISP, the function assigns the symbol x to y is

A. (setq y x)

B. (set y = 'x')

C. (setq y = 'x')

D. (setq y 'x')

E. None of the above

17.

In LISP, the function returns t if is a CONS cell and nil otherwise:

A. (cons )

B. (consp )

C. (eq )

D. (cous = )

E. None of the above

18. In a rule-based system, procedural domain knowledge is in the form of:

A. production rules

B. rule interpreters

C. meta-rules D. control rules

E. None of the above

19. If a robot can alter its own trajectory in response to external conditions, it is considered to be:

A. intelligent

B. mobile

C. open loop

D. non-servo

E. None of the above

20. One of the leading American robotics centers is the Robotics Institute located at:

A. CMU

B. MIT

C. RAND

D. SRI

E. None of the above

21. In LISP, the function returns the first element of a list Is

A. set

B. car

C. first

D. second

E. None of the above

22. Nils Nilsson headed a team at SRI that created a mobile robot named:

A. Robitics

B. Dedalus

C. Shakey D. Vax

E. None of the above

23.

An AI technique that allows computers to understand associations and relationships between objects and events is called:

A. heuristic processing

B. cognitive science

C. relative symbolism

D. pattern matching

E. None of the above

24. The new organization established to implement the Fifth Generation Project is called:

A. ICOT (Institute for New Generation Computer Technology)

B. MITI (Ministry of International Trade and Industry)

C. MCC (Microelectronics and Computer Technology Corporation)

D. SCP (Stategic Computing Program)

E. None of the above

25.

The field that investigates the mechanics of human intelligence is:

A. history

B. cognitive science

C. psychology

D. sociology

E. None of the above

26.

A problem is first connected to its proposed solution during the _____ stage.

A. conceptualization B. identification

C. formalization

D. implementation.

E. testing

27. What is the name of the computer program that simulates the thought processes of human beings?

A. Human logic

B. Expert reason

C. Expert system

D. Personal information

E. None of the above

28. What is the name of the computer program that contains the distilled knowledge of an expert?

A. Data base management system

B. Management information System

C. Expert system

D. Artificial intelligence

E. None of the above

29. Claude Shannon described the operation of electronic switching circuits with a system of mathematical logic called:

A. LISP

B. XLISP

C. Boolean algebra

D. neural networking

E. None of the above

30. A computer program that contains expertise in a particular domain is called an: A. intelligent planner

B. automatic processor

C. expert system

D. operational symbolizer

E. None of the above

31.

A series of AI systems developed by Pat Langley to explore the role of heuristics in scientific discovery.

A. RAMD

B. BACON

C. MIT

D. DU

E. None of the above

32.

A.M. turing developed a technique for determining whether a computer could or could not demonstrate the artificial Intelligence,, Presently, this technique is called

A. Turing Test

B. Algorithm

C. Boolean Algebra

D. Logarithm

E. None of the above

33. A Personal Consultant knowledge base contain information in the form of:

A. Parameters

B. Contexts

C. production rules

D. All of the above E. None of the above

34. Which approach to speech recognition avoids the problem caused by the variation in speech patterns among different speakers?

A. Continuous speech recognition

B. Isolated word recognition

C. Connected word recognition

D. Speaker-dependent recognition

E. None of the above

35. Which of the following, is a component of an expert system?

A. inference engine

B. knowledge base

C. user interface

D. All of the above

E. None of the above

36. The characteristics of the computer system capable of thinking, reasoning and learning is known is

A. machine intelligence

B. human intelligence

C. artificial intelligence

D. virtual intelligence

E. None of the above

37. What part of the manufacturing process relate to each stage of the process and to the process as a whole?

A. field service

B. design C. distribution

D. project management

E. None of the above

38.

The area of AI that investigates methods of facilitating communication between people and computers is:

A. natural language processing

B. symbolic processing

C. decision support

D. robotics

E. None of the above

39.

In the 16th century, a Czech rabbi reportedly created a living clay man whose name has become a synonym for an artificial human. The clay man's name was:

A. Frankenstein

B. Golem

C. Paracelsus

D. Hal

E. None of the above

40. For speech understanding systems to gain widespread acceptance in office automation, they must feature:

A. speaker independence

B. speaker dependence

C. isolated word recognition

D. All of the above

E. None of the above

41.

The primary interactive method of communication used by humans is:

A. reading

B. writing

C. speaking

D. All of the above

E. None of the above

42.

Elementary linguistic units which are smaller than words are:

A. allophones

B. phonemes

C. syllables

D. All of the above

E. None of the above

43.

A mouse device may be:

A. electro-chemical

B. mechanical

C. optical

D. both b and c

E. None of the above

44. The Al researcher who co-authored both the Handbook of Artificial Intelligence and The Fifth Generation is:

A. Bruce Lee

B. Randy Davis

C. Ed Feigenbaum

D. Mark Fox E. None of the above

45. Which of the following is being investigated as a means of automating the creation of a knowledge base?

A. automatic knowledge acquisition

B. simpler tools

C. discovery of new concepts

D. All of the above

E. None of the above

46. The CAI (Computer-Assisted Instruction) technique based on programmed instruction is:

A. frame-based CAI

B. generative CAI

C. problem-solving CAI

D. intelligent CAI

E. None of the above

47.

A robot's "arm" is also known as its:

A. end effector

B. actuator

C. manipulator

D. servomechanism

E. None of the above

48. KEE is a product of:

A. Teknowledge

B. IntelliCorpn

C. Texas Instruments D. Tech knowledge

E. None of the above

49. The symbols used in describing the syntax of a programming language are

A. 0

B. {}

C. ""

D. <>

E. None of the above

50. People overcome natural language problems by:

A. grouping attributes into frames

B. understanding ideas in context

C. identifying with familiar situations

D. both (b) and (c)

E. None of the above

Answers 1. A 17. B 2. A 18. A 3. A 19. A 4. A 20. A 5. C 21. B 6. A 22. C 7. B 23. D 8. D 24. A 9. B 25. B 10. A 26. C 11. A 27. C 12. B 28. C 13. B 29. C 14. D 30. C 15. C 31. B 16. D 32. A 33. D 34. D 35. D 36. C 37. D 38. A 39. B 40. A 41. C 42. D 43. D 44. C 45. D 46. A 47. C 48. B 49. D 50. D

Test-IV

Machine Learning 1) Which of the following statement is true in following case?

A) Feature F1 is an example of nominal variable. B) Feature F1 is an example of ordinal variable. C) It doesn’t belong to any of the above category. D) Both of these

2) Which of the following is an example of a deterministic algorithm?

A) PCA

B) K-Means

C) None of the above

3) [True or False] A Pearson correlation between two variables is zero but, still their values can still be related to each other.

A) TRUE

B) FALSE

4) Which of the following statement(s) is / are true for Gradient Decent (GD) and Stochastic Gradient Decent (SGD)?

1. In GD and SGD, you update a set of parameters in an iterative manner to minimize the error function. 2. In SGD, you have to run through all the samples in your training set for a single update of a parameter in each iteration. 3. In GD, you either use the entire data or a subset of training data to update a parameter in each iteration. A) Only 1

B) Only 2

C) Only 3

D) 1 and 2

E) 2 and 3

F) 1,2 and 3

5) Which of the following hyper parameter(s), when increased may cause random forest to over fit the data?

1. Number of Trees 2. Depth of Tree 3. Learning Rate

A) Only 1

B) Only 2

C) Only 3

D) 1 and 2

E) 2 and 3

F) 1,2 and 3

6) Imagine, you are working with “Analytics Vidhya” and you want to develop a machine learning algorithm which predicts the number of views on the articles.

Your analysis is based on features like author name, number of articles written by the same author on Analytics Vidhya in past and a few other features. Which of the following evaluation metric would you choose in that case?

1. Mean Square Error 2. Accuracy 3. F1 Score

A) Only 1 B) Only 2

C) Only 3

D) 1 and 3

E) 2 and 3

F) 1 and 2

7) Given below are three images (1,2,3). Which of the following option is correct for these images?

A) B)

C) A) 1 is tanh, 2 is ReLU and 3 is SIGMOID activation functions.

B) 1 is SIGMOID, 2 is ReLU and 3 is tanh activation functions.

C) 1 is ReLU, 2 is tanh and 3 is SIGMOID activation functions.

D) 1 is tanh, 2 is SIGMOID and 3 is ReLU activation functions.

8) Below are the 8 actual values of target variable in the train file. [0,0,0,1,1,1,1,1]

What is the entropy of the target variable?

A) -(5/8 log(5/8) + 3/8 log(3/8))

B) 5/8 log(5/8) + 3/8 log(3/8)

C) 3/8 log(5/8) + 5/8 log(3/8)

D) 5/8 log(3/8) – 3/8 log(5/8)

9) Let’s say, you are working with categorical feature(s) and you have not looked at the distribution of the categorical variable in the test data.

You want to apply one hot encoding (OHE) on the categorical feature(s). What challenges you may face if you have applied OHE on a categorical variable of train dataset?

A) All categories of categorical variable are not present in the test dataset.

B) Frequency distribution of categories is different in train as compared to the test dataset.

C) Train and Test always have same distribution.

D) Both A and B

E) None of these

10) Let’s say, you are using activation function X in hidden layers of neural network. At a particular neuron for any given input, you get the output as “-0.0001”. Which of the following activation function could X represent?

A) ReLU

B) tanh

C) SIGMOID

D) None of these

11) [True or False] LogLoss evaluation metric can have negative values.

A) TRUE B) FALSE 12) Which of the following statements is/are true about “Type-1” and “Type-2” errors?

1. Type1 is known as false positive and Type2 is known as false negative. 2. Type1 is known as false negative and Type2 is known as false positive. 3. Type1 error occurs when we reject a null hypothesis when it is actually true.

A) Only 1

B) Only 2

C) Only 3

D) 1 and 2

E) 1 and 3

F) 2 and 3

13) Which of the following is/are one of the important step(s) to pre-process the text in NLP based projects?

1. Stemming 2. Stop word removal 3. Object Standardization

A) 1 and 2

B) 1 and 3

C) 2 and 3

D) 1,2 and 3

14) Suppose you want to project high dimensional data into lower dimensions. The two most famous dimensionality reduction algorithms used here are PCA and t-SNE. Let’s say you have applied both algorithms respectively on data “X” and you got the datasets “X_projected_PCA” , “X_projected_tSNE”.

Which of the following statements is true for “X_projected_PCA” & “X_projected_tSNE” ?

A) X_projected_PCA will have interpretation in the nearest neighbour space.

B) X_projected_tSNE will have interpretation in the nearest neighbour space. C) Both will have interpretation in the nearest neighbour space.

D) None of them will have interpretation in the nearest neighbour space.

15) Adding a non-important feature to a linear regression model may result in.

1. Increase in R-square 2. Decrease in R-square

A) Only 1 is correct

B) Only 2 is correct

C) Either 1 or 2

D) None of these

16) Suppose, you are given three variables X, Y and Z. The Pearson correlation coefficients for (X, Y), (Y, Z) and (X, Z) are C1, C2 & C3 respectively.

Now, you have added 2 in all values of X (i.enew values become X+2), subtracted 2 from all values of Y (i.e. new values are Y-2) and Z remains the same. The new coefficients for (X,Y), (Y,Z) and (X,Z) are given by D1, D2 & D3 respectively. How do the values of D1, D2 & D3 relate to C1, C2 & C3?

A) D1= C1, D2 < C2, D3 > C3

B) D1 = C1, D2 > C2, D3 > C3

C) D1 = C1, D2 > C2, D3 < C3

D) D1 = C1, D2 < C2, D3 < C3

E) D1 = C1, D2 = C2, D3 = C3

F) Cannot be determined

17) Imagine, you are solving a classification problems with highly imbalanced class. The majority class is observed 99% of times in the training data.

Your model has 99% accuracy after taking the predictions on test data. Which of the following is true in such a case?

1. Accuracy metric is not a good idea for imbalanced class problems. 2. Accuracy metric is a good idea for imbalanced class problems. 3. Precision and recall metrics are good for imbalanced class problems. 4. Precision and recall metrics aren’t good for imbalanced class problems.

A) 1 and 3

B) 1 and 4

C) 2 and 3

D) 2 and 4

18) In ensemble learning, you aggregate the predictions for weak learners, so that an ensemble of these models will give a better prediction than prediction of individual models.

Which of the following statements is / are true for weak learners used in ensemble model?

1. They don’t usually overfit. 2. They have high bias, so they cannot solve complex learning problems 3. They usually overfit.

A) 1 and 2

B) 1 and 3

C) 2 and 3

D) Only 1

E) Only 2

F) None of the above

19) Which of the following options is/are true for K-fold cross-validation?

1. Increase in K will result in higher time required to cross validate the result. 2. Higher values of K will result in higher confidence on the cross-validation result as compared to lower value of K. 3. If K=N, then it is called Leave one out cross validation, where N is the number of observations.

A) 1 and 2 B) 2 and 3

C) 1 and 3

D) 1,2 and 3

20) Which of the following option is true for overall execution time for 5-fold cross validation with 10 different values of “max_depth”?

A) Less than 100 seconds

B) 100 – 300 seconds

C) 300 – 600 seconds

D) More than or equal to 600 seconds

C) None of the above

D) Can’t estimate

21) In previous question, if you train the same algorithm for tuning 2 hyper parameters say “max_depth” and “learning_rate”.

You want to select the right value against “max_depth” (from given 10 depth values) and learning rate (from given 5 different learning rates). In such cases, which of the following will represent the overall time?

A) 1000-1500 second

B) 1500-3000 Second

C) More than or equal to 3000 Second

D) None of these

22) Given below is a scenario for training error TE and Validation error VE for a machine learning algorithm M1. You want to choose a hyperparameter (H) based on TE and VE.

H TE VE 1 105 90 2 200 85 3 250 96 4 105 85 5 300 100 Which value of H will you choose based on the above table?

A) 1

B) 2

C) 3

D) 4

E) 5

23) What would you do in PCA to get the same projection as SVD?

A) Transform data to zero mean

B) Transform data to zero median

C) Not possible

D) None of these

24) Suppose you are given 7 Scatter plots 1-7 (left to right) and you want to compare Pearson correlation coefficients between variables of each scatterplot.

Which of the following is in the right order?

1. 1<2<3<4 2. 1>2>3 > 4 3. 7<6<5<4 4. 7>6>5>4

A) 1 and 3 B) 2 and 3

C) 1 and 4

D) 2 and 4

25) You can evaluate the performance of a binary class classification problem using different metrics such as accuracy, log-loss, F-Score. Let’s say, you are using the log-loss function as evaluation metric.

Which of the following option is / are true for interpretation of log-loss as an evaluation metric?

1. If a classifier is confident about an incorrect classification, then log-loss will penalise it heavily. 2. For a particular observation, the classifier assigns a very small probability for the correct class then the corresponding contribution to the log-loss will be very large. 3. Lower the log-loss, the better is the model.

A) 1 and 3

B) 2 and 3

C) 1 and 2

D) 1,2 and 3

Questions 26-27 Below are five samples given in the dataset.

Note: Visual distance between the points in the image represents the actual distance. 26) Which of the following is leave-one-out cross-validation accuracy for 3-NN (3-nearest neighbor)?

A) 0

D) 0.4

C) 0.8

D) 1

27) 32) Which of the following value of K will have least leave-one-out cross validation accuracy?

A) 1NN

B) 3NN

C) 4NN

D) All have same leave one out error

28) Suppose you are given the below data and you want to apply a logistic regression model for classifying it in two given classes.

You are using logistic regression with L1 regularization.

Where C is the regularization parameter and w1 & w2 are the coefficients of x1 and x2.

Which of the following option is correct when you increase the value of C from zero to a very large value?

A) First w2 becomes zero and then w1 becomes zero

B) First w1 becomes zero and then w2 becomes zero C) Both becomes zero at the same time

D) Both cannot be zero even after very large value of C

29) Suppose we have a dataset which can be trained with 100% accuracy with help of a decision tree of depth 6. Now consider the points below and choose the option based on these points.

Note: All other hyper parameters are same and other factors are not affected.

1. Depth 4 will have high bias and low variance 2. Depth 4 will have low bias and low variance

A) Only 1

B) Only 2

C) Both 1 and 2

D) None of the above

30) Which of the following options can be used to get global minima in k-Means Algorithm?

1. Try to run algorithm for different centroid initialization 2. Adjust number of iterations 3. Find out the optimal number of clusters

A) 2 and 3

B) 1 and 3

C) 1 and 2

D) All of above

31) Imagine you are working on a project which is a binary classification problem. You trained a model on training dataset and get the below confusion matrix on validation dataset.

Based on the above confusion matrix, choose which option(s) below will give you correct predictions?

1. Accuracy is ~0.91 2. Misclassification rate is ~ 0.91 3. False positive rate is ~0.95 4. True positive rate is ~0.95

A) 1 and 3

B) 2 and 4

C) 1 and 4

D) 2 and 3

Question32-33

Imagine, you have a 28 * 28 image and you run a 3 * 3 convolution neural network on it with the input depth of 3 and output depth of 8.

Note: Stride is 1 and you are using same padding.

32) What is the dimension of output feature map when you are using the given parameters.

A) 28 width, 28 height and 8 depth

B) 13 width, 13 height and 8 depth

C) 28 width, 13 height and 8 depth

D) 13 width, 28 height and 8 depth 33) What is the dimensions of output feature map when you are using following parameters.

A) 28 width, 28 height and 8 depth

B) 13 width, 13 height and 8 depth

C) 28 width, 13 height and 8 depth

D) 13 width, 28 height and 8 depth

34) Suppose, we were plotting the visualization for different values of C (Penalty parameter) in SVM algorithm. Due to some reason, we forgot to tag the C values with visualizations. In that case, which of the following option best explains the C values for the images below (1,2,3 left to right, so C values are C1 for image1, C2 for image2 and C3 for image3 ) in case of rbf kernel.

A) C1 = C2 = C3

B) C1 > C2 > C3

C) C1 < C2 < C3

D) None of these

35) Which of the following is a widely used and effective machine learning algorithm based on the idea of bagging? a. Decision Tree b. Regression c. Classification d. Random Forest 36) To find the minimum or the maximum of a function, we set the gradient to zero because: a. The value of the gradient at extrema of a function is always zero b. Depends on the type of problem c. Both A and B d. None of the above 37)The most widely used metrics and tools to assess a classification model are: a. Confusion matrix b. Cost-sensitive accuracy c. Area under the ROC curve d. All of the above 38)Which of the following is a good test dataset characteristic? a. Large enough to yield meaningful results b. Is representative of the dataset as a whole c. Both A and B d. None of the above 39)Which of the following is a disadvantage of decision trees? a. Factor analysis b. Decision trees are robust to outliers c. Decision trees are prone to be overfit d. None of the above 40)How do you handle missing or corrupted data in a dataset? a. Drop missing rows or columns b. Replace missing values with mean/median/mode c. Assign a unique category to missing values d. All of the above - 41)What is the purpose of performing cross-validation? a. To assess the predictive performance of the models b. To judge how the trained model performs outside the sample on test data c. Both A and B 42)Why is second order differencing in time series needed? a. To remove stationarity b. To find the maxima or minima at the local point c. Both A and B - answer d. None of the above 43)When performing regression or classification, which of the following is the correct way to preprocess the data? a. Normalize the data → PCA → training b. PCA → normalize PCA output → training c. Normalize the data → PCA → normalize PCA output → training d. None of the above 44)Which of the folllowing is an example of feature extraction? a. Constructing bag of words vector from an email b. Applying PCA projects to a large high-dimensional data c. Removing stopwords in a sentence d. All of the above 45)What is pca.components_ in Sklearn? a. Set of all eigen vectors for the projection space b. Matrix of principal components c. Result of the multiplication matrix d. None of the above options 46)Which of the following is true about Naive Bayes ? a. Assumes that all the features in a dataset are equally important b. Assumes that all the features in a dataset are independent c. Both A and B d. None of the above options 47)Which of the following statements about regularization is not correct? a. Using too large a value of lambda can cause your hypothesis to underfit the data. b. Using too large a value of lambda can cause your hypothesis to overfit the data. c. Using a very large value of lambda cannot hurt the performance of your hypothesis. d. None of the above 48)How can you prevent a clustering algorithm from getting stuck in bad local optima? a. Set the same seed value for each run b. Use multiple random initializations c. Both A and B d. None of the above 49)Which of the following techniques can be used for normalization in text mining? a. Stemming b. Lemmatization c. Stop Word Removal d. Both A and B 50)In which of the following cases will K-means clustering fail to give good results? 1) Data points with outliers 2) Data points with different densities 3) Data points with nonconvex shapes a. 1 and 2 b. 2 and 3 c. 1, 2, and 3 d. 1 and 3

Answers 1. B 2. A 3. A 4. A 5. B 6. A 7. D 8. A 9. D 10. B 11. B 12. E 13. D 14. B 15. A 16. E 17. A 18. A 19. D 20. D 21. D 22. D 23. A 24. B 25. D 26. C 27. A 28. B 29. A 30. D 31. C 32. A 33. B 34. C 35. D 36. A 37. D 38. C 39. C 40. D 41. C 42. C 43. A 44. D 45. A 46. C 47. D 48. B 49. D 50. C