c Interview Questions | Glassdoor

c Interview Questions

273

interview questions shared by candidates

c Interview Questions

Sort: Relevance Popular Date

How do you find the max depth of a binary tree?

5 Answers

What is a class?

4 Answers

Write a C function to define strstr(char *haystack, char * needle) to return the first occurrence of needle in haystack. Code must compile and execute.

4 Answers

Write a code to check whether partially filled sudoku is proper or not

5 Answers

Write a function that allows to convert a string to the corresponding number (i.e. implement the atoi() C function)

4 Answers

(Programming Language Test) When casting an object of a polymorphic class from a base class, which kind of cast executes only if it's is valid?

3 Answers

Given a set of Sentences containing lower case letters only, remove common phrases from each sentence. Here a phrase is defined by 3 or more consecutive words. E.g: S1 = "I my bye good"; S2 = "my bye good boy"; common phrase is: "my bye good" so the two sentence become S1 = "I"; s2 ="boy";

3 Answers

Find the vulnerabilities in this c code and exploit it: #include <stdio.h> int main() { int leet=0; char buf[80]; puts("Hello, What's your name?"); gets(buf); printf("Hello, %s!\n", buf); if(leet = 31337) { FILE *fp; fp = fopen("grades/my-grades.txt", "w"); fprintf(fp, "Sweet! I got some points!\n"); close(fp); } return 0; }

3 Answers

Given two base classes and a class derived from them how might one layout class instance memory so that polymorphism will work correctly. Problem was simplified in that one could assume memory was a series of same-sized slots and methods and attributes took up one slot each.

3 Answers

Write an application that maps out a large set of data in as little time as possible.

3 Answers
1120 of 273 Interview Questions