
Graph Data Structure Interview Questions - coder007
http://www.techiedelight.com/graphs-interview-questions/
======
throwaway2016a
While this is really interesting and I'll probably read through all of them
just to brush up on my graph knowledge... but "Interview Questions"?

Does anyone really ask you to write this kind of code in interviews? They feel
more like Computer Science homework questions.

~~~
wh-uws
Yeah honestly anything after number 6 (bfs and dfs to be more specific) you
would not be asked or really even have time for in an interview.

Unless of course you are interviewing for a graph heavy job.

Very interesting stuff though. Love graph algorithms have coded many myself in
JavaScript to prep for interviews.

edit source:

my algorithms code base test suite

[https://travis-ci.org/williscool/code_gym/jobs/129218676](https://travis-
ci.org/williscool/code_gym/jobs/129218676)

~~~
objclxt
> Love graph algorithms have coded many myself in JavaScript to prep for
> interviews.

...but have you coded any in JavaScript _after_ the interview as part of the
job? I suspect for most people the answer is no. It has always seemed strange
to me to ask a topic that you're never going to encounter during your day to
day work (yes, I know for some roles this isn't true).

~~~
closeparen
I think there's a general consensus that mastering the specific material you
would encounter in an undergraduate CS program proves you have the more
general cognitive skills necessary to succeed in any entry-level programming
job.

We just don't trust the university to say that you've done the projects and
sat the exams and demonstrated competence (what it's doing when it issues a
degree), so each company unwraps that abstraction and runs its own projects
and exams on the same material. But it is fundamentally based on college
curricula.

Trusting universities is likely out of the question. Eventually, I expect the
industry will create something like the Bar Exam so each candidate can pass a
_trusted_ test _once_ upon graduation (or even without going to college),
rather than creating the burden for each company to do all that grading.

------
gavinh
A candidate's performance on these questions is probably not indicative of his
or her performance at your iPhone fart app company.

------
75dvtwin
just in July of 2016, an unnamed hedge-fund was hiring architect/programmers.
After a brief review of my resume (I have been in sr management and sr
architecture roles for 17 of 25 years, but also code at home) -- was asked to
take an online coding test.

The coding test was 2 hours through a interview/code website (forgot the
name). They monitored your keystrokes and report to the interviewer when open
tabs on web-browser outside of their window. (I can dig and recall what that
website was if others are interested).

The coding problem was basically masqueraded Union Find graph problem. I knew
that after about 2 minutes of 'browsing' (as I can translate a functional ask
into an existing pattern that's already solved).

[http://www.geeksforgeeks.org/union-find/](http://www.geeksforgeeks.org/union-
find/)

Still went ahead trying to implement this by hand.. and failed. So did not get
a job.

~~~
throwaway_374
Almost certainly TwoSigma.

------
coder007
On related topic (not necessarily graph):

DFS Interview Questions - [http://www.techiedelight.com/dfs-interview-
questions/](http://www.techiedelight.com/dfs-interview-questions/)

BFS Interview Questions - [http://www.techiedelight.com/bfs-interview-
questions/](http://www.techiedelight.com/bfs-interview-questions/)

------
drfuchs
Um, the graph doesn't match the given list of vertices and edges. At all. In
the very first paragraph.

Added later: they fixed it. Quietly.

~~~
Jtsummers
Unless I missed something, it matches if you don't treat it as a directed
graph. Edge (1,6) accounts for both (1,6) and (6,1) in that case.

~~~
awesomepantsm
You didn't miss anything. This is why these are good interview questions,
because it weeds out the people who are asleep.

------
Entalpi
The problem with these "interview questions" is that knowing a algorithms
inside out is not how you solve problems it is how yiu solve A SPECIFIC
problem. The problemsolving skill comes from the reductions one can make and
thus apply different algorithms in order to solve a new problem.

------
mooneater
Much more applicable than knowing how to implement these techniques, would be
knowledge of "how to solve given realworld problems with these concepts". It
is likely a developer would have access to optimized libraries implementing
these, and would need to know when they apply.

------
asitdhal
The only questions an interviewer can ask is how to build a graph and do graph
operation(to test data structure skill). Graph Theory is too specific and many
programmers never use any graph algorithms in their life.

You can always ask these questions to reject a candidate because you don't
like his body odor.

