Skip to content

Wipro C Programming with DSA Interview Questions & Answers

Curated interview practice questions with answers. These are practice scenarios, not a verified list of past interview questions.

About Wipro hiring for C Programming with DSA roles

Wipro is an Indian multinational technology services and consulting company providing IT, cloud, cybersecurity, engineering and data analytics services to enterprises worldwide. Its delivery teams work on application development, quality engineering and data platforms for clients in sectors like banking, healthcare and energy. In India it hires for testing, data analysis, support and development roles through programmes such as Wipro Elite NTH.

For C Programming with DSA roles, this Wipro practice set focuses most on C Basics, Data Types and Operators (7), Pointers and Memory Management (6), Structures, Unions and File Handling (5), Linked Lists (5). It has 18 easy, 11 medium, 1 hard questions, so you can start easy and work up to the harder ones.

Company type
IT services
Headquarters
Bengaluru, India
Main India offices
Bengaluru, Hyderabad, Pune, Chennai, Kolkata

Wipro C Programming with DSA interview process

  1. Online assessment (aptitude + written communication)
  2. Coding test
  3. Technical interview
  4. HR round

Typical pattern based on public candidate experiences. Rounds vary by role, team and year.

Solved for WiproStart practicing
3 QUESTIONS FREESign up to unlock the full question bank and track your progress.Unlock every question and answer, then continue practising company-wise and package-wise.
3 questions free Unlock the rest in seconds
01

What is a structure in C and why is it used?

Save to ▾
Show answer
A structure groups related variables of different types under one name, such as struct Student { int roll; char name[50]; float marks; };. It models real records, lets functions take or return one object instead of many parameters and is the base for data structures like linked lists and trees. Members are accessed with the dot operator or with -> through a pointer.
02

What is a queue and what are its variants?

Save to ▾
Show answer
A queue is first in, first out with enqueue at the rear and dequeue at the front, both O(1). Variants are the circular queue, which reuses array space; the deque, which allows insertion and removal at both ends; and the priority queue, which removes the highest priority element first. Queues are used in BFS, task scheduling, print spooling and buffering data between producers and consumers.
03

What are the basic data types in C and their typical sizes?

Save to ▾
Show answer
C has char (1 byte), short (usually 2), int (usually 4), long (4 on Windows, 8 on 64-bit Linux), long long (at least 8), float (4) and double (8). The standard only fixes minimum ranges, so sizes depend on the platform. Use sizeof to check and the fixed-width types from stdint.h such as int32_t and uint8_t when exact sizes matter.
04

What is a linked list and how is it different from an array?

Save to ▾
Show answer
A linked list is a chain of nodes where each node holds data and a pointer to the next node, allocated separately on the heap. Unlike an array, it grows easily and inserts or deletes in O(1) once you have the position, but it has O(n) access by index, extra memory per node for pointers and poor cache locality. Arrays win for random access and iteration speed.
05

Write a C program to swap two numbers without using a third variable.

Save to ▾
Show answer
Using arithmetic or XOR through pointers: void swap(int *a, int *b) { if (a == b) return; *a = *a ^ *b; *b = *a ^ *b; *a = *a ^ *b; } The a == b check matters because XOR swapping a variable with itself sets it to zero. In real code a temporary variable is clearer and just as fast.
06

What is the difference between stack and heap allocation?

Save to ▾
Show answer
Stack memory holds local variables, is allocated and freed automatically when functions enter and return, and is very fast but limited in size, often 1 to 8 MB. Heap memory is allocated with malloc and freed manually, can be large and outlive the function, but is slower and can fragment or leak. Large or variable sized data and data that must outlive a function belong on the heap.
07

A file opened with fopen is NULL in production but fine on your machine. How do you debug?

Save to ▾
Show answer
Always check the return value and print the reason with perror or strerror(errno), which shows errors like No such file or directory or Permission denied. Common causes are a relative path resolved from a different working directory, missing permissions for the service user, a full disk or too many open files. Use absolute or configured paths and close every file you open.
08

What is the two-pointer technique and when is it used?

Save to ▾
Show answer
Two pointers keep two indexes that move through an array according to a rule, often from both ends of a sorted array or at different speeds. It solves pair sum on sorted arrays, removing duplicates in place, reversing, merging sorted arrays and partitioning. It usually gives O(n) time and O(1) extra space instead of nested loops.
09

Insert a value into a binary search tree recursively in C.

Save to ▾
Show answer
Go left or right until an empty spot is found. typedef struct TNode { int key; struct TNode *left, *right; } TNode; TNode *insert(TNode *root, int key) { if (root == NULL) { TNode *n = malloc(sizeof *n); n->key = key; n->left = n->right = NULL; return n; } if (key < root->key) root->left = insert(root->left, key); else if (key > root->key) root->right = insert(root->right, key); return root; } Duplicates are ignored here.
10

