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] */
Software Developer C Interview Questions
1,018 software developer c interview questions shared by candidates
Q1. Quick sort algorithm and Merge sort algorithm and which one is better on linked list. Q2. Dynamic memory allocation and use cases of malloc, calloc, realloc and new. Q3. Some codes were given on pointers and few questions were asked. Q4. One Problem was given which required topological sort approach.
Extend your system with implementation of a simple additional requirement.
What was the most challenging project in your last job?
Implement the Singleton design pattern.
Hard to generalize, since every technical interview was completelly different. There was request to code something online, general C++ questions (constructors, destructors, casting, ...), found problem in code excerpt, network communication questions, ...
Operator Overloading question
Multithreading question regarding integer over/under flow, data races, etc…
Viewing 1011 - 1020 interview questions