C Software Developer Interview Questions

3,507 c software developer interview questions shared by candidates

Implement a console application which is able to read log files with various sizes (tens or hundreds megabytes) and able to filter out lines which do not satisfy a simple regular expression filter (the '*' and '?' operators): - asterisk symbol '*' means a sequence of all symbols with unlimited length or no symbols - question mark symbol '?' means any single symbol - it should be possible to have multiple operators in a filter, e.g. "*text?1*", "*****text", "test??" - if no operators specified the line should be a complete match to specified filter The application should deal only with ANSI characters (no Unicode support required). Examples: - Filter "*test*" - should select lines which contain "test" and can have any or no symbols at the beginning or the end, example log entries: "test", "test123", "123test", "123test123" - Filter "test?" - should select lines which contain "test" and any single character after it, e.g. "test1" - Filter "test" - should select lines which is a complete match to "test" The application should implement a class with following interface: class LogReader final { public: LogReader(...); // parameters are up to implementation ~LogReader(); // should open the file, true in case of success, false in case of an error bool Open(...); // parameters are up to implementation // should close the file void Close(); // sets the mask for filtering the log lines, returns false in case of an error bool SetFilterMask(const char* mask); // Retrieves the next line from file which matching the filter mask // the buffer - where the line will be written, buffer_size - is max buffer size // Function will return false in case of an error or end of file is reached bool GetNextLine(char* buffer, const int buffer_size); }; Requirement for project: 1. Target platform: Windows 7 and above. 2. The code should be simple, easy to read and reason about and possible to extend in the future. For example adding new mask symbols/patterns. 3. The Application should take as an input 2 parameters, the path to the log file and a mask, e.g. "filter_app.exe test.log test*". 4. It should be possible to open the project in Visual Studio 2017 and above 5. Use of STL is allowed, although use of std::regex is not allowed. 6. Use C++17 as a maximum allowed standard. 7. Use of exceptions is allowed. 8. The application shouldn't use too much memory in case input files are quite big.
avatar

C++ Developer

Interviewed at Playtech

3.6
Aug 11, 2023

Implement a console application which is able to read log files with various sizes (tens or hundreds megabytes) and able to filter out lines which do not satisfy a simple regular expression filter (the '*' and '?' operators): - asterisk symbol '*' means a sequence of all symbols with unlimited length or no symbols - question mark symbol '?' means any single symbol - it should be possible to have multiple operators in a filter, e.g. "*text?1*", "*****text", "test??" - if no operators specified the line should be a complete match to specified filter The application should deal only with ANSI characters (no Unicode support required). Examples: - Filter "*test*" - should select lines which contain "test" and can have any or no symbols at the beginning or the end, example log entries: "test", "test123", "123test", "123test123" - Filter "test?" - should select lines which contain "test" and any single character after it, e.g. "test1" - Filter "test" - should select lines which is a complete match to "test" The application should implement a class with following interface: class LogReader final { public: LogReader(...); // parameters are up to implementation ~LogReader(); // should open the file, true in case of success, false in case of an error bool Open(...); // parameters are up to implementation // should close the file void Close(); // sets the mask for filtering the log lines, returns false in case of an error bool SetFilterMask(const char* mask); // Retrieves the next line from file which matching the filter mask // the buffer - where the line will be written, buffer_size - is max buffer size // Function will return false in case of an error or end of file is reached bool GetNextLine(char* buffer, const int buffer_size); }; Requirement for project: 1. Target platform: Windows 7 and above. 2. The code should be simple, easy to read and reason about and possible to extend in the future. For example adding new mask symbols/patterns. 3. The Application should take as an input 2 parameters, the path to the log file and a mask, e.g. "filter_app.exe test.log test*". 4. It should be possible to open the project in Visual Studio 2017 and above 5. Use of STL is allowed, although use of std::regex is not allowed. 6. Use C++17 as a maximum allowed standard. 7. Use of exceptions is allowed. 8. The application shouldn't use too much memory in case input files are quite big.

What Happens: The interview process usually begins when a candidate submits a job application, resume, or CV. Recruiters or hiring managers review these documents to check if the applicant meets the basic qualifications. Purpose: To filter out unqualified applicants and identify candidates who possess the necessary skills and experience.

C#/Unity Developer

Interviewed at Squad Cell

Oct 15, 2024

What Happens: The interview process usually begins when a candidate submits a job application, resume, or CV. Recruiters or hiring managers review these documents to check if the applicant meets the basic qualifications. Purpose: To filter out unqualified applicants and identify candidates who possess the necessary skills and experience.

Viewing 1891 - 1900 interview questions

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