4 ms·
> I mean the absolute basics Which are...? I'm guessing, depending on the niche you work in, your basics are very different from many other niche's C++ basics
by _gabe_ 3y ago
> I mean the absolute basics
Which are...?
I'm guessing, depending on the niche you work in, your basics are very different from many other niche's C++ basics. If you're working in FPGA development you'll have very different basics then a fintech. Likewise, game development is very different from backend web dev. C++ at Facebook is probably very different from C++ at Microsoft. Microsoft Kernel development C++ is probably very different from Microsoft Windows 11 adware C++.
I'm glad that interviewers exist that think they can pwn the interviewee by quizzing them on the "extreme basics", because it's an immediate red flag to me that the interviewer is acting with extreme hubris to claim that such a thing exists at all. I go back to this all the time, but when the guy who has literally been writing entire books on the esoteric features of C++ for 20 years says he doesn't trust himself to evaluate potential errata[0], I highly doubt any single person is capable of understanding the voluminous pitfalls and complexities of this large, bolted, amalgamation of a language.
[0]: https://scottmeyers.blogspot.com/2018/09/the-errata-evaluation-problem.html?m=1 https://scottmeyers.blogspot.com/2018/09/the-errata-evaluati...
- acedTrex 3y agoI mean i'd assume absolute basic things like "what is a pointer vs a reference." Or "what is the stack."
- yeputons 3y ago> Which are...? I guess they're different for different interviewers. The one I would use is something about undefined behavior. I mean, the fact that it exists and consequences. For example: "this program works, but if I add this line of code at the very end, the program crashes. Can be I sure that it crashed because of that line or some incorrect inputs to that line?" In (almost) all other languages the answer is "Yes". Not in C++ or C. You may have a faulty program in the first place that just happen to not crash. All other quirks and syntax can be picked up when needed. You can play around and investigate. But undefined behavior requires one to think and debug in a very different mindset. One cannot assume that a program that does not crash and gives a correct answer will do that if extended.
- krona 3y agoOr, compile with -fsanitize=undefined...
- compiler-guy 3y agoubsan is awesome, but it's not too hard to construct programs that contain undefined behavior that -fsanitize=undefined won't catch.
- yeputons 3y agoIt only helps so much. I've taught to freshmen students who have personally encountered dozens of different false positives and false negatives not only with sanitizers, but with compiler warnings as well. Nothing extraordinary, just `-Wall -Wextra -Werror` with the latest available GCC/Clang on the latest available Ubuntu LTS. Some examples (some library bugs are also included): https://gcc.gnu.org/bugzilla/show_bug.cgi?id=98677 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=98677 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=105729 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=105729 https://github.com/llvm/llvm-project/issues/59432 https://github.com/llvm/llvm-project/issues/59432 https://github.com/boostorg/dll/issues/30 https://github.com/boostorg/dll/issues/30 https://github.com/boostorg/asio/commit/71964b22c7fade69cc4caa1c869a868e3a32cc97 https://github.com/boostorg/asio/commit/71964b22c7fade69cc4c... https://github.com/chriskohlhoff/asio/issues/997 https://github.com/chriskohlhoff/asio/issues/997 I've also seen fun examples of a program working with all sanitizers in 14 modes across 3 OSes (GCC and Clang on Ubuntu, Apple Clang on macOS, Visual Studio on Windows), and _only_ failing with Visual Studio Release mode. It was an array overflow. Just was not caught by sanitizers. Mind you: no weird C++ magic, just standard coding exercises.
- maldev 3y agoYou're confusing the STL with C++. Kernel C++, Gamedev C++, Appdev C++ are all mostly the same. There's some small things like, you can't have a global constructor in the kernel. But all the same language features are the same. What does change is the STL. Asking someone what a constructor is, or templates, or auto, or ConstExpr, ConstInit, ConstEval and the differences. It's the exact same code on any format or machine. Asking someone what a "Unique_ptr" or "Ranges" or whatever is a bit in the bullshit realm of an interview and should be shamed. But C++ is vastly seperated from the STL. And odds are in an interview, you can ask someone about their specific domain of c++ they use in most cases, since usually a win32 shop is going to interview win32 people.
- nemothekid 3y ago>Which are...? What is a smart pointer? Or if I'm sadistic, whats the difference between unique_ptr and shared_ptr? To me, smart pointers are one of the tells that you are actually writing C++, and not just C with classes. That said, testing syntax is generally awful and I only use to gauge someone's familiarity with the language (same with Go, I'll say what is a goroutine, but Go is easy enough to learn that it wouldn't factor into my decision unless the candidate was brazenly lying about past experience).
- Longhanks 3y agoUnderstanding the difference between single ownership and shared ownership is being _sadistic_? > To me, smart pointers are one of the tells that you are actually writing C++, and not just C with classes. To me, shared_ptr is one of the tells that you should be writing Go or something like that, and not just C++ with reference counting.
- nemothekid 3y ago>is being _sadistic_ It's moreso I've had so many interviews crash on this question that I've started to feel bad for asking it (and starting to assume that, no they don't know C++). Most of these jobs we didn't even use C++, it was just identifying C++ engineers was usually a very strong signal, especially because we were early adopters into Rust.
- tragomaskhalos 3y agowell in one case I had to go right back to "how do you declare an integer variable?", which the candidate still didn't know how to do, before eventually admitting that their C++ experience was actually testing a system written in C++. That was an extreme example admittedly.
- grumpy_coder 3y agoIs that AAA game development, mobile game development or indie game development? All have different 'rules'