C Programming with DSA Online Assessment Questions & Answers
40 questions for the online assessment stage — 19 easy, 20 medium, 1 hard.
About the online assessment round
Most companies start with an online test: aptitude and reasoning, a few MCQs on core C Programming with DSA concepts, and one or two short hands-on tasks. It filters a large number of applicants, so speed and accuracy both count.
Tips for the online assessment round
- Practise under a timer: about one minute per MCQ and 15-20 minutes per hands-on task.
- Read every option before answering; tests often include two nearly correct choices.
- Use a stable internet connection, keep your camera on and avoid switching tabs in proctored tests.
- Attempt the questions you are sure about first, then return to the harder ones.
What is a prefix sum array and why is it useful?
Show answer
What is the difference between greedy algorithms and dynamic programming?
Show answer
What are the main stages of compiling a C program?
Show answer
What does it mean that arrays decay to pointers when passed to functions?
Show answer
Write a C function to check whether a number is an Armstrong number.
Show answer
What is a queue and what are its variants?
Show answer
Write a C function to count words in a sentence.
Show answer
Merge two sorted arrays into a third sorted array.
Show answer
What is the difference between an array and a pointer?
Show answer
What is recursion and what are its risks?
Show answer
Write a function that dynamically allocates an array of n integers and fills it with squares.
Show answer
A search on a sorted array of 10 lakh elements is done with a linear loop. How would you justify changing it?
Show answer
Find the length of the longest substring without repeating characters in C.
Show answer
Write a C program that counts lines, words and characters in a file.
Show answer
Why is gets() dangerous and what should you use instead?
Show answer
Copy a file in C using fread and fwrite.
Show answer
Write a C program to swap two numbers without using a third variable.
Show answer
A hash table becomes slow as more data is inserted. What is wrong?
Show answer
How do you pass a structure to a function efficiently?
Show answer
You need the maximum of every sliding window of size k in an array. How would you solve it efficiently?
Show answer
What is a pointer in C?
Show answer
What is the sliding window technique?
Show answer
What is the difference between stack and heap allocation?
Show answer
Explain storage classes in C.
Show answer
Allocate and free a dynamic 2D array of rows by cols in C.
Show answer
What is a double pointer and when do you need it?
Show answer
What is a circular linked list and where is it used?
Show answer
What is the difference between a complete, full and perfect binary tree?
Show answer
How do you find the middle of a linked list in one pass?
Show answer
After calling realloc, the program sometimes crashes. What could be wrong?
Show answer
What is a structure in C and why is it used?
Show answer
Write code to check whether the machine is little endian or big endian.
Show answer
Count the number of islands in a grid of land and water cells. What approach do you take?
Show answer
Why is a circular queue better than a simple array queue?
Show answer
Implement merge sort in C.
Show answer
What is an enum in C and what are its advantages?
Show answer
A doubly linked list delete function leaves the list broken when deleting the head. What is missing?
Show answer
What is the volatile qualifier used for in C?
Show answer
You must schedule the maximum number of non-overlapping meetings in one room. What algorithm do you use?
Show answer
Frequently asked questions
What happens in the C Programming with DSA online assessment round?
Most companies start with an online test: aptitude and reasoning, a few MCQs on core C Programming with DSA concepts, and one or two short hands-on tasks. It filters a large number of applicants, so speed and accuracy both count.
How do I clear the online assessment round?
Practise under a timer: about one minute per MCQ and 15-20 minutes per hands-on task. Read every option before answering; tests often include two nearly correct choices. Use a stable internet connection, keep your camera on and avoid switching tabs in proctored tests.
Which round comes next?
A typical order is online assessment, telephonic screening, one or two technical rounds, a managerial round and HR. Use the other round pages to practise each stage.