What is the volatile qualifier used for in C?

Save to ▾
Show answer
volatile tells the compiler that a variable can change outside normal program flow, for example a hardware register, a variable changed in an interrupt handler or memory shared with another device. The compiler must read it from memory every time and cannot cache it in a register or remove repeated reads. It does not provide atomicity or thread safety on its own.
11

How does binary search work and what are common bugs?

Save to ▾
Show answer
Binary search works on sorted data by comparing the middle element with the target and discarding half the range each step, giving O(log n). Common bugs are computing mid as (low + high) / 2, which can overflow, so use low + (high - low) / 2; wrong loop conditions causing infinite loops; and off-by-one errors when finding first or last occurrences. Test with zero, one and two elements.
12

What is a circular linked list and where is it used?

Save to ▾
Show answer
In a circular linked list the last node points back to the first, so there is no NULL end. You can start at any node and visit all nodes, and keeping only a tail pointer gives O(1) access to both ends. It is used in round-robin CPU scheduling, multiplayer turn order and circular buffers. Traversal loops must stop when they return to the starting node.
13

Explain storage classes in C.

Save to ▾
Show answer
auto is the default for local variables, stored on the stack with block lifetime. register hints the variable should live in a CPU register, and its address cannot be taken. static gives a local variable lifetime for the whole program, or limits a global to its file. extern declares a variable defined in another file. Storage class decides scope, lifetime and linkage.
14

What is the difference between malloc, calloc, realloc and free?

Save to ▾
Show answer
malloc(size) allocates uninitialised memory. calloc(n, size) allocates memory for n elements and sets all bytes to zero, and it checks n times size for overflow. realloc(ptr, size) resizes a block, possibly moving it, and returns the new address. free(ptr) releases memory back to the allocator. All allocators return NULL on failure, so always check the result.
15

What is a memory leak and how do you detect it?

Save to ▾
Show answer
A memory leak happens when dynamically allocated memory is never freed and the last pointer to it is lost, so the program keeps growing in memory use. Long running services and embedded systems eventually fail. Detect leaks with Valgrind memcheck, AddressSanitizer with LeakSanitizer or allocation tracking wrappers. Prevent them with clear ownership rules and a single cleanup path per function.
16

What is the difference between fseek, ftell and rewind?

Save to ▾
Show answer
fseek(fp, offset, origin) moves the file position relative to SEEK_SET, SEEK_CUR or SEEK_END. ftell(fp) returns the current position as a long. rewind(fp) moves to the start and clears error flags. Together they let you find file size, jump to a record in a fixed-size record file or re-read data. For very large files, use fseeko and ftello with off_t.
17

What is an enum in C and what are its advantages?

Save to ▾
Show answer
An enum defines a set of named integer constants, such as enum Color { RED, GREEN, BLUE };, where values start at 0 unless set. It makes code readable and lets compilers warn about missing cases in a switch with -Wswitch. Enum values are int sized in practice, and C23 allows specifying the underlying type. Use them for states, commands and error codes.
18

Explain the memory layout of a C program.

Save to ▾
Show answer
From low to high address, a typical process has the text segment holding code, the initialised data segment for globals and statics with values, BSS for uninitialised or zero globals, the heap growing upward for malloc memory, and the stack growing downward for function frames and local variables. Knowing this helps explain stack overflow, memory leaks and where variables live.
19

Why is a dummy or sentinel node useful in linked list code?

Save to ▾
Show answer
A dummy node placed before the real head removes special cases for an empty list or for inserting and deleting at the head, because every real node then has a previous node. Code for merging lists, removing elements and partitioning becomes shorter and less error prone. At the end, return dummy.next as the new head. It costs one extra node.
20

Use qsort with a function pointer to sort an array of integers in descending order.

Save to ▾
Show answer
Write a comparator that returns negative, zero or positive. int cmpDesc(const void *a, const void *b) { int x = *(const int *)a; int y = *(const int *)b; return (y > x) - (y < x); } int arr[] = {4, 1, 9, 3}; qsort(arr, 4, sizeof arr[0], cmpDesc); Returning y - x can overflow, so the comparison form is safer.
21

What is the difference between char s[] = "hello" and char *s = "hello"?

Save to ▾
Show answer
char s[] = "hello" creates a modifiable array of 6 bytes, usually on the stack, initialised with a copy of the literal. char *s = "hello" makes a pointer to a string literal stored in read-only memory; modifying it is undefined behaviour and often crashes. Declare such pointers as const char * so the compiler catches accidental writes.
22

What are the main stages of compiling a C program?

Save to ▾
Show answer
Preprocessing expands #include files and macros and removes comments. Compilation turns the preprocessed code into assembly. Assembly converts it into an object file of machine code. Linking combines object files with libraries such as libc to produce the executable. With gcc you can stop at each stage using -E, -S and -c, which helps when debugging macro or linker errors.
23

