C Engineer Interview Questions

5,469 c engineer interview questions shared by candidates

1. Explain relation between thread and process. 2. What is Singleton design pattern 3. What are smart pointers 4. Difference between public,private,protected members 5. What are casting operators 6. Convert 100 to decimal 7. What is recursion 8. Benefits of weak pointers over shared pointers 9. I was asked to write a program which will take input of an expression and sort misplaced and overused parenthesis and return sentence with sorted parenthesis, e.g. input - ))(({}{ output - {(())}
avatar

C++ Developer

Interviewed at Barclays

4
Aug 6, 2020

1. Explain relation between thread and process. 2. What is Singleton design pattern 3. What are smart pointers 4. Difference between public,private,protected members 5. What are casting operators 6. Convert 100 to decimal 7. What is recursion 8. Benefits of weak pointers over shared pointers 9. I was asked to write a program which will take input of an expression and sort misplaced and overused parenthesis and return sentence with sorted parenthesis, e.g. input - ))(({}{ output - {(())}

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 5371 - 5380 interview questions

Glassdoor has 5,469 interview questions and reports from C engineer interviews. Prepare for your interview. Get hired. Love your job.