Notice: Due to an ongoing migration of our storage and publishing system, material requested since last month will not be uploaded for the time being, and new requests are paused. All existing notes remain available.

Unit 1 MCQs Foundational Concepts

INT322 — Computing System And Technologies 60 questions. Pick an option to check it.

Read the notes Subjective questions

0 of 60 answered 0 right 0 wrong , 60 left

  1. Question 1 of 60 Introduction to C/C++ Easy

    Which feature is supported by C++ but not directly by C?

  2. Question 2 of 60 Data types Easy

    Which data type is commonly used to store a single character in C and C++?

  3. Question 3 of 60 Variables Easy

    What is a variable in a program?

  4. Question 4 of 60 Constants Easy

    Which C++ keyword can be used to declare a constant?

  5. Question 5 of 60 Reading and writing data using scanf, printf, cin and cout Easy

    Which object is commonly used to display output in C++?

  6. Question 6 of 60 Control structures: if-else and loops Easy

    Which control structure repeatedly executes code while a condition remains true?

  7. Question 7 of 60 Functions: declaration and definition Easy

    What does a function declaration tell the compiler?

  8. Question 8 of 60 Call by value and call by reference Easy

    What is passed to a function during call by value?

  9. Question 9 of 60 Recursion Easy

    What is recursion?

  10. Question 10 of 60 Introduction to object-oriented programming Easy

    Which concept combines data and related functions within one unit?

  11. Question 11 of 60 User-defined data types: struct and class Easy

    Which keyword defines a structure in C++?

  12. Question 12 of 60 Classes and objects Easy

    What is an object in C++?

  13. Question 13 of 60 Manager functions: constructors and destructors Easy

    When is a constructor normally called in C++?

  14. Question 14 of 60 Introduction to data structures Easy

    What is the main purpose of a data structure?

  15. Question 15 of 60 Types of data structures Easy

    Which of the following is a linear data structure?

  16. Question 16 of 60 Time and space complexity analysis Easy

    What does time complexity describe?

  17. Question 17 of 60 Time-space trade-off Easy

    What does a time-space trade-off mean?

  18. Question 18 of 60 Big-O notation Easy

    What does Big-O notation commonly express?

  19. Question 19 of 60 Big-Omega notation Easy

    What does Big-Omega notation commonly express?

  20. Question 20 of 60 Big-Theta notation Easy

    What does indicate about an algorithm's growth?

  21. Question 21 of 60 Introduction to C/C++ Medium

    A C++ program defines int process(int) and double process(double). Which feature allows process(4) and process(4.5) to select different functions?

  22. Question 22 of 60 Data types Medium

    What does cout << fixed << setprecision(1) << 7 / 2; display when the required headers are included?

  23. Question 23 of 60 Variables Medium

    What is printed by int x = 5; { int x = 8; cout << x << " "; } cout << x;?

  24. Question 24 of 60 Constants Medium

    Given int a = 1, b = 2; const int* p = &a;, which statement is valid?

  25. Question 25 of 60 Reading and writing data using scanf, printf, cin and cout Medium

    Which pair correctly reads an int n and a double x using C input and then using C++ input?

  26. Question 26 of 60 Control structures: if-else and loops Medium

    What is the final value of sum? int sum = 0; for (int i = 1; i <= 6; i++) { if (i % 2 == 0) continue; sum += i; if (sum > 5) break; }

  27. Question 27 of 60 Functions: declaration and definition Medium

    Given the declaration int combine(int, int = 2); and definition int combine(int a, int b) { return a + b; }, what does combine(5) return?

  28. Question 28 of 60 Call by value and call by reference Medium

    What is printed by void update(int a, int& b) { a += 2; b += 2; } int x = 3, y = 3; update(x, y); cout << x << " " << y;?

  29. Question 29 of 60 Recursion Medium

    How many total function invocations occur for f(4), including the initial call, if f(n) returns immediately when and otherwise calls f(n-1) and f(n-2)?

  30. Question 30 of 60 Introduction to object-oriented programming Medium

    If Base declares virtual void show() and Derived overrides it, which implementation runs for Base* p = new Derived; p->show();?

  31. Question 31 of 60 User-defined data types: struct and class Medium

    Consider struct S { int x; }; and class C { int x; };. Without adding access specifiers, which statement is correct?

  32. Question 32 of 60 Classes and objects Medium

    A Counter class has a non-static member value initialized to 0, an increment() method, and a get() method. If object a is incremented twice and object b once, what do a.get() and b.get() return?

  33. Question 33 of 60 Manager functions: constructors and destructors Medium

    A Derived object contains a member object Member and inherits from Base. Which order is used for construction and destruction?

  34. Question 34 of 60 Introduction to data structures Medium

    A browser must implement a Back operation that returns to the most recently visited page first. Which data structure best matches this requirement?

  35. Question 35 of 60 Types of data structures Medium

    For a sparse graph with vertices and relatively few edges , which representation usually uses space?

  36. Question 36 of 60 Time and space complexity analysis Medium

    What are the time and auxiliary-space complexities of for (int i = 0; i < n; i++) for (int j = 1; j < n; j *= 2) count++;?

  37. Question 37 of 60 Time-space trade-off Medium

    A program repeatedly computes an expensive deterministic result for the same inputs. Which change most directly trades additional space for reduced execution time?

  38. Question 38 of 60 Big-O notation Medium

    What is the tightest Big-O bound among the choices for ?

  39. Question 39 of 60 Big-Omega notation Medium

    A loop performs one constant-time operation for every integer from 1 through n. What is its tightest listed asymptotic lower bound?

  40. Question 40 of 60 Big-Theta notation Medium

    What is the Big-Theta complexity of for (int i = 1; i <= n; i++) for (int j = i; j <= n; j++) count++;?

  41. Question 41 of 60 Introduction to C/C++ Hard

    Assume the following source is compiled once as C and once as C++:

    #include <stdlib.h>

    int main(void) { int *p = malloc(sizeof *p); free(p); }

    Which statement is correct?

  42. Question 42 of 60 Data types Hard

    What does the following C++ expression print?

    int i = -1; unsigned int u = 1; std::cout << (i < u);

  43. Question 43 of 60 Variables Hard

    Given the following C++ program fragment, what is printed?

    int x = 1;

    void f() {
    static int x = 2;
    { int x = 7; ++x; }
    std::cout << ++x << ' ';
    }

    int main() { f(); f(); std::cout << x; }

  44. Question 44 of 60 Constants Hard

    For the declarations below, which statement is well-formed C++?

    int a = 1, b = 2;
    const int *p = &a;
    int * const q = &a;

  45. Question 45 of 60 Reading and writing data using scanf, printf, cin and cout Hard

    The input consists of 42 followed immediately by a newline. What values result from this C statement?

    int n = 0; char c = 'X'; int r = scanf("%d%c", &n, &c);

  46. Question 46 of 60 Control structures: if-else and loops Hard

    Let , where , and assume arithmetic does not overflow. How many times is work() called?

    for (int i = 1; i <= n; i *= 2)
    for (int j = i; j >= 1; j /= 2)
    work();

  47. Question 47 of 60 Functions: declaration and definition Hard

    Which pair of C++ declarations introduces two distinct overloads rather than conflicting declarations or repeated declarations of the same function?

  48. Question 48 of 60 Call by value and call by reference Hard

    What is printed by this C++ code?

    void transform(int &a, int &b) { a += 2; b *= 3; }

    int x = 4;
    transform(x, x);
    std::cout << x;

  49. Question 49 of 60 Recursion Hard

    For powers of two, what is the time complexity of this function if each addition, comparison, and division costs constant time?

    int solve(int n) {
    if (n <= 1) return 1;
    return solve(n / 2) + solve(n / 2) + n;
    }

  50. Question 50 of 60 Introduction to object-oriented programming Hard

    What is printed when a Derived object is constructed?

    struct Base {
    Base() { identify(); }
    virtual void identify() { std::cout << "Base"; }
    };

    struct Derived : Base {
    void identify() override { std::cout << "Derived"; }
    };

    Derived object;

  51. Question 51 of 60 User-defined data types: struct and class Hard

    Consider these C++ definitions:

    struct S { int x; };
    class C { int x; };
    struct D : S {};
    class E : S {};

    From an unrelated function, for which objects is direct access through object.x permitted?

  52. Question 52 of 60 Classes and objects Hard

    Assuming allocation succeeds, what is printed before scope exit?

    class Box {
    int *p;
    public:
    Box(int value) : p(new int(value)) {}
    void set(int value) { *p = value; }
    int get() const { return *p; }
    };

    Box a(5);
    Box b = a;
    b.set(9);
    std::cout << a.get() << ' ' << b.get();

  53. Question 53 of 60 Manager functions: constructors and destructors Hard

    Suppose each constructor and destructor records its object's label. For the class below, which sequence is recorded when a D object is created and then destroyed?

    struct D : B2, B1 {
    M m2;
    M m1;
    D() : m1("m1"), m2("m2") { record("D"); }
    ~D() { record("~D"); }
    };

  54. Question 54 of 60 Introduction to data structures Hard

    A collection must support insertion, removal of the most recently inserted value, and retrieval of the current minimum, all in worst-case time. Which design meets every requirement?

  55. Question 55 of 60 Types of data structures Hard

    Which classification correctly describes all four data structures under their conventional implementations?

  56. Question 56 of 60 Time and space complexity analysis Hard

    Assume work() uses time and space. What are the time and auxiliary-space complexities of this code?

    for (int i = 1; i <= n; ++i)
    for (int j = i; j <= n; j += i)
    work();

  57. Question 57 of 60 Time-space trade-off Hard

    A static set of arbitrary keys must answer membership queries. The key universe is too large for direct addressing. Which approach uses extra space and achieves expected total time?

  58. Question 58 of 60 Big-O notation Hard

    Define



    Which asymptotic statement is correct?

  59. Question 59 of 60 Big-Omega notation Hard

    Let for . Which claim is true?

  60. Question 60 of 60 Big-Theta notation Hard

    For any fixed logarithm base greater than , determine the tight asymptotic bound of

That's unit 1

Answer a few questions and your score shows up here.