HP Drive
34 | Rajeswari K | rajii205125@gmail.com | CSE1 | 1 | 20 |
46 | Amutha | amuthavenkat178@gmail.com | CSE1 | 1 | 20 |
121 | Haritha M | mharitha2604@gmail.com | Morning | 1 | 20 |
15 | Benazeer Fathima M | 21ec016@psr.edu.in | ECE1 | 1 | 19 |
42 | NANDHINI M | nanthininanthini708@gmail.com | CSE1 | 1 | 19 |
91 | Sudha S | sudhaganesan2003@gmail.com | CSE2 | 1 | 19 |
93 | S SHAHANA | shahana87780@gmail.com | CSE2 | 1 | 19 |
96 | Nagajothi R | jothir239@gmail.com | CSE2 | 1 | 19 |
56 | Latha Rishi Mathi S | rishimathi1210@gmail.com | CSE1 | 1 | 18 |
37 | Sathyavathi S | 21ec085@psr.edu.in | ECE1 | 1 | 17 |
74 | Raabiyathul Misria R | raabiyathulmisria2004@gmail.com | CSE2 | 1 | 16 |
98 | Nihariha K | nihariha1824@gmail.com | CSE2 | 1 | 16 |
60 | Madhumathi | rmadhuvenus@gmail.com | CSE1 | 1 | 13 |
90 | Revathi Vengatasamy | csrevathiv@gmail.com | CSE2 | 1 | 11 |
What will be the output of the program? #include<stdio.h> int main() { int x=30, *y, *z; y=&x; /* Assume address of x is 500 and integer is 4 byte size */ z=y; *y++=*z++; x++; printf("x=%d, y=%d, z=%d\n", x, y, z); return 0; }
What will be the output of the program if the integer is 4 bytes long? #include<stdio.h> int main() { int ***r, **q, *p, i=8; p = &i; q = &p; r = &q; printf("%d, %d, %d\n", *p, **q, ***r); return 0; }
//Assume 16-bit: void main() { char *p; printf("%d %d ",sizeof(*p),sizeof(p)); }
#include<stdio.h> void fun(void *p); int i=100; int main() { void *vptr; vptr = &i; fun(vptr); return 0; } void fun(void *p) { int **q; q = (int**)&p; printf("%d\n", **q); }
What will be the output of the program? #include<stdio.h> int main() { char *str; str = "%d\n"; str++; str++; printf(str-2, 3000); return 0; }
void main() { int *j; { int i=10; j=&i; } printf("%d",*j); }
Will the following code compile? void main() { char *cptr,c; void *vptr,v; c=10; v=0; cptr=&c; vptr=&v; printf("%c%v",c,v); }
//Assume int is of 2 bytes, long is of 4 bytes void main() { char *p; int *q; long *r; p=q=r=0; p++; q++; r++; printf("%p...%p...%p",p,q,r); }
What will be the output of the program? #include<stdio.h> power(int**); int main() { int a=6, *aa; /* Address of 'a' is 1000 */ aa = &a; a = power(&aa); printf("%d\n", a); return 0; } power(int **ptr) { int b; b = **ptr***ptr; return (b); }
Which of the following statements correctly declare a function that receives a pointer to pointer to a pointer to a float and returns a pointer to a pointer to a pointer to a pointer to a float?
Which of the statements is correct about the program? #include<stdio.h> int main() { int i=10; int *j=&i; return 0; }
In the following program add a statement in the function fun() such that address of a gets stored in j? #include<stdio.h> int main() { int *j; void fun(int**); fun(&j); return 0; } void fun(int **k) { int a=10; /* Add a statement here */ }
Are the expressions *ptr++ and ++*ptr the same?
The following program reports an error on compilation. #include<stdio.h> int main() { float i=100, *j; void *k; k=&i; j=k; printf("%f\n", *j); return 0; }
Is there any difference between the following two statements? char *a=0; char *b=NULL;
Is the NULL pointer the same as an uninitialized pointer?
Which statement will you add in the following program to work it correctly? #include<stdio.h> int main() { printf("%f\n", log(36.0)); return 0; }
What will be the output of the program? #include<stdio.h> int main() { float *p; printf("%d\n", sizeof(p)); return 0; }
What will be the output of the program? #include<stdio.h> #include<math.h> int main() { printf("%f\n", sqrt(49.0)); return 0; }
What will be the output of the program? #include<stdio.h> #include<math.h> int main() { float n=1.54; printf("%f, %f\n", ceil(n), floor(n)); return 0; }
How would you round off a value from 2.75 to 3.0?
Point out the error in the following program. #include<stdio.h> int main() { void v = 0; printf("%d", v); return 0; }
What will be the output of the program? #include<stdio.h> void fun(int*, int*); int main() { int i=5, j=2; fun(&i, &j); printf("%d, %d", i, j); return 0; } void fun(int *i, int *j) { *i = *i**i; *j = *j**j; }
#include<stdio.h> void modify(int *p); int main() { int x = 10; modify(&x); printf("%d\n", x); return 0; } void modify(int *p) { *p = 20; }
#include<stdio.h> void swap(int *a, int *b); int main() { int x = 5, y = 10; swap(&x, &y); printf("%d %d\n", x, y); return 0; } void swap(int *a, int *b) { int temp = *a; *a = *b; *b = temp; }
#include<stdio.h> int main() { int arr[3] = {1, 2, 3}; int *ptr = arr; printf("%d %d\n", *(ptr+1), *(ptr+2)); return 0; }
#include<stdio.h> int main() { int i = 10; int *ptr = &i; printf("%p %p\n", (void*)&i, (void*)ptr); return 0; }
#include<stdio.h> int main() { char str[] = "Hello"; char *ptr = str; printf("%c %c\n", *(ptr+1), *(ptr+2)); return 0; }
#include<stdio.h> void increment(int *p) { (*p)++; } int main() { int x = 5; increment(&x); printf("%d\n", x); return 0; }
#include<stdio.h> int main() { int arr[2][2] = {{1, 2}, {3, 4}}; int *ptr = (int *)arr; printf("%d %d\n", *(ptr + 2), *(ptr + 3)); return 0; }
Name | Department | Attempts | MCQ Marks | |
Rajeswari K | rajii205125@gmail.com | CSE1 | 1 | 13 |
Amutha | amuthavenkat178@gmail.com | CSE1 | 1 | 13 |
Latha Rishi Mathi S | rishimathi1210@gmail.com | CSE1 | 1 | 12 |
S SHAHANA | shahana87780@gmail.com | CSE2 | 1 | 12 |
Benazeer Fathima M | 21ec016@psr.edu.in | ECE1 | 1 | 11 |
NANDHINI M | nanthininanthini708@gmail.com | CSE1 | 1 | 11 |
Sathyavathi S | 21ec085@psr.edu.in | ECE1 | 1 | 10 |
Raabiyathul Misria R | raabiyathulmisria2004@gmail.com | CSE2 | 1 | 10 |
Sudha S | sudhaganesan2003@gmail.com | CSE2 | 1 | 10 |
Nagajothi R | jothir239@gmail.com | CSE2 | 1 | 10 |
Nihariha K | nihariha1824@gmail.com | CSE2 | 1 | 10 |
Madhumathi | rmadhuvenus@gmail.com | CSE1 | 1 | 8 |
Revathi Vengatasamy | csrevathiv@gmail.com | CSE2 | 2 | 7 |
Haritha M | mharitha2604@gmail.com | Morning | 1 | 7 |
What will be the output of the following program? void main() { int c[] = {2.8, 3.4, 4, 6.7, 5}; int j, *p = c, *q = c; for (j = 0; j < 5; j++) { printf(' %d ', *c); ++q; } for (j = 0; j < 5; j++) { printf(' %d ', *p); ++p; } }
What does the following declaration mean? int (*ptr)[10];
In C, if you pass an array as an argument to a function, what actually gets passed?
What will be the output of the following program? void main() { int a[] = {10, 20, 30, 40, 50}, j, *p; for (j = 0; j < 5; j++) { printf('%d', *a); a++; } p = a; for (j = 0; j < 5; j++) { printf('%d ', *p); p++; } }
What will be the output of the program? #include<stdio.h> int main() { int a[5] = {5, 1, 15, 20, 25}; int i, j, m; i = ++a[1]; j = a[1]++; m = a[i++]; printf('%d, %d, %d', i, j, m); return 0; }
What will be the output of the program if the array begins at 65486 and each integer occupies 2 bytes? #include<stdio.h> int main() { int arr[] = {12, 14, 15, 23, 45}; printf('%u, %u\n', arr+1, &arr+1); return 0; }
What will be the output of the program? #include<stdio.h> int main() { static int a[2][2] = {1, 2, 3, 4}; int i, j; static int *p[] = {(int*)a, (int*)a+1, (int*)a+2}; for (i = 0; i < 2; i++) { for (j = 0; j < 2; j++) { printf('%d, %d, %d, %d\n', *(*(p+i)+j), *(*(j+p)+i), *(*(i+p)+j), *(*(p+j)+i)); } } return 0; }
What will be the output of the program? #include<stdio.h> int main() { static int arr[] = {0, 1, 2, 3, 4}; int *p[] = {arr, arr+1, arr+2, arr+3, arr+4}; int **ptr = p; ptr++; printf('%d, %d, %d\n', ptr-p, *ptr-arr, **ptr); *ptr++; printf('%d, %d, %d\n', ptr-p, *ptr-arr, **ptr); *++ptr; printf('%d, %d, %d\n', ptr-p, *ptr-arr, **ptr); ++*ptr; printf('%d, %d, %d\n', ptr-p, *ptr-arr, **ptr); return 0; }
What will be the output of the program? #include<stdio.h> int main() { int arr[1] = {100}; printf('%d\n', 0[arr]); return 0; }
What will be the output of the program? #include<stdio.h> int main() { float arr[] = {1.4, 0.3, 4.50, 6.70}; printf('%d\n', sizeof(arr)/sizeof(arr[0])); return 0; }
What will be the output of the program if the array begins 1200 in memory? #include<stdio.h> int main() { int a[] = {2, 3, 4, 1, 6}; printf('%u, %u, %u\n', a, &a[0], &a); return 0; }
Which of the following is the correct way to define the function fun() in the below program? #include<stdio.h> int main() { int a[3][4]; fun(a); return 0; }
Which of the following statements are correct about `6` used in the program? int num[6]; num[6]=21;
Which of the following statements are correct about an array?
Does mentioning the array name give the base address in all contexts?
Is there any difference in the following declarations? int f1(int arr[]); int f1(int arr[100]);
Are the expressions `arr` and `&arr` the same for an array of 10 integers?
What would be the equivalent pointer expression for referring to the array element `a[i][j][k][l][m]`?
What will be the output of the program? #include<stdio.h> int main() { int arr[2][2][2] = {10, 2, 3, 4, 5, 6, 7, 8}; int *p, *q; p = &arr[1][1][1]; q = (int*) arr; printf("%d, %d\n", *p, *q); return 0; }
What will be the output of the program assuming that the array begins at location 1002 and the size of an integer is 4 bytes? #include<stdio.h> int main() { int a[3][4] = { 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12 }; printf("%u, %u, %u\n", a[0]+1, *(a[0]+1), *(*(a+0)+1)); return 0; }
Set 1
Write a program to perform quick sort.
Write a program to find the Greatest Common Divisor (GCD) of two numbers using recursion
Set 2
Write a program to print the reverse of a given string.
Write a program to find all the permutations of a given string.
Set 3
Write a program to calculate the sum of all digits of a given number.
Write a program to find the longest substring without repeating characters in a given string.
Set 4
Write a program to find the factorial of a given number using recursion.
Write a program to generate Pascal’s Triangle up to n rows.
Set 5
Write a program to perform insertion sort.
Write a program to convert a given Roman numeral to its equivalent integer value.
Set 6
Write a program to find the maximum of three numbers entered by the user and find the sum of digits of max number.
Write a program to check if a given number is a palindrome without converting it to a string.
Set 7
Write a program to print all the prime numbers between 1 and n.
Write a program to find the first n numbers in the Fibonacci sequence that are also prime.
Set 8
Write a program to swap two numbers without using a temporary variable.
Write a program to find all Armstrong numbers in a given range [a, b].
Set 9
Write a program to perform quick sort.
Write a program to check if two given strings are anagrams of each other.
Set 10
Write a program to perform bubble sort.
Write a program to implement reverse a string.
Set 11
Write a program to reverse an integer (e.g., 1234 becomes 4321).
Write a program to perform merge sort.
Set 12
Write a program to count the frequency of each character in a given string.
Write a program to check if a given year is a leap year or not using nested if-else conditions.
Set 13
Write a program to print the sum of the first n natural numbers.
Write a program to determine if a given string can be rearranged to form a palindrome.
Set 14
Write a program to perform selection sort.
Write a program to find the intersection of two arrays and print the common elements.
Haritha M | mharitha2604@gmail.com | Morning | 1 | 31 |
Rajeswari K | rajii205125@gmail.com | CSE1 | 1 | 30 |
Sudha S | sudhaganesan2003@gmail.com | CSE2 | 1 | 30 |
Latha Rishi Mathi S | rishimathi1210@gmail.com | CSE1 | 1 | 27 |
Raabiyathul Misria R | raabiyathulmisria2004@gmail.com | CSE2 | 1 | 27 |
Benazeer Fathima M | 21ec016@psr.edu.in | ECE1 | 1 | 25 |
Madhumathi | rmadhuvenus@gmail.com | CSE1 | 1 | 25 |
Nagajothi R | jothir239@gmail.com | CSE2 | 1 | 25 |
Amutha | amuthavenkat178@gmail.com | CSE1 | 1 | 23 |
Revathi Vengatasamy | csrevathiv@gmail.com | CSE2 | 1 | 23 |
Sathyavathi S | 21ec085@psr.edu.in | ECE1 | 1 | 22 |
How will you print `\n` on the screen?
The library function used to reverse a string is:
Which of the following functions sets the first n characters of a string to a given character?
What will be the output of the following code? ```c void main() { char s[ ]="man"; int i; for(i=0;s[i];i++) printf("\n%c%c%c%c",s[i],*(s+i),*(i+s),i[s]); } ```
What will be the output of the following code? ```c void main() { char string[]="Hello World"; display(string); } void display(char *string) { printf("%s",string); } ```
If the two strings are identical, then `strcmp()` function returns:
Which of the following functions is used to find the first occurrence of a given string in another string?
Will the following code compile? ```c void main() { static char names[5][20]="pascal","ada","cobol","fortran","perl"; int i; char *t; t=names[3]; names[3]=names[4]; names[4]=t; for (i=0;i<=4;i++) printf("%s",names[i]); } ```
What will be the output of the following code? ```c #include <stdio.h> void main() { char s[]={'a','b','c','\n','c','\0'}; char *p,*str,*str1; p=&s[3]; str=p; str1=s; printf("%c",++*p + ++*str1-32); } ```
Which of the following functions is more appropriate for reading in a multi-word string?
Which of the following functions is correct for finding the length of a string?
What will be the output of the following code? ```c #include <stdio.h> #include <string.h> int main() { char str1[20] = "Hello", str2[20] = " World"; printf("%s\n", strcpy(str2, strcat(str1, str2))); return 0; } ```
What will be the output of the following code? ```c void main() { char *str1="abcd"; char str2[]="abcd"; printf("%d %d %d",sizeof(str1),sizeof(str2),sizeof("abcd")); } ```
What will be the output of the program ? #include<stdio.h> int main() { char p[] = "%d\n"; p[1] = 'c'; printf(p, 65); return 0; }
What will be the output of the program ? #include<stdio.h> #include<string.h> int main() { printf("%d\n", strlen("12345")); return 0; }
What will be the output of the program ? #include<stdio.h> int main() { printf(5+"Good Morning\n"); return 0; }
What will be the output of the program ? #include<stdio.h> #include<string.h> int main() { char str[] = "Ind\0\ROCKS\0"; printf("%s\n", str); return 0; }
What will be the output of the program If characters 'a', 'b' ,'c',’d’ ans enter are supplied as input? #include<stdio.h> int main() { void fun(); fun(); printf("\n"); return 0; } void fun() { char c; if((c = getchar())!= '\n') fun(); printf("%c", c); }
What will be the output of the program ? #include<stdio.h> int main() { printf("Ind", "ROCKS\n"); return 0; }
What will be the output of the program ? #include<stdio.h> char *names[] = { "Suresh", "Siva", "Sona", "Baiju", "Ritu"}; int i; char *t; t = names[3]; names[3] = names[4]; names[4] = t; for(i=0; i<=4; i++) printf("%s,", names[i]); return 0;
What will be the output of the program ? #include<stdio.h> #include<string.h> int main() { static char str1[] = "dills"; static char str2[20]; static char str3[] = "Daffo"; int i; i = strcmp(strcat(str3, strcpy(str2, str1)), "Daffodills"); printf("%d\n", i); return 0; }
What will be the output of the program ? #include<stdio.h> #include<string.h> int main() { static char s[] = "Hello!"; printf("%d\n", *(s+strlen(s))); return 0; }
What will be the output of the program ? #include<stdio.h> int main() { static char s[25] = "The cocaine man"; int i=0; char ch; ch = s[++i]; printf("%c", ch); ch = s[i++]; printf("%c", ch); ch = i++[s]; printf("%c", ch); ch = ++i[s]; printf("%c", ch); return 0; }
What will be the output of the program ? #include<stdio.h> int main() { int i; char a[] = "\0"; if(printf("%s", a)) printf("The string is empty\n"); else printf("The string is not empty\n"); return 0; }
If char=1, int=4, and float=4 bytes size, What will be the output of the program ? #include<stdio.h> int main() { char ch = 'A'; printf("%d, %d, %d", sizeof(ch), sizeof('A'), sizeof(3.14f)); return 0; }
If the size of pointer is 32 bits What will be the output of the program ? #include<stdio.h> int main() { char a[] = "Visual C++"; char *b = "Visual C++"; printf("%d, %d\n", sizeof(a), sizeof(b)); printf("%d, %d", sizeof(*a), sizeof(*b)); return 0; }
What will be the output of the program ? #include<stdio.h> int main() { char str1[] = "Hello"; char str2[10]; char *t, *s; s = str1; t = str2; while(*t=*s) *t++ = *s++; printf("%s\n", str2); return 0; }
What will be the output of the program ? #include<stdio.h> int main() { char str[50] = "Ind Test"; printf("%s\n", &str+2); return 0; }
What will be the output of the program ? #include<stdio.h> int main() { char str = "Ind Test"; printf("%s\n", str); return 0; }
What will be the output of the program ? #include<stdio.h> int main() { char str[] = "Nagpur"; str[0]='K'; printf("%s, ", str); str = "Kanpur"; printf("%s", str+1); return 0; }
What will be the output of the program ? #include<stdio.h> #include<string.h> int main() { char sentence[80]; int i; printf("Enter a line of text\n"); fgets(sentence, 80, stdin); for(i=strlen(sentence)-1; i >=0; i--) putchar(sentence[i]); return 0; }
What will be the output of the program ? #include<stdio.h> void swap(char *, char *); int main() { char *pstr[2] = {"Hello", "Ind Test"}; swap(pstr[0], pstr[1]); printf("%s\n%s", pstr[0], pstr[1]); return 0; } void swap(char *t1, char *t2) { char *t; t=t1; t1=t2; t2=t; }
If the size of pointer is 4 bytes then What will be the output of the program ? #include<stdio.h> int main() { char *str[] = {"Frogs", "Do", "Not", "Die", "They", "Croak!"}; printf("%d, %d", sizeof(str), strlen(str[0])); return 0; }
What will be the output of the program ? #include<stdio.h> int main() { char str1[] = "Hello"; char str2[] = "Hello"; if(str1 == str2) printf("Equal\n"); else printf("Unequal\n"); return 0; }
What will be the output of the program ? #include<stdio.h> int main() { char *p1 = "Ind", *p2; p2=p1; p1 = "TEST"; printf("%s %s\n", p1, p2); return 0; }
What will be the output of the program ? #include<stdio.h> #include<string.h> int main() { printf("%c\n", "abcdefgh"[4]); return 0; }
What will be the output of the program ? (Assume Hello string is stored in 65530) #include<stdio.h> int main() { printf("%u %s\n", &"Hello", &"Hello"); return 0; }
Which of the following statements are correct about the program below? #include<stdio.h> int main() { char str[20], *s; printf("Enter a string\n"); scanf("%s", str); s=str; while(*s != '\0') { if(*s >= 97 && *s <= 122) *s = *s-32; s++; } printf("%s",str); return 0; }
Which of the following statements are correct about the below declarations? char *p = "Ind"; char a[] = "Ind"; 1: There is no difference in the declarations and both serve the same purpose. 2: p is a non-const pointer pointing to a non-const string, whereas a is a const pointer pointing to a non-const pointer. 3: The pointer p can be modified to point to another string, whereas the individual characters within array a can be changed. 4: In both cases the '\0' will be added at the end of the string "Ind".
Which of the following statement is correct? strcmp(s1, s2) returns a number greater than 0 if s1<s2 strcmp(s1, s2) returns 1 if s1==s2 strcmp(s1, s2) returns a number less than 0 if s1>s2 strcmp(s1, s2) returns 0 if s1==s2
Will the program compile successfully? #include <stdio.h> int main() { char a[] = "Ind"; char *p = "TEST"; a = "TEST"; p = "Ind"; printf("%s %s\n", a, p); return 0; }
For the following statements will arr[3] and ptr[3] fetch the same character? char arr[] = "Ind Test"; char *ptr = "Ind Test";
What will be the output of the program? #include <stdio.h> int main() { static char *s[] = {"black", "white", "pink", "violet"}; char **ptr[] = {s+3, s+2, s+1, s}, ***p; p = ptr; ++p; printf("%s", **p+1); return 0; }
What will be the output of the program? #include <stdio.h> int main() { char *str; str = "%s"; printf(str, "K\n"); return 0; }
void main() { char *p; p="Hello"; printf("%c\n",*&*p); }
What will be the output of the program? #include <stdio.h> int main() { printf("%c\n", 5["IndTest"]); return 0; }
What will be the output of the program? #include <stdio.h> int main() { char *p; p="hell"; printf("%s\n", *&*p); return 0; }
Which statement will you add to the following program to ensure that the program outputs "Ind Test" on execution? #include <stdio.h> int main() { char s[] = " Ind Test "; char t[25]; char *ps, *pt; ps = s; pt = t; while(*ps) *pt++ = *ps++; /* Add a statement here */ printf("%s\n", t); return 0; }
What will be the output of the program? #include <stdio.h> int main() { void fun(char*); char a[100]; a[0] = 'A'; a[1] = 'B'; a[2] = 'C'; a[3] = 'D'; fun(&a[0]); return 0; } void fun(char *a) { a++; printf("%c", *a); a++; printf("%c", *a); }
What will be the output of the program? #include <stdio.h> int main() { char *s; char *fun(); s = fun(); printf("%s\n", s); return 0; } char *fun() { char buffer[30]; strcpy(buffer, "RAM"); return (buffer); }
What will be the output of the program? #include <stdio.h> int main() { char str[20] = "Hello"; char *const p=str; *p='M'; printf("%s\n", str); return 0; }
#include <stdio.h> void main() { register i=5; char j[]= "hello"; printf("%s %d",j,i); }
What will be the output of the program? #include <stdio.h> int main() { char ch; ch = 'A'; printf("The letter is "); printf("%c\n", ch >= 'A' && ch <= 'Z' ? ch + 'a' - 'A':ch); printf("Now the letter is "); printf("%c\n", ch >= 'A' && ch <= 'Z' ? ch : ch + 'a' - 'A'); return 0; }
void main() { printf("\nab"); printf("\bsi"); printf("\rha"); }
What will be the output of the program? #include <stdio.h> int main() { char str[] = "C-program"; int a = 5; printf(a > 1 ? "Ind Test\n" : "%s\n", str); return 0; }
Will the following code compile? void main() { int k = 1; printf("%d==1 is ""%s", k, k == 1 ? "TRUE" : "FALSE"); }
In the following program, how long will the for loop get executed? #include <stdio.h> int main() { int i; for(; scanf("%s", &i); printf("%d\n", i)); return 0; }
Which standard library function will you use to find the last occurrence of a character in a string in C?
What will be the output of the program? #include <stdio.h> #include <string.h> int main() { char dest[] = {98, 98, 0}; char src[] = "bbb"; int i; if((i = memcmp(dest, src, 2)) == 0) printf("Got it"); else printf("Missed"); return 0; }
It is necessary that for the string functions to work safely, the strings must be terminated with '\0'.
The prototypes of all standard library string functions are declared in the file string.h.
scanf() or atoi() function can be used to convert a string like "436" into an integer.
C Programming Topics
1. Introduction to C Programming
Arithmetic and Operators
- Arithmetic Operators
- C – Tokens
- Declaration Rules
- Relational & Logical Operators
Conditional Constructs and Loops
- If Conditional Construct
- If-else Conditional Construct
- Conditional Operator
- While Loop
- Nested While Loops
- For Loop
- Do-While Loop
- Break
- Continue
- Goto
- Switch
- Increment & Decrement Operators
Number Systems and Data Types
- Number Systems
- Introduction to Data Types
- Signed Char
- Unsigned Char
- Signed & Unsigned Short Int
- Signed & Unsigned Long Int
- Floating Data Type
- Sizeof Operator
Bitwise Operators
- Introduction to All Bitwise Operators
Functions and Storage Classes
- Introduction to Functions
- Functions Part 1
- Function Declarations
- Introduction & Auto Storage Class
- Static Storage Class
- Extern Storage Class
- Compilation Process
- Extern Multilevel File Programming Part 1
- Extern Multilevel File Programming Part 2
- Memory Segments
- Register
- Introduction to Recursion
- Static & Extern Recursion
- Runtime Stack Mechanism
Pointers
- Introduction to Pointers
- Operations Allowed on Pointers
- Sizeof Pointer
- Little & Big Endian Architectures
- Void Pointer
- Wild, Null Pointer
- Call by Value & Call by Address
- Dangling Pointer
- Recursion on Pointers
- Pointer to Pointers
Arrays
- Introduction to Arrays
- 1D Array Declarations and Initializations
- 1D Array Problems
- Advanced Problems on 1D Arrays
- 2D Arrays
- 3D Arrays
- Array of Pointers
- Examples on Array of Pointers
- Pointer to an Array
- Passing Array to a Function
- Initialization Rules
Strings
- Introduction to Strings
- Special Characters
- Char Representation
- NULL Char Representation
- 1D Strings
- String vs printf
- 2D Strings
- Pointer to Strings
- Introduction to string.h
- strcpy()
- strlen()
- strrev()
- Check if a String is a Palindrome
- strtok()
- Scanning a String
Structures, Unions, and Enums
- Introduction to Structures
- Structure Initialization
- Using Pointer Member in Structure
- Operations on Structure Variables
- Containership
- typedef
- Array of Structures
- Global, Local Structure Declarations
- Nested Structures
- Structure Padding
- Bit Fields – Part 1
- Union
- Enum
Miscellaneous Concepts
- const
- volatile
Dynamic Memory Allocation
- malloc()
- free()
- calloc()
- realloc()
- Why Dynamic Memory Allocation?
Preprocessor and Macros
- Introduction to Preprocessor, Macros
- Macro Part 2
- Macro Part 3
- Nested Macro
- Conditional Compilation
- File Inclusion
- Miscellaneous Macros
Other Operators
- Short-Hand Assignment Operators
- Comma Operator
Command Line Arguments
- Command Line Arguments
Function Pointers
- Function Pointers
File Handling
- Introduction to Files
- File Operations – Part 1
- File Operations – Part 2
Java Programming Topics
1. Introduction to Java
- What is Java?
- History of Java
- Features of Java
- Java Development Kit (JDK)
- Java Runtime Environment (JRE)
- Java Virtual Machine (JVM)
- Hello World Program in Java
Java Basics
- Data Types in Java
- Variables in Java
- Operators in Java
- Java Keywords
- Java Identifiers
- Java Literals
- Type Casting in Java
- Control Statements
- If-else Statements
- Switch Statement
- For Loop
- While Loop
- Do-while Loop
- Break and Continue Statements
Object-Oriented Programming (OOP) Concepts
- Introduction to OOPs
- Classes and Objects
- Constructors in Java
- Inheritance in Java
- Polymorphism
- Method Overloading
- Method Overriding
- Abstraction
- Abstract Classes
- Interfaces
- Encapsulation
- Access Modifiers (Public, Private, Protected, Default)
- Static Keyword
this
Keywordsuper
Keyword- Final Keyword
- Nested Classes
- Anonymous Classes
Exception Handling
- Introduction to Exceptions
- Types of Exceptions
- Try-Catch Block
- Multiple Catch Blocks
- Nested Try Blocks
- Finally Block
- Throw Keyword
- Throws Keyword
- Custom Exceptions
Java Collections Framework
- Introduction to Collections
- List Interface
- ArrayList
- LinkedList
- Vector
- Stack
- Set Interface
- HashSet
- LinkedHashSet
- TreeSet
- Queue Interface
- PriorityQueue
- Deque Interface
- Map Interface
- HashMap
- LinkedHashMap
- TreeMap
- Hashtable
- Collections Class Utility Methods
Java Strings
- Introduction to Strings
- String Methods
- StringBuffer Class
- StringBuilder Class
- String vs StringBuffer vs StringBuilder
- String Tokenizer
Multithreading in Java
- Introduction to Multithreading
- Creating Threads
- Extending Thread Class
- Implementing Runnable Interface
- Thread Life Cycle
- Thread Methods
- Thread Synchronization
- Inter-thread Communication
- Daemon Threads
- Thread Pooling
- What is the difference between ++i and i++ in C?
- Explain the purpose of static keyword in C.
- What are the different storage classes in C?
- How does the sizeof operator work?
- Write a C program to reverse a string without using library functions.
- What is the difference between struct and union in C?
- How do you handle memory allocation and deallocation in C?
- What is a dangling pointer and how can it be avoided?
- Explain the use of void pointers in C.
- Write a C program to find the factorial of a number using recursion.
- How do you pass arrays to functions in C?
- Explain the const keyword in C with an example.
- What is a segmentation fault and how can it be avoided?
- How do you define and use macros in C?
- What is pointer arithmetic? Give an example.
- Write a C program to implement a stack using an array.
- Explain the difference between strcmp and strcpy functions.
- What are header guards in C and why are they used?
- Write a C program to merge two sorted arrays into a single sorted array.
- What is the output of the following code?
#include <stdio.h>int main() { int x = 10; printf(“%d\n”, x++); printf(“%d\n”, ++x); return 0;}
- Explain how switch statements work in C.
- How does the return statement work in functions?
- Write a C program to find the sum of elements in an array.
- What is the difference between break and continue statements?
- How do you handle errors in C programs?
- Explain the difference between char, int, and float data types.
- Write a C program to check if a number is prime.
- What is the purpose of the enum keyword in C?
- How do you use fopen() and fclose() functions?
- What is the difference between printf and fprintf?
- Write a C program to implement a queue using linked list.
- Explain the concept of file handling in C with examples.
- What is a memory leak and how can it be prevented?
- How do you compare strings in C?
- Write a C program to count the number of vowels in a string.
- Explain the use of volatile keyword in C.
- What is the difference between malloc() and calloc() functions?
- Write a C program to find the maximum and minimum elements in an array.
- How does the sizeof operator work with arrays and structures?
- Explain how to use realloc() function in C.
- What is a null pointer and how is it used?
- Write a C program to implement binary search.
- What is the use of typedef in C?
- Explain the difference between ++i and i++ with examples.
- How can you avoid buffer overflow in C?
- What are the advantages and disadvantages of using pointers?
- Write a C program to print a pattern of stars.
- Explain the use of goto statement in C.
- How do you declare and initialize a multi-dimensional array?
- What is the purpose of static variables in functions?
- Write a C program to find the factorial of a number using a loop.
- Write a C program to check if a given number is a palindrome.
- Write a C program to sort an array of integers using bubble sort.
- Write a C program to implement matrix multiplication.
- Write a C program to find the greatest common divisor (GCD) of two numbers using recursion.
- Write a C program to reverse a string using pointers.
- Write a C program to find the sum of all elements in a 2D array.
- Write a C program to check if a given string is a valid email address.
- Write a C program to implement a simple calculator that performs addition, subtraction, multiplication, and division.
- Write a C program to count the frequency of each character in a given string.
- Write a C program to find and print the second largest element in an array.
- Write a C program to implement a circular queue using an array.
- Write a C program to merge two sorted linked lists into a single sorted linked list.
- Write a C program to find the longest common substring between two strings.
Scenario-Based Questions
All the answers are after question
- Technical Issue Resolution
- Scenario: You are working on a critical project, and the application you’re developing suddenly starts throwing errors in production. The team is under pressure to resolve the issue quickly.
- Question: How would you approach diagnosing and fixing the problem? What steps would you take to ensure that the issue is resolved without causing further disruptions?
- Project Management
- Scenario: You are leading a team of developers on a tight deadline for a new product launch. Halfway through the project, a key team member leaves the company, and the remaining team members are stressed about the increased workload.
- Question: How would you handle the situation to ensure the project stays on track? What strategies would you employ to manage team morale and redistribute the workload effectively?
- Client Requirements
- Scenario: A client requests a feature that seems to be outside the scope of the original project requirements and might impact the project’s deadline and budget.
- Question: How would you handle this request? What steps would you take to communicate with the client and manage their expectations while ensuring that the project remains within scope and budget?
- Team Conflict
- Scenario: Two team members have a disagreement about the approach to a problem. Their disagreement is starting to affect the team’s overall productivity.
- Question: How would you mediate the conflict and find a resolution that maintains team harmony and keeps the project on track?
- System Performance
- Scenario: After deploying a new update, you notice that the system’s performance has degraded significantly, affecting user experience.
- Question: What steps would you take to identify and resolve the performance issues? How would you ensure that similar problems do not occur in future deployments?
Situational-Based Questions
- Adapting to Change
- Situation: You are given a new technology stack to work with on a project, and you have little experience with it. The project has high visibility and is critical to the company’s success.
- Question: How would you go about learning and adapting to this new technology quickly to ensure you can contribute effectively to the project?
- Handling Ambiguity
- Situation: You are assigned to a project with vague requirements and incomplete documentation. Your manager is not available for clarification.
- Question: How would you proceed with the project? What strategies would you use to gather the necessary information and define clear requirements?
- Prioritizing Tasks
- Situation: You have multiple high-priority tasks with overlapping deadlines. One task is critical for a client presentation, while another is essential for internal performance improvements.
- Question: How would you prioritize your tasks and manage your time effectively to meet both deadlines? What factors would influence your decision-making?
- Feedback Implementation
- Situation: You receive critical feedback from a peer regarding your recent work on a project. The feedback highlights several areas for improvement.
- Question: How would you respond to this feedback? What steps would you take to address the issues and improve your work moving forward?
- Resource Constraints
- Situation: Your project is running low on resources, including both budget and personnel, and you are nearing the deadline.
- Question: How would you handle the situation? What actions would you take to complete the project successfully despite the constraints?
Behavioral-Based Questions
- Problem-Solving
- Question: Can you describe a time when you faced a significant challenge in a project? How did you approach solving the problem, and what was the outcome?
- Leadership
- Question: Tell me about a time when you had to lead a team through a difficult situation. How did you motivate the team and ensure the project was completed successfully?
- Team Collaboration
- Question: Describe a situation where you had to work closely with a difficult team member. How did you manage the relationship and ensure effective collaboration?
- Time Management
- Question: Provide an example of how you managed multiple priorities or projects simultaneously. How did you ensure that all tasks were completed on time and to a high standard?
- Conflict Resolution
- Question: Can you give an example of a conflict you encountered in the workplace and how you resolved it? What was the impact of your approach on the team or project?
Scenario-Based Questions
- Technical Issue Resolution
- Answer: I would start by gathering as much information as possible about the errors, including any recent changes made to the application. I would check logs and use debugging tools to identify the root cause. Next, I would communicate with the team to discuss potential solutions and apply a fix. I would test the solution in a staging environment before deploying it to production. After resolving the issue, I would conduct a post-mortem to understand what went wrong and how we can prevent similar issues in the future.
- Project Management
- Answer: I would assess the impact of the team member’s departure on the project and re-evaluate the remaining team members’ strengths and workloads. I would redistribute tasks based on their expertise and availability, and potentially bring in temporary resources if necessary. I would hold a team meeting to address concerns and boost morale, ensuring open communication and support. To keep the project on track, I would adjust timelines and priorities as needed and keep stakeholders informed.
- Client Requirements
- Answer: I would first discuss the new request with the client to understand their needs and explain how it might impact the project’s timeline and budget. I would evaluate the feasibility of the request with my team and propose a revised plan that includes the new feature if possible. If the request cannot be accommodated within the original scope, I would suggest alternative solutions or a phased approach. I would document any changes to the scope and adjust the project plan accordingly.
- Team Conflict
- Answer: I would arrange a meeting with the conflicting team members to understand their perspectives and the root of the disagreement. I would encourage open communication and collaboration to find a compromise or a solution that aligns with the project’s goals. If necessary, I would mediate the discussion and guide the team toward a decision. I would also monitor the team’s dynamics to ensure the conflict does not reoccur and address any underlying issues.
- System Performance
- Answer: I would begin by profiling the application to identify performance bottlenecks and analyze recent changes that could have affected performance. I would use performance monitoring tools to diagnose the issue and apply optimization techniques to address the problem. After implementing the fixes, I would test the system thoroughly to ensure performance improvements. I would also review the deployment process and monitoring setup to prevent similar issues in the future.
Situational-Based Questions
- Adapting to Change
- Answer: I would start by researching and learning about the new technology through documentation, online resources, and tutorials. I would seek guidance from colleagues or experts who are familiar with the technology. To quickly get up to speed, I would work on small, manageable tasks or prototypes using the new technology. I would also attend any available training sessions or workshops. By focusing on practical applications and hands-on experience, I would ensure that I can contribute effectively to the project.
- Handling Ambiguity
- Answer: I would start by identifying and documenting the key aspects of the project that need clarification. I would seek input from stakeholders, review existing documentation, and reach out to colleagues who might have insights. If necessary, I would create a draft plan based on available information and outline potential areas of uncertainty. I would communicate regularly with stakeholders to get feedback and make adjustments as needed. Throughout the project, I would remain flexible and adapt to new information as it becomes available.
- Prioritizing Tasks
- Answer: I would assess the urgency and impact of each task and prioritize them accordingly. I would use project management tools to organize tasks and set clear deadlines. For the critical task related to the client presentation, I would allocate dedicated time and resources to ensure it is completed on time. I would also delegate or adjust the timeline for the internal performance improvement tasks as needed. Regularly reviewing progress and adjusting priorities would help manage both tasks effectively.
- Feedback Implementation
- Answer: I would approach the feedback with an open mind and view it as an opportunity for improvement. I would review the feedback carefully to understand the specific areas that need attention. I would then create an action plan to address the issues, including setting goals and deadlines for making improvements. I would seek additional input from the person who provided the feedback, if necessary, to ensure I am on the right track. Finally, I would implement the changes and follow up to ensure that the improvements meet the expected standards.
- Resource Constraints
- Answer: I would start by assessing the critical tasks and determining which ones are essential for project completion. I would prioritize these tasks and identify any possible ways to streamline or optimize them. I would communicate with stakeholders about the resource constraints and renegotiate deadlines or scope if necessary. I would also look for ways to increase efficiency, such as automating repetitive tasks or seeking additional support from other departments. Regular progress reviews and adjustments would help ensure the project remains on track.
Behavioral-Based Questions
- Problem-Solving
- Answer: In a previous project, I faced a challenge where our application was experiencing unexpected crashes. I started by gathering data from error logs and conducting a thorough code review. I identified a memory leak as the root cause. To solve the problem, I refactored the code to manage memory more efficiently and ran extensive tests to ensure stability. The application’s performance improved significantly, and we successfully met the project deadline.
- Leadership
- Answer: As a team lead, I once managed a project where we faced a tight deadline and technical challenges. I held regular team meetings to address issues and provided support and guidance. I also recognized individual contributions and kept the team motivated by celebrating small milestones. By maintaining clear communication and focusing on team strengths, we completed the project successfully and received positive feedback from the client.
- Team Collaboration
- Answer: I once worked with a team member who was challenging to collaborate with due to differing opinions on project approaches. I scheduled one-on-one meetings to understand their perspective and find common ground. I encouraged open dialogue and suggested a compromise that incorporated elements from both viewpoints. This approach improved our working relationship and allowed us to complete the project more effectively.
- Time Management
- Answer: In a previous role, I managed multiple projects with overlapping deadlines. I used a project management tool to create a detailed schedule and prioritized tasks based on deadlines and impact. I set aside dedicated time blocks for each project and delegated tasks where possible. Regular check-ins and adjustments helped me stay on track and meet all deadlines without compromising quality.
- Conflict Resolution
- Answer: I encountered a conflict with a colleague over differing approaches to a project. I initiated a discussion to understand their viewpoint and expressed my own concerns respectfully. We agreed to collaborate on a combined solution that addressed both perspectives. By focusing on the project’s goals and maintaining open communication, we resolved the conflict and worked together effectively.