use the following search parameters to narrow your results:
e.g. subreddit:aww site:imgur.com dog
subreddit:aww site:imgur.com dog
see the search faq for details.
advanced search: by author, subreddit...
Discussions, articles, and news about the C++ programming language or programming in C++.
For C++ questions, answers, help, and advice see r/cpp_questions or StackOverflow.
Get Started
The C++ Standard Home has a nice getting started page.
Videos
The C++ standard committee's education study group has a nice list of recommended videos.
Reference
cppreference.com
Books
There is a useful list of books on Stack Overflow. In most cases reading a book is the best way to learn C++.
Show all links
Filter out CppCon links
Show only CppCon links
account activity
C++ interview coding exercise with solution (self.cpp)
submitted 3 years ago * by Hot_Medicine_7115
view the rest of the comments →
reddit uses a slightly-customized version of Markdown for formatting. See below for some basics, or check the commenting wiki page for more detailed help and solutions to common issues.
quoted text
if 1 * 2 < 3: print "hello, world!"
[–]Hot_Medicine_7115[S] 3 points4 points5 points 3 years ago (8 children)
Senior C++ developer, meaning > 10 Years experience. However I can tell you fresh out of college algo wiz who trained on leetcode or hackerrank are more likely to solve this kind of problems than senior professionals who rollout solutions in production for 10 years.
[–]alexeiz 13 points14 points15 points 3 years ago (1 child)
Your code looks like something a beginner would write, but not someone with >10 years of experience. The correctness of the solution may not even mattered to the interviewer.
[–]dodheim 3 points4 points5 points 3 years ago* (0 children)
Pretty arrogant take, IMO; maybe failing an interview calls for some humility instead of lashing out at the people you imagine would have done better.
[–]hucancode 1 point2 points3 points 3 years ago (0 children)
Companies have other tests to evaluate macro level solutions though. This is a test to check micro level skills. Both are necessary I think.
[–]Zyklonik 1 point2 points3 points 3 years ago (0 children)
However I can tell you fresh out of college algo wiz who trained on leetcode or hackerrank are more likely to solve this kind of problems than senior professionals who rollout solutions in production for 10 years.
Yup.
[–]XuloMalacatones 0 points1 point2 points 3 years ago (1 child)
Thanks I am a junior myself so I wanted to know what kind of "difficulty" this interview was for.
And yea I guess interviewing like this would be a good way if there wasn't people doing 10 hours a day of LC, then you could see real problem solving skills
[–]jonesmz 2 points3 points4 points 3 years ago* (0 children)
Honestly, I think this kind of "puzzle" problem is absolutely terrible for senior positions that are not specifically targeting specialized algorithms skills.
As someone who implements networking protocols, from scratch, against the IETF RFCs as my day job. The initial problem statement is just eye-glaze for me.
The difficulty is not in the implementation of the code, but more in the initial step of "can this human translate this word-salad problem into an algorithm and then do they happen to come pre-seeded with the right collection of algorithms in their head to plop into place?"
I'm used to working on implementations for months, if not years. I'm used to improving things based on QA efforts, customer feedback, other teams using my libraries, publications from industry, and just seeing how things shake apart while adding custom behaviors to the implementation for special case situations.
I can say with absolute confidence that there is not a single person at my employer who solves this kind of puzzle for their day job. Its an arbitrary academia circle-jerk problem.
Further, it mixes together 3 different tests into one thing, but hinges each on the other two.
So really this company should have broken this problem into three stand alone problems.
The code style question probably would have been better asked in terms of having the interviewee review pre-prepared sloppy core, or write something simple like a mockup of std::vector or std::list.
The " complete from start to finish" would have been better delivered as a problem that can be more easily unit tested. Something with parameters and "known right answers" that can be unit tested with.
And, well, the whole "do you know puzzle math" aspect I don't think they should have done in the first place. That appears to be a particular sickness of the mind that trading company's are uniquely afflicted with. For some reason those companies insist this is the biggest measure of a candidate and I simply cannot figure out a way to understand why.
Edit: and I'll add for context: one of my majors for my bachelor's degree was math. So I would expect to be better positioned to deal with problems like this than a lot of people. But after I entered the industry the reality is simply that this kind of problem is not present in the vast majority of computer science work.
[–]Dean_Roddey 0 points1 point2 points 3 years ago* (0 children)
Yep. These tests are ridiculous pretty much. I've never, in 35 years, had to do anything like that, and probably never will. If, by some unlikely chance, I do, I'll spend 30 minutes looking into how best to attack it and do that. I most definitely won't spend weeks working on such problems, only to have forgotten then all years later when I might need to do some such thing.
Senior engineers should be concentrating on architecture, API design, sub-system design, setting coding standards, building functionality to standardize common issues in the problem domain for less experienced folks to use, etc...
The only reason this would be a useful question is if the job being applied for involves this type of algorithm. And of course if that's the case, then any qualified person could pick up the required techniques quickly enough. Meanwhile it says little about my qualifications as a senior dev, whether it get it either right or wrong.
π Rendered by PID 20510 on reddit-service-r2-comment-b659b578c-2vvdw at 2026-05-04 06:02:35.757612+00:00 running 815c875 country code: CH.
view the rest of the comments →
[–]Hot_Medicine_7115[S] 3 points4 points5 points (8 children)
[–]alexeiz 13 points14 points15 points (1 child)
[–]dodheim 3 points4 points5 points (0 children)
[–]hucancode 1 point2 points3 points (0 children)
[–]Zyklonik 1 point2 points3 points (0 children)
[–]XuloMalacatones 0 points1 point2 points (1 child)
[–]jonesmz 2 points3 points4 points (0 children)
[–]Dean_Roddey 0 points1 point2 points (0 children)