Download converted_dataset.jsonl from Anderson1000/CS_qa: direct link, hf CLI and curl.
- Browser
- Download file 54.9 kB
-
https://huggingface.co/datasets/Anderson1000/CS_qa/resolve/main/converted_dataset.jsonl
- Command line
-
hf download hf://datasets/Anderson1000/CS_qa/converted_dataset.jsonl
-
curl -L -o converted_dataset.jsonl https://huggingface.co/datasets/Anderson1000/CS_qa/resolve/main/converted_dataset.jsonl
54.9 kB
| {"id": "local_0", "question": "What problems first inspired the introduction of types?", "choices": ["unhandled exceptions", "memory leaks", "set theory paradoxes", "reference handling"], "subject": "structuring_data", "answer": "C"} | |
| {"id": "local_1", "question": "What is a typing discipline in computer science?", "choices": ["A method to prove the absence of undesirable behaviours in computer programs based on the classification of their syntactic units and the values they assume", "A method to abstract the logic of programs away from low-level machine code, making it possible for developers to express complex behaviours in a few lines of code", "A method to annotate program units, so that programmers can write their assumptions on code like pre-conditions and post-conditions, to help them verify that their programs execute as intended", "A method to increase the speed of programs by providing the compiler with information on which parts of the program are unreachable, which are safe to remove in the compiled binary"], "subject": "structuring_data", "answer": "A"} | |
| {"id": "local_2", "question": "What is the main difference between dynamic and static typing?", "choices": ["In static typing, the value of variables can only assume values that are statically determined, while in dynamic typing variables can assume any value defined dynamically at runtime", "In static typing, code is statically linked and can only access the static memory in the stack, while in dynamic typing programs can access also dynamic memory in the heap", "In static typing operation invocation is statically determined, while in dynamic typing operation invocation works using dynamic dispatch", "In static typing, type checking happens before program execution and in dynamic typing it happens while the program executes"], "subject": "structuring_data", "answer": "D"} | |
| {"id": "local_3", "question": "What is the main difference between manifest and inferred typing?", "choices": ["Manifest typing requires every variable's value to be declared explicitly, inferred typing lets the computer decide what values to assign to variables", "Manifest typing provides guidelines for the programmer on which types are more appropriate to use, inferred typing leaves to the programmer the task of figuring out what types are more appropriate", "Manifest typing forces the programmer to use the types defined by the programming language while inferred typing lets the programmer define its own types", "Manifest typing uses annotations to define the type of variables, inferred typing employs mechanisms to deduce the type of variables based on the values they assume"], "subject": "structuring_data", "answer": "D"} | |
| {"id": "local_4", "question": "What are the inhabitants of a type?", "choices": ["First-class citizens that form the ecosystem of the type system", "Modular components of the type system that one can combine as needed", "Language constructs that let values interact with each other", "Valid values according to the definition of that type"], "subject": "structuring_data", "answer": "D"} | |
| {"id": "local_5", "question": "What are examples of basic types in programming languages?", "choices": ["Unit, Booleans, and Integers", "Any subtype of the Top type", "Arrays, Sets, and Lists", "Any type found in a Sum or Product type"], "subject": "structuring_data", "answer": "A"} | |
| {"id": "local_6", "question": "What is the main difference between the Void and Unit types?", "choices": ["Void encapsulates data while Unit makes the data directly accessible", "Functional languages need the Unit type while imperative languages need Void", "Void never carries a value while Unit always carries one", "The Unit type includes only one value while Void includes none"], "subject": "structuring_data", "answer": "D"} | |
| {"id": "local_7", "question": "What is the main difference between the Integer and Float types?", "choices": ["Integers represent whole numbers, Floats are instead part of a number, for instance, only the decimal part", "Integers represent integer numbers, Floats represent real numbers with fixed precision", "Integer values occupy less memory than Float ones", "Integers represent integer numbers, Floats represent decimals with user-defined precision"], "subject": "structuring_data", "answer": "B"} | |
| {"id": "local_8", "question": "What is the main difference between Extensional and Intensional types?", "choices": ["Extensional types define the list of their values, Intensional types define their values via inclusion predicates", "Extensional types leave their usage purpose unspecified, Intensional types carry their intended purpose", "The programmer can extend an Extensional type, Intensional types are non-extensible", "Extensional types are defined in external modules, Intensional types are defined within the program"], "subject": "structuring_data", "answer": "A"} | |
| {"id": "local_9", "question": "What is a buffer overflow, considering the Array type?", "choices": ["A situation where an Array value is used as an attack vector to access the source code of the program", "A situation where an Array value gives write access to memory regions outside its boundaries", "A situation where an Array value passes from a static to a dynamic implementation, depending on the amount of data it carries", "A situation where an Array value increases its size when the data exceeds its current capacity"], "subject": "memory_management", "answer": "B"} | |
| {"id": "local_10", "question": "What do row- and column-major order is for multidimensional Arrays?", "choices": ["A method for representing multidimensional Arrays in linear memory, either favouring proximity of values within the same row or within the same column", "A method for defining the implementation type of multidimensional Arrays, row- and column-major multidimensional Arrays are incompatible, regardless the content of their cells", "A method for saving memory and allowing faster access hinged on storing information following the order imposed either by the columns or the rows", "A method for optimising algorithms depending on whether the access to multidimensional Array cells happens following the ordering of the rows or of the columns"], "subject": "structuring_data", "answer": "A"} | |
| {"id": "local_11", "question": "What is a dope vector?", "choices": ["A method for representing multidimensional Arrays in linear memory, either favouring proximity of values within the same row or within the same column", "A method for saving memory and allowing faster access hinged on storing information following the order imposed either by the columns or the rows", "A method for defining the implementation type of multidimensional Arrays, row- and column-major multidimensional Arrays are incompatible, regardless the content of their cells", "A method for optimising algorithms depending on whether the access to multidimensional Array cells happens following the ordering of the rows or of the columns"], "subject": "structuring_data", "answer": "A"} | |
| {"id": "local_12", "question": "What is a dope vector?", "choices": ["A dope vector is a data structure that supports the implementation of dynamically-sized arrays", "A dope vector is a data structure used to implement Array values that do not suffer from buffer-overflow situations", "A dope vector is a data structure used to efficiently implement dynamic dispatch", "A dope vector is the data structure that contains the essential information of a programming language's constructs"], "subject": "structuring_data", "answer": "A"} | |
| {"id": "local_13", "question": "What is the typical language construct used to handle values of Sum types?", "choices": ["Generics, which allow users to abstract over parts of the Sum type that are not of interest and to focus on the parts they need to work on", "Exception handling, e.g., if values are of the type 'Success', then the execution proceeds as intended; contrarily, an 'Exception' value triggers the 'catch' block", "Loops, like 'for' and 'while', which are the only constructs for unfolding the values of a recursive Sum type", "Pattern matching, which allows one to structure the branches of the computation depending on the specific type of the value"], "subject": "structuring_data", "answer": "D"} | |
| {"id": "local_14", "question": "What is an important limitation of using Product types to represent a recursive type?", "choices": ["Product types add to each level of recursion increased memory usage, leading to an exponentially-large occupation of memory", "Product types cannot represent recursive types, since the syntactical definition would itself be infinite", "Product types can represent a subset of the possible recursive types, for instance they can represent linked lists but not doubly-linked lists", "Product types need special values, such as those found in reference types, to capture terminal values in recursive types"], "subject": "structuring_data", "answer": "D"} | |
| {"id": "local_15", "question": "What is duck typing?", "choices": ["Duck typing is a typing discipline that dispenses the use of types at runtime thanks to preliminary strong static checks", "Duck typing is a typing discipline where the runtime interprets the behaviour of the code depending on its context of execution", "Duck typing is a typing discipline that uses structural similarity of types to avoid type annotations", "Duck typing is a typing discipline where checks follow the interaction of the program with the values"], "subject": "structuring_data", "answer": "D"} | |
| {"id": "local_16", "question": "From a program design standpoint, what is a strong difference between nominal and structural typing?", "choices": ["Nominal typing distinguishes between types with different names but with the same structure, while these are equivalent in structural typing", "Nominal typing assigns names to types but does not specify their implementation, structural typing describes a type's implementation but leaves it unnamed", "Nominal typing supports subtyping while structure typing cannot express one such relation", "Nominal typing uses symbols to distinguish different functions, whereas all functions are the same for a structural type system"], "subject": "structuring_data", "answer": "A"} | |
| {"id": "local_17", "question": "What is the difference between type coercion and type casting?", "choices": ["Type coercion implicitly converts value types, type casting is an explicit instruction for types conversion", "Type coercion automatically arranges the representation of values in memory, type casting arranges value representation following the user's instructions", "Type coercion temporarily converts a value into one of another type, type casting permanently converts the value into the given type", "Type coercion transform values into the types defined by the user, type casting transforms the values into types defined by external modules"], "subject": "structuring_data", "answer": "A"} | |
| {"id": "local_18", "question": "What is the unification algorithm mainly used for in the context of type systems?", "choices": ["The unification algorithm is mainly used to verify if values are of the correct type", "The unification algorithm is mainly used to implement type inference", "The unification algorithm is mainly used to unify different implementations of the same types", "The unification algorithm is mainly used to solve problems of type conversion found at runtime"], "subject": "structuring_data", "answer": "B"} | |
| {"id": "local_19", "question": "What does the code fragment below prints? Assume an object-oriented language with inheritance, dynamic dispatch, and static field binding. class A { int x = 3; int f( int y ){ return y + x; } } class B extends A { int x = 1; int f( int y ){ return super .f( x ) + y; } } class C extends B { int x = 4; int f( int y ){ return super .f( y ) + x; } } B x = new C (); print ( x.f( x.x ) );", "choices": ["8", "4", "7", "9"], "subject": "object-oriented_paradigm", "answer": "D"} | |
| {"id": "local_20", "question": "Given the code fragment below, at what line a type checker that supports duck typing would raise an error? 1. type A = record { int a , int b } 2. type B = record { int a } 3. type C = record { B x , A y } 4. type D = record { A x , B y } 5. f( C a , D b ){ 6. b = a ; 7. return a.x.b; }", "choices": ["7", "6", "none of the above", "5"], "subject": "structuring_data", "answer": "C"} | |
| {"id": "local_21", "question": "In a pseudolanguage, the 'new' keyword creates a new object in the heap. The list of integers 'ListInt' occupies 1 byte, in addition to the space occupied by the contained Integers. An Integer occupies 1 byte, while a Long occupies 4 bytes. 'ListInt' provides 'add', which adds an integer to the end, and 'get', which retrieves the integer at the given position. The pseudolanguage uses pass-by-reference and a stop-and-copy type of garbage collection. The garbage collector is activated once memory usage exceeds 80% of the available memory to the collector. The heap has a total of 30 bytes of memory and is assumed to be initially empty. How many times the garbage collector is called during the execution of the following code fragment? ListInt acc = new ListInt (); acc.add( new Int ( 0 ) ); acc.add( new Int ( 1 ) ); for( int i = 2; i < 7; i ++ ){ Long e = new Long ( acc.get( i -2 ) + acc.get( i -1 ) ); if( e % 2 != 0 ){ acc . add ( new Int ( e ) ); } else { acc.add( new Int ( e + 1 ) ); }}", "choices": ["3", "1", "5", "4"], "subject": "memory_management", "answer": "D"} | |
| {"id": "local_22", "question": "Assuming to have a language that adopts the locks and keys technique. Given a generic object OBJ in the heap, we denote OBJ.lock its lock (hidden). Given a variable p containing the value of a generic pointer (on the stack or in the heap), we denote p.key its key (hidden). What are the values of respectively p.key, p.next.key after the execution of the fragment below, considering that the keys of OBJ1.lock and OBJ2.lock are respectively 42 and 24? class C { C next; } \n C p = new C(); // object OBJ1 \n { p.next = new C(); } // object OBJ2", "choices": ["24, 24", "42, 42", "42, 24", "24, 42"], "subject": "memory_management", "answer": "C"} | |
| {"id": "local_23", "question": "Assume an object-oriented programming language with nominal types and pass-by-reference. Classes A, B, and C are such that B is a subclass of A, and C is a subclass of B. In the language, the type T[] indicates an array of objects of class T with covariant writes and reads with respect to subtypes. Indicate which instructions would be marked as not correct by the type checker. void f( A a, B b, C c, A[] aa, B[] bb, C[] cc ) { c = b; // I1 a = b; // I2 c = bb[ 0 ]; // I3 aa = bb; // I4 a = aa; // I5 bb = bb; // I6 a = bb[ 0 ]; // I7 aa[ 0 ] = cc; // I8 b = bb; // I9 aa[ 0 ] = cc[ 0 ]; // I10 cc = bb; // I11 c = bb[ 0 ]; // I12 }", "choices": ["I1, I3, I5, I8, I9, I11, I12", "I2, I3, I4, I5, I7, I8, I10, I11, I12", "I2, I4, I5, I7, I8, I10, I11", "I1, I2, I3, I5, I8, I10"], "subject": "object-oriented_paradigm", "answer": "A"} | |
| {"id": "local_24", "question": "Which of the following is a programming language?", "choices": ["Adobe Illustrator", "Microsoft Word", "Photoshop", "Python"], "subject": "programming_languages", "answer": "D"} | |
| {"id": "local_25", "question": "Which programming paradigm emphasizes on writing code that is easy to read and maintain?", "choices": ["Structured programming", "Object-oriented programming", "Procedural programming", "Functional programming"], "subject": "object-oriented_paradigm", "answer": "B"} | |
| {"id": "local_26", "question": "What is the term used for a block of code that is executed repeatedly until a certain condition is met?", "choices": ["Loop", "Condition", "Variable", "Function"], "subject": "control_structure", "answer": "A"} | |
| {"id": "local_27", "question": "Which data structure is used for storing a collection of elements in a non-linear fashion?", "choices": ["Tree", "Queue", "Array", "Stack"], "subject": "structuring_data", "answer": "A"} | |
| {"id": "local_28", "question": "Which operator is used for exponentiation in most programming languages?", "choices": ["*", "^", "%", "**"], "subject": "structuring_data", "answer": "D"} | |
| {"id": "local_29", "question": "Which programming language is used for developing Android apps?", "choices": ["Python", "Java", "Swift", "C#"], "subject": "programming_languages", "answer": "B"} | |
| {"id": "local_30", "question": "Which of the following is not a valid variable name in most programming languages?", "choices": ["123Variable", "_myVariable", "my_variable", "myVariable"], "subject": "names_and_the_environment", "answer": "A"} | |
| {"id": "local_31", "question": "Which of the following is a type of sorting algorithm?", "choices": ["Breadth-first search", "Quick sort", "Depth-first search", "Binary search"], "subject": "algorithms", "answer": "B"} | |
| {"id": "local_32", "question": "Which keyword is used for defining a function in most programming languages?", "choices": ["def", "fun", "sub", "function"], "subject": "programming_languages", "answer": "A"} | |
| {"id": "local_33", "question": "Which of the following is not a data type in most programming languages?", "choices": ["Float", "Double", "Integer", "String"], "subject": "structuring_data", "answer": "B"} | |
| {"id": "local_34", "question": "Which programming language is used for developing iOS apps?", "choices": ["Swift", "C#", "Python", "Java"], "subject": "programming_languages", "answer": "A"} | |
| {"id": "local_35", "question": "Which of the following is not a relational operator in most programming languages?", "choices": ["!=", "=", "++", "=="], "subject": "structuring_data", "answer": "C"} | |
| {"id": "local_36", "question": "Which data structure is used for implementing a Last-In-First-Out (LIFO) behavior?", "choices": ["Queue", "Stack", "Tree", "Linked list"], "subject": "algorithms", "answer": "B"} | |
| {"id": "local_37", "question": "Which of the following is not a programming language?", "choices": ["CSS", "JavaScript", "HTML", "MySQL"], "subject": "programming_languages", "answer": "D"} | |
| {"id": "local_38", "question": "Which of the following is a type of conditional statement?", "choices": ["Switch statement", "If statement", "While loop", "For loop"], "subject": "control_structure", "answer": "B"} | |
| {"id": "local_39", "question": "Which of the following is a type of web development framework?", "choices": ["Angular", "React", "All of the above", "Django"], "subject": "programming_languages", "answer": "C"} | |
| {"id": "local_40", "question": "Which of the following is not a data structure?", "choices": ["Queue", "Function", "Stack", "Linked list"], "subject": "structuring_data", "answer": "B"} | |
| {"id": "local_41", "question": "Which programming paradigm emphasizes on writing code as a series of mathematical functions?", "choices": ["Procedural programming", "Object-oriented programming", "Structured programming", "Functional programming"], "subject": "programming_languages", "answer": "D"} | |
| {"id": "local_42", "question": "Which of the following is not a commonly used programming language for web development?", "choices": ["Ruby", "Swift", "Python", "Java"], "subject": "programming_languages", "answer": "B"} | |
| {"id": "local_43", "question": "Which of the following is used for creating and managing virtual environments in Python?", "choices": ["pip", "conda", "venv", "virtualenv"], "subject": "programming_languages", "answer": "C"} | |
| {"id": "local_44", "question": "Which of the following is not a commonly used web development framework in JavaScript?", "choices": ["Django", "Vue.js", "React", "Angular"], "subject": "programming_languages", "answer": "A"} | |
| {"id": "local_45", "question": "Which of the following is not a commonly used programming language for artificial intelligence (AI) and machine learning (ML)?", "choices": ["C++", "Java", "Python", "R"], "subject": "programming_languages", "answer": "B"} | |
| {"id": "local_46", "question": "Which of the following is a type of loop in programming?", "choices": ["For loop", "All of the above", "Do-while loop", "While loop"], "subject": "control_structure", "answer": "B"} | |
| {"id": "local_47", "question": "Which of the following is a commonly used markup language for web development?", "choices": ["HTML", "JSON", "XML", "YAML"], "subject": "programming_languages", "answer": "A"} | |
| {"id": "local_48", "question": "Which of the following is a commonly used version control system?", "choices": ["SVN", "Mercurial", "All of the above", "Git"], "subject": "programming_languages", "answer": "C"} | |
| {"id": "local_49", "question": "Which of the following is a commonly used integrated development environment (IDE) for Python?", "choices": ["Sublime Text", "PyCharm", "Visual Studio Code", "Eclipse"], "subject": "programming_languages", "answer": "B"} | |
| {"id": "local_50", "question": "Which of the following is a commonly used web application framework for Ruby?", "choices": ["Express.js", "Ruby on Rails", "Flask", "Django"], "subject": "programming_languages", "answer": "B"} | |
| {"id": "local_51", "question": "Which of the following is a commonly used object-oriented programming language?", "choices": ["C", "Perl", "Python", "Shell"], "subject": "programming_languages", "answer": "C"} | |
| {"id": "local_52", "question": "Which of the following is a commonly used programming language for game development?", "choices": ["Ruby", "Python", "Java", "C#"], "subject": "programming_languages", "answer": "D"} | |
| {"id": "local_53", "question": "Which of the following is a commonly used programming language for mobile app development?", "choices": ["Swift", "Kotlin", "Java", "All of the above"], "subject": "programming_languages", "answer": "D"} | |
| {"id": "local_54", "question": "Which of the following is a commonly used web development framework for PHP?", "choices": ["Ruby on Rails", "Express.js", "Laravel", "Flask"], "subject": "programming_languages", "answer": "C"} | |
| {"id": "local_55", "question": "Which of the following is a commonly used scripting language for web development?", "choices": ["Java", "JavaScript", "Python", "Ruby"], "subject": "programming_languages", "answer": "B"} | |
| {"id": "local_56", "question": "Which of the following is a commonly used web development framework for JavaScript?", "choices": ["React", "Flask", "Django", "Ruby on Rails"], "subject": "programming_languages", "answer": "A"} | |
| {"id": "local_57", "question": "Which of the following is a commonly used web development framework for Java?", "choices": ["Ruby on Rails", "Flask", "Django", "Spring"], "subject": "programming_languages", "answer": "D"} | |
| {"id": "local_58", "question": "Which of the following is a commonly used web development framework for Ruby?", "choices": ["Express.js", "Django", "Ruby on Rails", "Flask"], "subject": "programming_languages", "answer": "C"} | |
| {"id": "local_59", "question": "Which of the following is a commonly used programming language for scientific computing?", "choices": ["Python", "C#", "Java", "Ruby"], "subject": "programming_languages", "answer": "A"} | |
| {"id": "local_60", "question": "Which of the following is a commonly used programming language for data analysis?", "choices": ["Ruby", "Python", "C++", "Java"], "subject": "programming_languages", "answer": "B"} | |
| {"id": "local_61", "question": "Which of the following is a commonly used web development framework for Python?", "choices": ["Ruby on Rails", "Django", "Flask", "Express.js"], "subject": "programming_languages", "answer": "B"} | |
| {"id": "local_62", "question": "Which of the following is a commonly used programming language for server-side web development?", "choices": ["JavaScript", "Ruby", "All of the above", "PHP"], "subject": "programming_languages", "answer": "C"} | |
| {"id": "local_63", "question": "What is the purpose of a loop in programming?", "choices": ["To execute a set of instructions a specified number of times", "To terminate the program", "To print output to the console", "To declare variables"], "subject": "control_structure", "answer": "A"} | |
| {"id": "local_64", "question": "While loop tests the condition at the End of the Loop?", "choices": ["True", "False"], "subject": "control_structure", "answer": "B"} | |
| {"id": "local_65", "question": "What type of errors are checked during compilation?", "choices": ["Logical errors", "Runtime errors", "Syntax errors", "Divide by zero error"], "subject": "fundations", "answer": "C"} | |
| {"id": "local_66", "question": "The purpose of main function is _.", "choices": ["To stop algorithm", "To start algorithm", "To start program execution", "To stop program execution"], "subject": "programming_languages", "answer": "C"} | |
| {"id": "local_67", "question": "What is output of the following program? main() {int a; float b; a=1/2; b=1.0/2.0; printf(' a=%d b=%f',a,b); }", "choices": ["a=0 b=0.5", "a=0.0 b=5", "a=0.5 b=0.5", "a=0 b=0.5"], "subject": "programming_languages", "answer": "A"} | |
| {"id": "local_68", "question": "What are the smallest individual units in a program?", "choices": ["Structures", "Record", "Functions", "Tokens"], "subject": "describing_a_programming_language", "answer": "D"} | |
| {"id": "local_69", "question": "Consider the above code and find the output. main ( ) { int m,y; m = 5; y = ++m; printf('%d %d',m,y);}", "choices": ["5,5", "6,6", "6,5", "5,6"], "subject": "programming_languages", "answer": "B"} | |
| {"id": "local_70", "question": "Int C; C=25/2; What is the value of C?", "choices": ["12", "12.500000", "0.5", "12.000000"], "subject": "structuring_data", "answer": "A"} | |
| {"id": "local_71", "question": "The _ loop executes at least once.", "choices": ["Do while", "While"], "subject": "control_structure", "answer": "A"} | |
| {"id": "local_72", "question": "An _ is a collection of variables having same data type.", "choices": ["Function", "Operator", "Array"], "subject": "structuring_data", "answer": "C"} | |
| {"id": "local_73", "question": "What will be the output of the following program? #include int main() { int a = 1, b = 2, c = 3; printf('The value of a is %d', a); a+=3; printf(' The value of a is %d', a); return 0; }", "choices": ["The value of a is 2 The value of a is 2", "Compiler error", "The value of a is 1 The value of a is 4", "The value of a is 1 The value of a is 3"], "subject": "programming_languages", "answer": "C"} | |
| {"id": "local_74", "question": "What is value of C in the following program? {a=10; b=12; c=a+b*2;}", "choices": ["22", "44", "Compiler Error", "34"], "subject": "programming_languages", "answer": "D"} | |
| {"id": "local_75", "question": "What will be the output of the following program? #include<stdio.h> int main() { int arr[3]= {1, 2, 3, 4}; printf('%d\n',arr[3] ); }", "choices": ["4", "Runtime Error", "Compiler Error", "3"], "subject": "programming_languages", "answer": "A"} | |
| {"id": "local_76", "question": "What will be the output of the following program? int main() { int i=1; do{ printf('%d ',i); i++; if(i > 5) break; } while(TRUE); return 0; }", "choices": ["It prints an infinite loop of numbers", "1", "1 2 3 4", "1 2 3 4 5"], "subject": "control_structure", "answer": "D"} | |
| {"id": "local_77", "question": "How many times will the following loop execute? int main() { int x; for(x=-1; x<=10; x++) { if(x < 5) continue; else break; printf('IndiaBIX'); } return 0; }", "choices": ["10 times", "0 times", "11 times", "Infinite times"], "subject": "control_structure", "answer": "C"} | |
| {"id": "local_78", "question": "What is the output of the following program? main( ) {int x; x= 14 % 8; printf('%d',x); }", "choices": ["1.75", "4", "1", "6"], "subject": "programming_languages", "answer": "D"} | |
| {"id": "local_79", "question": "What is the output of the following program? int main() { int i=-3, j=2, k=0, m; m=i++; printf('%d, %d, %d, %d\n', i, j, k, m); return 0; }", "choices": ["-3, 2, 0, -1", "2, 3, 1, 1", "-3, 2, 0, 1", "1, 2, 0, 1"], "subject": "programming_languages", "answer": "A"} | |
| {"id": "local_80", "question": "What is the output of the following program? main( ) {int x=15,y=6; if(x <15) printf('%d',y); }", "choices": ["4", "2", "1", "6"], "subject": "programming_languages", "answer": "D"} | |
| {"id": "local_81", "question": "What is the output of the following program? main( ) { float a=5; float b=10,c; c=b%a; printf('%f',c); }", "choices": ["0.000000", "Gives an error", "0.00", "2.0"], "subject": "programming_languages", "answer": "C"} | |
| {"id": "local_82", "question": "What is the value of x in the following code? int x=1,y=5; x=++x + -y;", "choices": ["8", "5", "-7", "-3"], "subject": "programming_languages", "answer": "D"} | |
| {"id": "local_83", "question": "What is a syntax error?", "choices": ["An error you find at the end when the program gives out a wrong value due to logic error", "An error due to user error", "An error you will never find", "An error caused by language rules being broken"], "subject": "fundations", "answer": "D"} | |
| {"id": "local_84", "question": "The high level language program before ready to be executed must go through various process except _.", "choices": ["Controlling", "Linking", "Loading", "Translation"], "subject": "programming_languages", "answer": "D"} | |
| {"id": "local_85", "question": "Which one of the following language reflects the way people think mathematically?", "choices": ["Functional", "Cross platform programming language", "All of the above", "Event driven programming language"], "subject": "functional_programming", "answer": "A"} | |
| {"id": "local_86", "question": "Which language can be directly understood by the CPU?", "choices": ["All of the above", "Assembly language", "C", "Java"], "subject": "abstract_machines", "answer": "B"} | |
| {"id": "local_87", "question": "What type of languages can easily interact with the hardware?", "choices": ["Very high level languages", "High level languages", "Low level languages", "Middle level languages"], "subject": "abstract_machines", "answer": "C"} | |
| {"id": "local_88", "question": "Which one of the following statements is FALSE?", "choices": ["High-level language programs can be translated to different Intermediate Representations", "Type checking is done before parsing", "Context-free grammar can be used to specify both lexical and syntax rules", "Arguments to a function can be passed using the program stack"], "subject": "programming_languages", "answer": "B"} | |
| {"id": "local_89", "question": "The output of a lexical analyzer is _.", "choices": ["Machine code", "A parse tree", "Intermediate code", "A stream of tokens"], "subject": "describing_a_programming_language", "answer": "D"} | |
| {"id": "local_90", "question": "Consider the following statements related to compiler construction : I. Lexical Analysis is specified by context-free grammars and implemented by pushdown automata. II. Syntax Analysis is specified by regular expressions and implemented by finite-state machine. Which of the above statement", "choices": ["Only II", "is/are correct?", "Only I", "Both I and II", "Neither I nor II"], "subject": "describing_a_programming_language", "answer": "D"} | |
| {"id": "local_91", "question": "Which of the following statement regarding a linker software is/are true? I A function of a linker is to combine several object modules into a single load module. II A function of a linker is to replace absolute references in an object module by symbolic references to locations in other modules.", "choices": ["Neither I nor II", "Only II", "Only I", "Both I and II"], "subject": "programming_languages", "answer": "D"} | |
| {"id": "local_92", "question": "Debugger is a program that _.", "choices": ["does not allow execution of a segment of program", "allows to set breakpoints, execute a segment of program and display contents of register", "All of the above", "allows to examine and modify the contents of registers"], "subject": "programming_languages", "answer": "B"} | |
| {"id": "local_93", "question": "Consider the following two statements: P: Every regular grammar is LL(1). Q: Every regular set has a LR(1) grammar. Which of the following is TRUE?", "choices": ["Both P and Q are true", "Both P and Q are false", "P is true and Q is false", "P is false and Q is true"], "subject": "programming_languages", "answer": "D"} | |
| {"id": "local_94", "question": "A canonical set of items is given below: S --> L. > R. Q --> R. On input symbol < the set has _.", "choices": ["neither a shift-reduce nor a reduce-reduce conflict", "a reduce-reduce conflict but not a shift-reduce conflict", "a shift-reduce conflict and a reduce-reduce conflict", "a shift-reduce conflict but not a reduce-reduce conflict"], "subject": "programming_languages", "answer": "A"} | |
| {"id": "local_95", "question": "The grammar A -> AA | (A) | eps is not suitable for predictive-parsing because the grammar is _.", "choices": ["ambiguous", "an operator-grammar", "right-recursive", "left-recursive"], "subject": "programming_languages", "answer": "A"} | |
| {"id": "local_96", "question": "Which of the following suffices to convert an arbitrary CFG to an LL(1) grammar?", "choices": ["None of these", "Factoring the grammar alone", "Removing left recursion alone", "Removing left recursion and factoring the grammar"], "subject": "programming_languages", "answer": "A"} | |
| {"id": "local_97", "question": "Which of the following statements is false?", "choices": ["An unambiguous grammar has same leftmost and rightmost derivation", "An LL(1) parser is a top-down parser", "An ambiguous grammar can never be LR for any k", "LALR is more powerful than SLR"], "subject": "programming_languages", "answer": "A"} | |
| {"id": "local_98", "question": "Given the language L = {ab, aa, baa}, which of the following strings are in L*?", "choices": ["baaaaabaa", "abaabaaabaa", "baaaaabaaaab", "aaaabaaaa"], "subject": "programming_languages", "answer": "B"} | |
| {"id": "local_99", "question": "Which one of the following is FALSE?", "choices": ["Every nondeterministic PDA can be converted to an equivalent deterministic PDA", "Complement of every context-free language is recursive", "Every NFA can be converted to an equivalent PDA", "There is unique minimal DFA for every regular language"], "subject": "programming_languages", "answer": "A"} | |
| {"id": "local_100", "question": "Which of the following statements is false?", "choices": ["Every non-deterministic Turing machine can be converted to an equivalent deterministic Turing machine", "Every finite subset of a recursively enumerable set is recursive", "Every subset of a recursively enumerable set is recursive", "Every NFA can be converted to an equivalent DFA"], "subject": "programming_languages", "answer": "B"} | |
| {"id": "local_101", "question": "Which of the following is TRUE?", "choices": ["Every subset of a regular set is regular", "Every finite subset of a non-regular set is regular", "The union of two non-regular sets is not regular", "Infinite union of finite sets is regular"], "subject": "programming_languages", "answer": "B"} | |
| {"id": "local_102", "question": "Which of the following pairs have DIFFERENT expressive power?", "choices": ["Deterministic single-tape Turing machine and Non-deterministic single-tape Turing machine", "Single-tape Turing machine and multi-tape Turing machine", "Deterministic finite automata(DFA) and Non-deterministic finite automata(NFA)", "Deterministic push down automata(DPDA)and Non-deterministic push down automata(NPDA)"], "subject": "programming_languages", "answer": "D"} | |
| {"id": "local_103", "question": "Which of the following is true?", "choices": ["The complement of a recursive language is recursive", "The complement of a context-free language is context-free", "The complement of a recursively enumerable language is recursively enumerable", "The complement of a recursive language is either recursive or recursively enumerable"], "subject": "programming_languages", "answer": "A"} | |
| {"id": "local_104", "question": "The set of all recursively enumerable languages is _.", "choices": ["an uncountable set", "closed under intersection", "closed under complementation", "a subset of the set of all recursive languages"], "subject": "programming_languages", "answer": "B"} | |
| {"id": "local_105", "question": "Which of the following is FALSE with respect to possible outcomes of executing a Turing Machine over a given input?", "choices": ["it may halt and accept the input", "it may halt by changing the input", "it may never halt", "it may halt and reject the input"], "subject": "fundations", "answer": "B"} | |
| {"id": "local_106", "question": "Select one of the following true statement for the compiler.", "choices": ["it translates the source code into object code as a whole", "all of above", "the input of the compiler is source program", "the output of the compiler is object code"], "subject": "abstract_machines", "answer": "B"} | |
| {"id": "local_107", "question": "In object oriented programming, the objects can contain ______ ?", "choices": ["variables", "all of these", "data", "code"], "subject": "object-oriented_paradigm", "answer": "B"} | |
| {"id": "local_108", "question": "Which one of the following is a more generalized concept?", "choices": ["Class", "Attributes", "Functions", "Object"], "subject": "programming_languages", "answer": "A"} | |
| {"id": "local_109", "question": "Which statement is true about objects in object oriented programming?", "choices": ["procedures are attached to objects and can access and modify the object's data fields", "procedures are attached to objects but can't access and modify the object's data fields", "procedures are attached to objects and can access but can't modify the object's data fields", "procedures are not attached to objects and so can't access and modify the object's data fields"], "subject": "object-oriented_paradigm", "answer": "A"} | |
| {"id": "local_110", "question": "Which of the following statement is correct about classes in object oriented programming?", "choices": ["classes represents recursion", "classes can't share attribute with each other", "none of these", "classes can share attribute with each other"], "subject": "object-oriented_paradigm", "answer": "D"} | |
| {"id": "local_111", "question": "Which one of the following statement is correct about objects and classes?", "choices": ["objects are not instances of classes", "objects are instances of classes", "objects are instances of classes", "classes are instances of objects"], "subject": "object-oriented_paradigm", "answer": "B"} | |
| {"id": "local_112", "question": "We can access which kind of data members in the derived class?", "choices": ["Private data members", "Public data members", "Protected data members", "B and C"], "subject": "object-oriented_paradigm", "answer": "D"} | |
| {"id": "local_113", "question": "We can access which kind of data members outside the class?", "choices": ["Public data members", "Private data members", "B and C", "Protected data members"], "subject": "object-oriented_paradigm", "answer": "A"} | |
| {"id": "local_114", "question": "Which one is the best description of polymorphism?", "choices": ["It is the ability for many messages/data to be processed in many ways", "none of these", "It is the ability for undefined message/data to be processed in at least one way", "It is the ability for a message/data to be processed in more than one form"], "subject": "structuring_data", "answer": "D"} | |
| {"id": "local_115", "question": "The feature that its specification is if same message is passed to objects of several different classes and all of those can respond in a different way then it is called?", "choices": ["Inheritance", "Polymorphism", "none of these", "Classes"], "subject": "object-oriented_paradigm", "answer": "B"} | |
| {"id": "local_116", "question": "Which of the following is not true for polymorphism?", "choices": ["It is a feature of OOP", "Ease in the readability of a program", "Helps in redefining the same functionality", "Increases overhead of function definition always"], "subject": "structuring_data", "answer": "D"} | |
| {"id": "local_117", "question": "The two or more classes serve as base class for a derived class, then this situation is called _.", "choices": ["Polymorphism", "multiple inheritance", "encapsulation", "none of these"], "subject": "object-oriented_paradigm", "answer": "B"} | |
| {"id": "local_118", "question": "A grammar for a programming language is a formal description of _.", "choices": ["Syntax", "Code", "Structure", "Semantics"], "subject": "describing_a_programming_language", "answer": "C"} | |
| {"id": "local_119", "question": "Which of the following is most general phase structured grammar?", "choices": ["Context Free", "None of the above", "Regular", "Context Sensitive"], "subject": "describing_a_programming_language", "answer": "D"} | |
| {"id": "local_120", "question": "Context free language can be recognized by _.", "choices": ["both b and c", "linear bounded automation", "finite state automation", "push down automata"], "subject": "programming_languages", "answer": "A"} | |
| {"id": "local_121", "question": "The term environment in programming language semantics is said as _.", "choices": ["none of the above", "function that maps a name to a storage location", "function that maps a name to value held there", "the function that maps a storage location to the value held there"], "subject": "names_and_the_environment", "answer": "B"} | |
| {"id": "local_122", "question": "Any syntactic construct that can be described by a regular expression can also be described by a _.", "choices": ["context sensitive grammar", "non-context free grammar", "none of these", "context free grammar"], "subject": "describing_a_programming_language", "answer": "D"} | |
| {"id": "local_123", "question": "Use of recursion _.", "choices": ["reduces code size", "reduces execution time", "makes debugging casier", "enhances logical clarity"], "subject": "control_structure", "answer": "D"} | |
| {"id": "local_124", "question": "A program has 100 instructions and another program (for the same problem) has 200 instructions. Which of the folowing comment logicaly follows?", "choices": ["The execution time of the second program si more than that of the first", "None of the above", "The execution time of the second program si same as that of the first", "Compilation time of the second program, si more than that of the first"], "subject": "programming_languages", "answer": "B"} | |
| {"id": "local_125", "question": "The conditional expansion facility of macro processors is provided to _.", "choices": ["implement recursion", "expand certain model statements depending upon the value of a condition during the execution of the expanded program", "test a condition during the execution of the expanded program", "expand certain model statements depending upon the value of acondition during hte execution of the macro expansion"], "subject": "programming_languages", "answer": "D"} | |
| {"id": "local_126", "question": "Consider the following pseudo-Pascal function. \n function: fibo (n : integer) : integer; \n begin \n if (n = 0) then fibo := 0 \n else if (n = 1) then fibo:=1 \n else fibo =: fibo(n-1)+fibo(n-2) \n end \n If fibo(5) is the function cal, fibo(1) will be used _.", "choices": ["6 times", "5 times", "4 times", "3 times"], "subject": "programming_languages", "answer": "B"} | |
| {"id": "local_127", "question": "In which of the following parameter passing mechanisms, the actual argument has to be a variable?", "choices": ["Pass by value-result", "Pass by reference", "Pass by result", "Pass by value"], "subject": "names_and_the_environment", "answer": "C"} | |
| {"id": "local_128", "question": "The principle that a function can always be raplaced by its value (irrespective of the context) without changing the meaning is called _.", "choices": ["referential transparency", "orthogonality", "unbinding", "context-free"], "subject": "programming_languages", "answer": "A"} | |
| {"id": "local_129", "question": "Programming languages offer features ot write functions to _.", "choices": ["avoid programming across programs", "facilitate the implementation of top-down logic", "none of the above", "enhance logical clarity"], "subject": "programming_languages", "answer": "B"} | |
| {"id": "local_130", "question": "Which of the following comparisons between static and dynamic type checking si incorrect?", "choices": ["Dynamic type checking slows down execution", "Dynamic type checking offers more flexibility ot the programmers", "Dynamic type checking si more reliable", "Unlike static type checking, dynamic type checking is done during compilation"], "subject": "structuring_data", "answer": "A"} | |
| {"id": "local_131", "question": "The period of time between an allocation and its subsequent disposal is called _.", "choices": ["scope", "lifetime", "longevity", "(dynamic) binding"], "subject": "names_and_the_environment", "answer": "B"} | |
| {"id": "local_132", "question": "Aliasing is a situation where _.", "choices": ["a particular location is associated with more than one name", "none of the above", "two commands with different names share the same code", "different functions have the same name but require parameters of different types"], "subject": "names_and_the_environment", "answer": "C"} | |
| {"id": "local_133", "question": "Overloading is _.", "choices": ["functions having the same name but with different types of parameters", "all of the above", "an operator whose meaning is determined by the operand type", "a function used very frequently in a program"], "subject": "structuring_data", "answer": "A"} | |
| {"id": "local_134", "question": "Which of the following is a dangling reference?", "choices": ["Accessing a storage that is already disposed at the request of the processor", "Accessing a variable that is declared but not initialized", "Accesing a storage that is already disposed at the request of the user", "None of the above"], "subject": "memory_management", "answer": "C"} | |
| {"id": "local_135", "question": "Heap allocation is required for languages that _.", "choices": ["support recursion", "support dynamic data structures", "use dynamic scope rules", "none of the above"], "subject": "memory_management", "answer": "B"} | |
| {"id": "local_136", "question": "Binding (of an identifier to a value) can occur while _.", "choices": ["executing a program", "writing a program", "invoking a sub-program", "compiling aprogram"], "subject": "names_and_the_environment", "answer": "B"} | |
| {"id": "local_137", "question": "Consider the following program fragment. procedure exchange(A: integer, B: integer) \n temp: integer; \n begin \n temp : = A; A := B; B := temp \n end; \n begin \n M := 2 X[M] := 4; \n exchange(M, X[M]); write(M, x[2]); \n end \n If the parameters are passed by value, the output will be _.", "choices": ["4, 2", "unpredictable", "2, 4", "2, 2"], "subject": "programming_languages", "answer": "C"} | |
| {"id": "local_138", "question": "Choose the correct statements.", "choices": ["In general, there is always an iterative equivalent of a recursive definition", "In iteration(unlike recursion), the body is carried out to completion each time, before the condition for termination si tested", "Recursion and iteration are equaly powerful", "Recursion is more powerful than iteration"], "subject": "control_structure", "answer": "A"} | |
| {"id": "local_139", "question": "Binding cannot be done _.", "choices": ["when separately compiled modules are being linked together", "none of the above", "while writing a program", "during loading"], "subject": "names_and_the_environment", "answer": "B"} | |
| {"id": "local_140", "question": "The target of an assignment statement should be _.", "choices": ["r-value", "none of the above", "1-value", "either 1-value or r-value"], "subject": "control_structure", "answer": "C"} | |
| {"id": "local_141", "question": "BNF si a meta-language for _.", "choices": ["specifying the syntax of a language", "describing how a program works", "shel programming", "specifying a context-free grammar"], "subject": "describing_a_programming_language", "answer": "A"} | |
| {"id": "local_142", "question": "The word 'formal' in formal languages means _.", "choices": ["the symbols used have well-defined meaning", "none of the above", "they are unnecessary, in reality", "only the form of the string of symbols is significant"], "subject": "describing_a_programming_language", "answer": "D"} | |
| {"id": "local_143", "question": "The recognizing capability of Non-Deterministic Finite State Machine and Deterministic Finite State Machine _.", "choices": ["none of the above", "must be the same", "may be different", "must be different"], "subject": "programming_languages", "answer": "B"} | |
| {"id": "local_144", "question": "Finite State Machine can recognize _.", "choices": ["only Context Free Grammar", "any unambiguous grammar", "only regular grammar", "any grammar"], "subject": "programming_languages", "answer": "C"} | |
| {"id": "local_145", "question": "Pumping lemma is generally used for proving _.", "choices": ["a given grammar is regular", "whether two given regular expressions are equivalent", "a given grammar is not regular", "none of the above"], "subject": "programming_languages", "answer": "C"} | |
| {"id": "local_146", "question": "The basic limitation of an Finite State Machine is that _.", "choices": ["it sometimes recognizes grammars that are not regular", "it can't remember arbitrary large amount of information", "it sometimes fails to recognize grammars that are regular", "all of the above"], "subject": "programming_languages", "answer": "B"} | |
| {"id": "local_147", "question": "Palindromes can't be recognized by any Finite State Machine because _.", "choices": ["none of the above", "a Finite State Machine can't deterministicaly fix the mid-point", "a Finite State Machine can't remember arbitrarily large amount of information", "even if the mid-point is known, a Finite State Machine can't find whether the second half of the string matches the first half"], "subject": "programming_languages", "answer": "C"} | |
| {"id": "local_148", "question": "A Finite State Machine can be considered a Turing Machine _.", "choices": ["of finite tape length, rewinding capability and unidirectional tape movement", "of finite tape length, without rewinding capability and bidirectional tape movement", "of finite tape length, without rewinding capability and unidirectional tape movement", "of finite tape length, rewinding capability and bidirectional tape movement"], "subject": "programming_languages", "answer": "C"} | |
| {"id": "local_149", "question": "Turing Machine is more powerful than Finite State Machine because _.", "choices": ["it has the capability to remember arbitrary long sequences of input symbols", "it has no finite state control", "none of the above", "the tape movement si confined to one direction"], "subject": "programming_languages", "answer": "A"} | |
| {"id": "local_150", "question": "Set of regular languages over a given alphaber set, is not closed under _.", "choices": ["complementation", "none of the above", "intersection", "union"], "subject": "programming_languages", "answer": "B"} | |
| {"id": "local_151", "question": "Any given Transition graph has an equivalent _.", "choices": ["Deterministic Finite State Machine", "regular expression", "NDeterministic Finite State Machine", "none of the above"], "subject": "programming_languages", "answer": "B"} | |
| {"id": "local_152", "question": "Let L(G) denote the language generated by the grammar G. To prove set A = L(G) _.", "choices": ["both the above comments are to be proved", "it is enough to prove that an arbitrary member of A can be generated by grammar G", "either of the above comments is to be proved", "it is enough ot prove that an arbitrary string generated by G, belongs ot set A"], "subject": "programming_languages", "answer": "A"} | |
| {"id": "local_153", "question": "Choose the correct statements.", "choices": ["All languages can be generated by Context Free Grammar", "Any regular language has an equivalent Context Free Grammar", "Some non-regular languages can't be generated by any Context Free Grammar", "Some regular languages can't be generated by any Context Free Grammar"], "subject": "programming_languages", "answer": "B"} | |
| {"id": "local_154", "question": "Context Free Grammar is not closed under _.", "choices": ["Kleene star", "union", "complementation", "product"], "subject": "programming_languages", "answer": "C"} | |
| {"id": "local_155", "question": "The intersection of a Context FreeL and a regular language _.", "choices": ["need not be regular", "is always Context Free", "is always regular", "need not be context free"], "subject": "programming_languages", "answer": "C"} | |
| {"id": "local_156", "question": "Choose the correct statements.", "choices": ["The power of Deterministic Push Down Machine and Non-Deterministic Push Down Machine are the same", "The power of Deterministic Finite State Machine and NDeterministic Finite State Machine are the same", "The power of Deterministic Finite State Machine and NDeterministic Finite State Machine are different", "The power of Deterministic Push Down Machine and Non-Deterministic Push Down Machine are different"], "subject": "programming_languages", "answer": "B"} | |
| {"id": "local_157", "question": "Which of the folowing is accepted by a Non-Deterministic Push Down Machine, but not by a Deterministic Push Down Machine?", "choices": ["Even palindromes (i.e. palindromes made up of even number of terminals)", "All strings in which a given symbol is present at least twice", "Strings ending with a particular terminal", "None of the above"], "subject": "programming_languages", "answer": "A"} | |
| {"id": "local_158", "question": "Context Sensitive Grammar can be recognized by a _.", "choices": ["linearly bounded memory machine", "Deterministic Push Down Machine", "Finite State Machine", "Non-Deterministic Push Down Machine"], "subject": "programming_languages", "answer": "A"} | |
| {"id": "local_159", "question": "Pick the correct answers. Universal Turing Machine influenced the concept of _.", "choices": ["none of the above", "stored-program computers", "interpretive implementation of programming languages", "computability"], "subject": "abstract_machines", "answer": "B"} | |
| {"id": "local_160", "question": "Choose the correct statements. A class of languages that is closed under _.", "choices": ["union and complementation has to be closed under intersection", "intersection and complementation has to be closed under union", "union and intersection has to be closed under complementation", "all of the above"], "subject": "programming_languages", "answer": "A"} | |
| {"id": "local_161", "question": "Which of the following conversion is not possible algorithmicaly?", "choices": ["Non-deterministic PDA to deterministic PDA", "Non-deterministic Turing machine to deterministic Turing machine", "Regular grammar to context free grammar", "Non-deterministic FSA to deterministic FSA"], "subject": "programming_languages", "answer": "A"} | |