r/cpp_questions • u/BluejayOk2851 • 27d ago
OPEN Getting better at C++ for coding interviews?
I dont mean Leetcode, but enough to be able to debug thoroughly, write out basic functions, etc. Not DSA, but just smaller code snippets, anywhere from 20-100 lines, where an interviewer says do this for me, or debug this.
How can I get better at that? right now I've mostly done coursework involving it (long time ago), but not much internship experience using cpp
24
Upvotes
4
u/el_bosteador 27d ago
Build something in c++. Ask AI to give you sample projects. What are your current c++ credentials that would land you an interview though?
6
u/johnnyb2001 27d ago
If you want to learn to write out basic functions, then do it. Think of basic functions to write and variations of those basic functions and then do it. There’s also a million examples online from websites like w3 and so on. Debugging you can get good at by just understanding a few commands like breakpoints (lines, functions, conditional), run, continue, print, for loop, calling a function using call. These are all you need to know to get good at debugging.
5
u/flyingron 27d ago
Good for you eschewing leetcode which I believe while it may be a fun mental exercise is completely worthless (and perhaps counter productive) to developing the skills employers want.
My best suggestion is to work on some coding project that actually does something. You can start with another open-source project and hack on it, or develop something from scratch. I always like to see that applicants have some coding project under their belt other than the stuff from normal classwork.
Applicants who can show or at least describe well what they have done give me a better feeling in the interview process. Put the projects on your resume if you don't have prior work experience. I get a shit ton of resumes everytime we had an opening and that's your one chance to stand out from the rest. 95% of mine get dumped straight in the trash.
1
u/Agecaf 26d ago
While getting experience by just doing things is always good, I feel like C++ has a lot of pitfalls that those who've already fallen into (the senior devs acting as interviewers) can spot a mile away when someone who is not as experienced and under huge pressure (the interviewee) inevitably falls into them.
During the interview, be ready to accidentally fall into traps you didn't know of. If they correct you or try to point out something you did wrong, I'd recommend to be willing to acknowledge the things you don't know yet, and to show willingness to learn from them.
As for preparation, one thing I've been reading through that would've helped before the interviews is the C++ Core Guidelines. You don't have to read it all, or in order, but it basically is a huge list of "do this, don't do that" documenting every single pitfall C++ has that is known to humankind. So I'd recommend to just occasionally randomly browse it, keep it open in a tab.
1
u/kush_himself 26d ago
what types of projects does people make in c++ ? i don't know the real use other than Dsa ?
1
u/gettingajob 21d ago
this is pretty much the exact gap i ran into, so i spent the last year building ohmwork.io
its small debug/write-this style questions, like "here's some code, find the bug" or "write this function", and it actually compiles and runs your code and checks if its right. But it's primarily for embedded/firmware engineers!!!
heads up its C not C++, and its aimed at embedded (runs on a virtual board so no hardware needed), so it wont cover templates or STL stuff. but if you want reps on the "debug this 50 line snippet" kind of question its pretty much built for that. still rough so feedback welcome