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 subjective questions Basic Data Structures

CSE329 — Prelude To Competitive Coding 20 questions with model answers. Write yours first, then compare.

Read the notes Practice MCQs
  1. Question 1 of 20

    Define an array. Explain how 1D and 2D arrays are declared and processed in memory, with suitable examples.

  2. Question 2 of 20

    Explain the algorithms for insertion and deletion of an element in a 1D array at a given position. Analyze their time complexity.

  3. Question 3 of 20

    Describe the different approaches to perform array rotation by positions. Explain the Reversal Algorithm and the Juggling Algorithm in detail.

  4. Question 4 of 20

    Write an algorithm to perform matrix multiplication of two matrices and . State the condition for multiplication and derive its time complexity.

  5. Question 5 of 20

    Distinguish between lower triangular and upper triangular matrices. Write conditions and code snippets to check both.

  6. Question 6 of 20

    Explain the algorithm to print a matrix in spiral form with a suitable example. Analyze its time and space complexity.

  7. Question 7 of 20

    Describe an algorithm to find distinct elements common to all rows of a matrix. Explain how hashing improves efficiency.

  8. Question 8 of 20

    Explain string declaration and manipulation in C. Discuss common string functions with examples.

  9. Question 9 of 20

    Given a string, explain how to find the minimum number of characters needed to make it a Pangram. Provide the algorithm and an example.

  10. Question 10 of 20

    Explain the problem of rearranging characters so that no two adjacent characters are the same. Describe an algorithm using a greedy/heap approach.

  11. Question 11 of 20

    Explain how to find the minimum number of characters to remove from two strings to make them anagrams. Give the algorithm with an example.

  12. Question 12 of 20

    Describe the implementation of a stack using an array. Explain PUSH, POP, and PEEK operations along with overflow and underflow conditions.

  13. Question 13 of 20

    Explain how to implement two stacks in a single array efficiently. Discuss the space-efficient approach.

  14. Question 14 of 20

    Explain how to implement a Stack using Queues. Describe both the push-costly and pop-costly approaches.

  15. Question 15 of 20

    Explain the implementation of a Circular Queue using an array. Why is a circular queue preferred over a linear queue?

  16. Question 16 of 20

    Explain the implementation of a Deque (Double Ended Queue) using a circular array. List its operations and applications.

  17. Question 17 of 20

    Explain the Two Pointer Technique. Using it, write an algorithm to determine whether there exists a pair in an unsorted array whose sum equals a given value .

  18. Question 18 of 20

    Explain the concept of a Peak Element in an array. Write an efficient algorithm to find a peak element and analyze its complexity.

  19. Question 19 of 20

    Explain how to rearrange positive and negative numbers in an array alternately. Also explain how to find the majority element using the Moore's Voting Algorithm.

  20. Question 20 of 20

    Explain the following array problems with their approaches: (a) Move all zeros to the end of the array, and (b) Find the first non-repeating element in an array of integers.

That's unit 1

Long answers stick best when they're tested again soon. Run the MCQs on this unit, then come back to the questions you found hardest.