Identify memory leak: // this function has a memory leak. Can you find it? int i = 5; // <-- char *pszString = (char *)malloc(32); memset(pszString, 0, sizeof(32)); strcpy(pszString, "hi"); if (i > 5) { sprintf(pszString, "%i is greater than 5", i); printf("%s\n", pszString); free(pszString); } else if (i < 5) { sprintf(pszString, "%i is less than 5", i); printf("%s\n", pszString); free(pszString); } }
C Software Developer Interview Questions
396 c software developer interview questions shared by candidates
Count letters in a sentence omitting non alphabet characters: /// /// E.g given the // input string "Hello there!", print the output has to be 'h': 2 /// 'e': 3 'l': 2 'o': 1 't': 1 'r': 1 /// /// input The string containing the letters to count /// // Omit any character that is not in the English alphabet
prove angle subtended by a semicircle is a right angle
Do you know how to attach the debugger to the running process? Have you had prior experience with core dumps?
What do your colleagues think about you?
Come ti vedi tra 5 anni?
HR round - pretty straight forward. Reason for change? Why this position? What is the expectation? 2nd round - Solid basics from what is mentioned in the resume. C++ STL and Algorithms. 1 or 2 problem solving 3rd round - Design a system. C++ STL, Data Structures (I was asked related to optimal search)
What are the differences between value type and reference type?
Ereditarietà, metodo di allocamento di puntatori, classi private e protected,
No1: We kindly ask you to write two classes in C++ and send your code to us. One class shall be a matrix class and one shall be a vector class. Matrices and vectors shall be able to be multiplied. Addition and scalar multiplication shall be supported as well. No linear algebra functions are sought for (e.g. inverse, linear solving, svd etc.). The focus is on correctness, efficiency, and a clean and convincing software design - show us your C++ skills ;-) No 2: You are given a gray scale image which represent the oil distribution in a certain area (pixel value 0: 0 liters of oil, pixel value 255: 255 liters of oil). You can place 64 "drills" in this area. Each drill will extract the oil in a circular area of radius 25 pixels. Please try to find the optimal distribution for the drills, for each of the three images in this archive. Provide your solution as three text files with drill center coordinates, like the example file "drilling_plan_example.txt". You can check out the program "evaluate_plan.py" in this archive. It will be used used to evaluate your solution.
Viewing 131 - 140 interview questions