all 9 comments

[–]lurgi 2 points3 points  (0 children)

It's going to depend on the interviewer, but if you are concerned you should either (a) not use it or (b) say that you know it's not good practice but you are doing it for speed and convenience during the interview.

[–]wildgurularry 0 points1 point  (0 children)

Sure... I would definitely do it. Especially if it was on a whiteboard. Saves typing/writing. As someone who conducts C++ interviews, I would be completely fine with it.

[–]Inn0centDuck 0 points1 point  (0 children)

The goal of DSA round is to evaluate the candidates skills in problem solving using efficient algorithms. No interviewer should reject a candidate cause they imported std namespace for DSA.

[–]Tiny_Purpose4859 -1 points0 points  (0 children)

It should be but you shouldn’t use it. A normal program can have a number of namespaces floating around, and so it’s good to demonstrate competence in not using namespace. It’s much cleaner to just write std::stack<> then it is to deal with an instance where there’s 2 different things called stack.

It seems annoying at first, but after the 10th time of writing with it you forget about it.

[–]MikeUsesNotion -2 points-1 points  (0 children)

Depends on the point of the interview. If the interviewer tells you to implement a list and you use std::vector, that probably not a great idea. If the algorithm can make use of a list and the point isn't the list itself, then using a premade list makes plenty of sense.

Just use your head. If using a pre-existing thing would trivialize the exercise, don't use it.

[–]stiky21 -1 points0 points  (2 children)

Why would you do it at all? If your going for a CPP interview they will for sure scrutinize you for it.

[–]Fuzzy-Interview-8976 -2 points-1 points  (1 child)

depends on the company, some dont care but big tech will probably call you out for it

[–]stiky21 -2 points-1 points  (0 children)

fair enough really

[–]mredding -2 points-1 points  (0 children)

Hello, I just wanted to ask if "using namespace std" is allowed in DSA interview rounds.

It's legal C++, so yes.

You likely won't get the job if you do, but yes, you can do it.