Describe a time you failed in an interview or test and what you learned.

Save to ▾
Show answer
Situation: in my first product company interview I froze on a linked list reversal. Task: improve before the next opportunity. Action: I practised pointer problems daily, always drawing boxes and arrows before coding, and did mock interviews with friends where I spoke my thinking aloud. Result: two months later I solved a harder linked list problem calmly and got the offer.
24

A function returns the address of a local array and the caller gets wrong data. Why?

Save to ▾
Show answer
Local arrays live on the stack and are destroyed when the function returns, so the returned pointer is dangling and later calls overwrite that memory. Fix it by having the caller pass a buffer and its size, allocating with malloc and documenting that the caller must free it, or using a static buffer, which is not thread safe. Compilers warn about this with -Wreturn-local-addr.
25

Valgrind reports invalid read of size 4 after free. How do you fix it?

Save to ▾
Show answer
This is a use-after-free: code reads memory that was already released. Valgrind shows where it was freed and where it was read. Fix the ownership logic so nothing uses the object after free, and set pointers to NULL right after freeing so accidental use fails fast. If multiple parts share the object, use reference counting or free only at one clear owner.
26

Reverse a string in place in C.

Save to ▾
Show answer
Swap characters from both ends moving inward. void reverse(char *s) { size_t n = strlen(s); if (n < 2) return; for (size_t i = 0, j = n - 1; i < j; i++, j--) { char t = s[i]; s[i] = s[j]; s[j] = t; } } Time O(n) and O(1) extra space. The string must be a modifiable array, not a literal.
27

How are graphs represented in C?

Save to ▾
Show answer
An adjacency matrix is a V by V array where cell [u][v] marks an edge; it gives O(1) edge checks but uses O(V squared) memory, suiting dense graphs. An adjacency list stores for each vertex a list or dynamic array of neighbours, using O(V + E) memory, which suits sparse real world graphs like road or social networks. Weighted graphs store the weight with each edge.
28

Reverse a singly linked list iteratively in C.

Save to ▾
Show answer
Flip each next pointer while walking the list. typedef struct Node { int data; struct Node *next; } Node; Node *reverse(Node *head) { Node *prev = NULL, *cur = head; while (cur) { Node *next = cur->next; cur->next = prev; prev = cur; cur = next; } return prev; } Time O(n), space O(1). The returned prev is the new head.
29

Define a struct for a student and print all students with marks above 75.

Save to ▾
Show answer
Use an array of structs and the dot operator. typedef struct { int roll; char name[50]; float marks; } Student; void printToppers(const Student *s, int n) { for (int i = 0; i < n; i++) { if (s[i].marks > 75.0f) printf("%d %s %.1f\n", s[i].roll, s[i].name, s[i].marks); } } Passing a const pointer avoids copying the whole array.
30

What is the difference between const int *p, int *const p and const int *const p?

Save to ▾
Show answer
const int *p is a pointer to a constant int: you cannot change the value through p, but p can point elsewhere. int *const p is a constant pointer: p always points to the same address, but the value can change. const int *const p fixes both. Read declarations from right to left to understand them. const pointers to data are common in function parameters.

Tips to crack the Wipro C Programming with DSA interview

  • Prepare for the essay writing section in the online test by practising short, clear, grammatically correct essays on general topics.
  • Revise basic coding problems on strings and arrays plus fundamentals of DBMS, operating systems and computer networks.
  • Learn about Wipro's values, known as the Spirit of Wipro, and its focus areas such as cloud and cybersecurity.
  • Keep a one-minute story ready for every project on your CV: problem, your part, tools, result.
  • Practise the hard questions on this page aloud; Wipro interviewers usually ask follow-ups on your first answer.

Frequently asked questions

How many rounds are there in the Wipro C Programming with DSA interview?

Candidates usually go through 4 stages: Online assessment (aptitude + written communication); Coding test; Technical interview; HR round. The exact rounds change with the role, team, location and your experience, so confirm the process with the recruiter.

Which topics should I prepare for the Wipro C Programming with DSA interview?

This practice set leans on C Basics, Data Types and Operators (7), Pointers and Memory Management (6), Structures, Unions and File Handling (5), Linked Lists (5). Revise those first, then practise explaining one or two of your own projects end to end, because most Wipro interviewers ask you to walk through real work.

Are these the exact questions asked at Wipro?

No. These are curated practice questions that match the skills and difficulty usually tested in it services interviews like Wipro's. They are not a leaked or verified list of past questions.

Where does Wipro hire C Programming with DSA professionals in India?

Wipro has large teams in Bengaluru, Hyderabad, Pune, Chennai, Kolkata. Openings and locations change often, so check the Wipro careers page and filter by city and experience.

C Programming with DSA questions for similar companies