C Developer Interview Questions

3,500 c developer interview questions shared by candidates

1- Deep discussion on current project as role offered was also of same type. 2- Smart pointer discussion, write the code for same. I wrote for int, then they asked for generic one with template. 3- why operators needs to overload in smart pointer class. 4 -in normal pointers, why do we need to give type of pointer even if they store only numeric data that is address. 5- singleton class concept, write code for the same. 6-How do we restrict creation of object in heap? 7- Write copy constructor body, why do we need? 8- Difference between vector and list. Which one is good and why ? 9- internal implementation of map, set and unordered map. 10- difference between map and unordered map 11- write a program to print pair of elements whose sum is 10 from given set of array elements. 12- sql: find third highest unique salary from employee table
avatar

Macro FX Trade BTS developer C++

Interviewed at Barclays

4
Mar 23, 2023

1- Deep discussion on current project as role offered was also of same type. 2- Smart pointer discussion, write the code for same. I wrote for int, then they asked for generic one with template. 3- why operators needs to overload in smart pointer class. 4 -in normal pointers, why do we need to give type of pointer even if they store only numeric data that is address. 5- singleton class concept, write code for the same. 6-How do we restrict creation of object in heap? 7- Write copy constructor body, why do we need? 8- Difference between vector and list. Which one is good and why ? 9- internal implementation of map, set and unordered map. 10- difference between map and unordered map 11- write a program to print pair of elements whose sum is 10 from given set of array elements. 12- sql: find third highest unique salary from employee table

Normalize a file path/directory: /// /// /// Normalizes the path, meaning that you reduce any unnecessary directory. /// For example, given the value notneeded1/notneeded2/../../hello you would /// return hello. /// /// /// input string /// Normalized string /* * Sample Directory structure * - home * -- documents * -- desktop * -- myMedia * ----- photos * ----- videos * ----- music * -- downloads * /home/myMedia/photos/../../documents -> /home/documents * /home/myMedia/photos/../documents/.. -> /home/myMedia * /home/myMedia/../documents -> /home/documents * ../home -> ../home * home/../../final -> ../final * /home/myMdeia/documents -> /home/myMdeia/documents * Case 1: * C:\ [current working directory] * cd hello [command operating on cwd] * C:\hello [final path] * Case 2: * C:\ [current working directory] * cd notneeded1/notneeded2/../../hello [command operating on cwd] * C:\hello [final path] */
avatar

Junior Software Developer (C++)

Interviewed at Accelya Group

3.4
Aug 15, 2024

Normalize a file path/directory: /// /// /// Normalizes the path, meaning that you reduce any unnecessary directory. /// For example, given the value notneeded1/notneeded2/../../hello you would /// return hello. /// /// /// input string /// Normalized string /* * Sample Directory structure * - home * -- documents * -- desktop * -- myMedia * ----- photos * ----- videos * ----- music * -- downloads * /home/myMedia/photos/../../documents -> /home/documents * /home/myMedia/photos/../documents/.. -> /home/myMedia * /home/myMedia/../documents -> /home/documents * ../home -> ../home * home/../../final -> ../final * /home/myMdeia/documents -> /home/myMdeia/documents * Case 1: * C:\ [current working directory] * cd hello [command operating on cwd] * C:\hello [final path] * Case 2: * C:\ [current working directory] * cd notneeded1/notneeded2/../../hello [command operating on cwd] * C:\hello [final path] */

Viewing 3431 - 3440 interview questions

Glassdoor has 3,500 interview questions and reports from C developer interviews. Prepare for your interview. Get hired. Love your job.