Junior C Developer Interview Questions

186 junior c developer interview questions shared by candidates

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] */

What will be printed to the Console at the end of this code? int global = 0; Thread t1 = new Thread(() => { int local = 0; while(global < 3) { local += 1; global += 1; } Console.WriteLine(local); }); Thread t2 = new Thread(() => { global += 1; }); t1.Start(); t2.Start();
avatar

Junior C# and .NET developer

Interviewed at NiCE

3.9
Jun 6, 2024

What will be printed to the Console at the end of this code? int global = 0; Thread t1 = new Thread(() => { int local = 0; while(global < 3) { local += 1; global += 1; } Console.WriteLine(local); }); Thread t2 = new Thread(() => { global += 1; }); t1.Start(); t2.Start();

Viewing 181 - 190 interview questions

Glassdoor has 186 interview questions and reports from Junior c developer interviews. Prepare for your interview. Get hired. Love your job.