<p>Computer science as practiced in an industrial setting is usually <em>applied</em> computer science. Outputs are typically products that consist largely of software, but may also involve hardware, documentation, publications, and patents. That means that pure computer science is enriched with elements of software engineering (an engineering discipline) and programming (a craft). As with other crafts, one becomes more proficient by <strong>practice</strong>, especially when doing so with guidance from a more senior practitioner, e.g. via code review.</p>
<p>Typical discoveries when transitioning from theory to working code are &quot;integers are not unbounded&quot; and &quot;floating-point arithmetic is not math&quot;, plus how many different ways one can commit off-by-one errors. An interesting account of one such exercise is given by R. Lesuisse, &quot;Some lessons drawn from the history of the binary search algorithm&quot;, <em>The Computer Journal</em>, Vol. 26, No. 2, 1983, pp. 154-163 (<a href="https://academic.oup.com/comjnl/article-pdf/26/2/154/880257/260154.pdf" rel="nofollow noreferrer">online</a>):</p>
<blockquote>
<p>Then, the important errors found in the 26 published algorithms are pointed out, with an attempt at discussing why these errors were made.</p>
</blockquote>
<p>One modern way to practice the craft of programming is to provide answers to questions posed on our companion site <a href="https://stackoverflow.com/">Stackoverflow</a>, especially when they include concise self-contained code with a test scaffold. This is one way how I as a retired software engineer with a CS degree try too keep my skills fresh. I highly recommend lurking on the site for a few weeks prior to writing a first answer to develop a feel for what are considered good and poor answers in this specific context.</p>
<p>Interview questions in an industrial setting that involve programming often use simple algorithmic concepts and simple data structures such tables, arrays, linked lists, or bit manipulation of integers. They are designed to be solved in a relatively brief amount of time, and besides testing basic algorithmic understanding tend to check whether an interviewee demonstrates reasonable fluency in the language of implementation. A starter question may be a simple as an implementation of <a href="https://en.wikipedia.org/wiki/Fizz_buzz" rel="nofollow noreferrer">FizzBuzz</a>, of which stories circulate that it trips up a fair number of candidates. If they are posed in an interactive setting, the questions may also be designed to assess how a candidate reacts to hints and guidance by the interviewer and allow on-the-fly adjustments to the degree of difficulty.</p>
<p>Interview question therefore frequently differ from questions posed in classical algorithm (text) books, and are covered by specialized publications such as Gayle Laakmann, <em>Cracking the Coding Interview</em> or Adnan Aziz and Amit Prakash, <em>Algorithms for Interviews</em>.</p>
<p>But working out answers to text book questions can help gain proficiency. When I studied CS in the 1980s, a starting point was provided by Niklaus Wirth's two books <em>Systematic Programming</em> and <em>Algorithms + Data Structures = Programs</em>, followed up by Aho, Hopcraft, Ullman <em>The Design and Analysis of Computer Programs</em>, David Gries <em>The Science of Programming</em>, and Jon Bentley's <em>Programming Pearls</em>. Of these, the books by Bentley and Wirth are closest to what one is likely to encounter in a programming interview. The book by Gries is mostly about constructing correct programs and probably the least helpful in the present context. However, all of them are showing their age four decades after first publication. My recommendation for a modern work would be Steven S. Skiena <em>The Algorithm Design Manual, 2nd ed.</em>.</p>

CC BY-SA 4.0
2022-05-10T01:39:29.683Z
2022-05-10T04:51:48.430Z
2022-05-10T04:51:48.430Z
njuffa
<p>As it is famous among programmers practice is the only key
first of all you should know some common algorithms which are handy when we solve problems and interview</p>
<p><a href="https://www.geeksforgeeks.org/most-important-type-of-algorithms/" rel="nofollow noreferrer">important-type-of-algorithms</a></p>
<p>then you should also <a href="https://www.geeksforgeeks.org/sorting-algorithms/" rel="nofollow noreferrer">sorting-algorithms</a>
you don't need to practice all you can google most common sorting algos</p>
<p>now comes the real beast
linked list, arrays trees and other Data Structures</p>
<p>to practice and learn them follwing resources are best known:</p>
<p><a href="https://neetcode.io/" rel="nofollow noreferrer">https://neetcode.io/</a></p>
<p><a href="https://leetcode.com/" rel="nofollow noreferrer">https://leetcode.com/</a></p>
<p><a href="https://www.hackerrank.com/" rel="nofollow noreferrer">https://www.hackerrank.com/</a></p>

CC BY-SA 4.0
2022-05-13T13:04:43.150Z
2022-05-13T13:04:43.150Z
shoaib sabir
<p>Find a project and chase it down, bit by bit. And keep it fun.  If you aren't enjoying the process you won't keep at it. Depending on disposition I would suggest an arcade style game, a machine learning project, or maybe picking up a micro controller and delving into physical computing. In general though, the more time you spend coding the more confident you will be during those interview tasks. He is a list of stuff to get you started in no particular order.</p>
<p><em><strong>Games -</strong></em> Having fun building skills</p>
<ol>
<li>Cargobot - This is a silly little game in iOS, where you use program blocks to move a loading robot around.  The hook is that the programs you develop lean heavily into recursion.</li>
<li>Human Resource Machine and 7 Billion Humans. Two more silly iOS games. These two focus on low level coding with 7 Billion Humans encouraging though in parallel processing.</li>
</ol>
<p><em><strong>Books -</strong></em> Digging Deep</p>
<ol>
<li>Algorithms in... a series of books by Robert Sedgewick that detail... well... algorithms. I have the C++ version on my shelf and page through it now and again when I want to make my head hurt.  If you have the time it is good practice to flip to a page at random and attempt to implement the algorithm listed.</li>
<li>Hitchhikers Guide to Programming Languages / Competitive Programming 3. Nothing like a good programming competition to get you thinking about how to improve your code. Both of these books discuss algorithms that pop up regularly at collegiate programming competitions. It is a great way to get a sampling of practical applications of algorithms.</li>
</ol>
<p><em><strong>Websites -</strong></em> Practice, Practice, Practice</p>
<ol>
<li>Codingbat.com - a website specifically designed to help people pass the coding challenges on job interviews</li>
<li>ProjectEuler.net - Problem solving in the extreme. Every problem produces a single number as the solution. Some you can do in your head, some may require a spread sheet, some require serious computational thinking.</li>
<li>open.Kattis.com - An active competition server with problems ranging from Hello World to How the Hell do you do that.</li>
<li>CodeWars.com - How fast can you solve the problems.  Pitting speed and creativity against others in live contests. The best part is that you can share you solution when each contest is done.</li>
</ol>
<p>It is worth saying again: Find a project, something fun, and chase it down. It will keep you going, and give you something to brag about during interviews.</p>
<p>Good luck.</p>

CC BY-SA 4.0
2022-05-10T13:13:22.280Z
2022-05-10T13:13:22.280Z
codingCat
<p>The way to learn something is to practice it. It is no different from yourself. Get a good book on algorithms, maybe one that is Python Specific or one more general. I've always liked David Gries' <em>The Science of Programming</em>, though it isn't strictly an algorithms book. But it has lots of exercises on algorithmic thinking.</p>
<p>But the key is to do all of the exercises in the book. If the book doesn't have lots of exercises then get a different one.</p>
<p>The classic book is <em>Data Structures and Algorithms</em> by Aho, Hopcroft, and Ullman, though it is a bit old now.</p>
<p>Neither of those is Python specific, which could be a good thing.</p>
<p>If you have a trusted colleague you might get them to look at and comment on some of your solutions. That feedback can be very valuable.</p>

CC BY-SA 4.0
2022-05-05T15:52:45.370Z
2022-05-05T15:52:45.370Z
Buffy
<p>It seems that you are a good researcher, but you have applied to the companies where the top most priority is coding. The first thing is the Object Oriented Programming and Data Structures. I have heard that google provides you some problems and then you need to do some code to solve it. Your code should be neat and clean and time efficient.</p>
<p>Now, as you are applying as a PhD candidate, but you did not mention your test experience.</p>
<p>But to gain experience in coding you need to pick a pen and paper. Pick any data structure and algorithms book and practice problems mentioned there. I advise you to do practice in Python as this will also help you in AI.</p>
<p>As you are doing research in AI then start paraticing Keras (Python Library) also this will help you to know OOPS concept very well.</p>

CC BY-SA 4.0
2022-05-08T20:06:07.750Z
2022-05-08T20:06:07.750Z
ZaHid
<p>I have a PhD in computer science (A fresh graduate). My bachelor's major is similar to CS but without algorithms (It's a discipline between business and CS).</p>
<p>I am quite good at AI research but my coding skills are not that good. I lost two AI research job offers, from Google and Amazon, because of my coding tests. All the other interviews were very good (as the HR staff told me).</p>
<p>How can I practice/learn algorithm coding and improve it? Is there a platform or a course that will help me with this?</p>
<p>Just to give you some intuition about my level. For instance, I know how the recursion function works, and I can solve basic problems, but when I face a new problem I find it hard to be solved.</p>

CC BY-SA 4.0
2022-05-05T17:15:00.453Z
There's a difference between learning algorithms in the context of CS theory and "hands on" algorithms necessary to pass job interviews. For example, learning a bunch of NP-reductions, compiler optimizations and FFT is great for the first category but basically useless for the second, which is more about utilizing basic data structures. Then there's competitive coding, which is sort of its own thing... maybe more pertinent to job interviews but not necessarily. So, just to clarify, you're interested in algorithm skills for interviews?
ggorlen
CC BY-SA 4.0
2022-05-05T17:18:02.510Z
@ggorlen I agree with you! yes exactly for interviews.
Minions
<programming><algorithms><python><recursion>
Suggestions to improve my algorithm coding skills
# Suggestions to improve my algorithm coding skills

(Asked by: username_0 on 2022-05-04)

I have a PhD in computer science (A fresh graduate). My bachelor's major is similar to CS but without algorithms (It's a discipline between business and CS).

I am quite good at AI research but my coding skills are not that good. I lost two AI research job offers, from Google and Amazon, because of my coding tests. All the other interviews were very good (as the HR staff told me).

How can I practice/learn algorithm coding and improve it? Is there a platform or a course that will help me with this?

Just to give you some intuition about my level. For instance, I know how the recursion function works, and I can solve basic problems, but when I face a new problem I find it hard to be solved.

**Tags:** programming, algorithms, python, recursion

> **Comments:**
> **username_1**: There's a difference between learning algorithms in the context of CS theory and "hands on" algorithms necessary to pass job interviews. For example, learning a bunch of NP-reductions, compiler optimizations and FFT is great for the first category but basically useless for the second, which is more about utilizing basic data structures. Then there's competitive coding, which is sort of its own thing... maybe more pertinent to job interviews but not necessarily. So, just to clarify, you're interested in algorithm skills for interviews?  
> **username_0**: @username_1 I agree with you! yes exactly for interviews.  

---

## 5 answers

### Answer by username_4 on 2022-05-10. Score: 4

Find a project and chase it down, bit by bit. And keep it fun. If you aren't enjoying the process you won't keep at it. Depending on disposition I would suggest an arcade style game, a machine learning project, or maybe picking up a micro controller and delving into physical computing. In general though, the more time you spend coding the more confident you will be during those interview tasks. He is a list of stuff to get you started in no particular order.

***Games -*** Having fun building skills

1. Cargobot - This is a silly little game in iOS, where you use program blocks to move a loading robot around. The hook is that the programs you develop lean heavily into recursion.
2. Human Resource Machine and 7 Billion Humans. Two more silly iOS games. These two focus on low level coding with 7 Billion Humans encouraging though in parallel processing.

***Books -*** Digging Deep

1. Algorithms in... a series of books by Robert Sedgewick that detail... well... algorithms. I have the C++ version on my shelf and page through it now and again when I want to make my head hurt. If you have the time it is good practice to flip to a page at random and attempt to implement the algorithm listed.
2. Hitchhikers Guide to Programming Languages / Competitive Programming 3. Nothing like a good programming competition to get you thinking about how to improve your code. Both of these books discuss algorithms that pop up regularly at collegiate programming competitions. It is a great way to get a sampling of practical applications of algorithms.

***Websites -*** Practice, Practice, Practice

1. Codingbat.com - a website specifically designed to help people pass the coding challenges on job interviews
2. ProjectEuler.net - Problem solving in the extreme. Every problem produces a single number as the solution. Some you can do in your head, some may require a spread sheet, some require serious computational thinking.
3. open.Kattis.com - An active competition server with problems ranging from Hello World to How the Hell do you do that.
4. CodeWars.com - How fast can you solve the problems. Pitting speed and creativity against others in live contests. The best part is that you can share you solution when each contest is done.

It is worth saying again: Find a project, something fun, and chase it down. It will keep you going, and give you something to brag about during interviews.

Good luck.


---

### Answer by username_5 on 2022-05-05. Score: 3

The way to learn something is to practice it. It is no different from yourself. Get a good book on algorithms, maybe one that is Python Specific or one more general. I've always liked David Gries' *The Science of Programming*, though it isn't strictly an algorithms book. But it has lots of exercises on algorithmic thinking.

But the key is to do all of the exercises in the book. If the book doesn't have lots of exercises then get a different one.

The classic book is *Data Structures and Algorithms* by Aho, Hopcroft, and Ullman, though it is a bit old now.

Neither of those is Python specific, which could be a good thing.

If you have a trusted colleague you might get them to look at and comment on some of your solutions. That feedback can be very valuable.


---

### Answer by username_6 on 2022-05-08. Score: 2

It seems that you are a good researcher, but you have applied to the companies where the top most priority is coding. The first thing is the Object Oriented Programming and Data Structures. I have heard that google provides you some problems and then you need to do some code to solve it. Your code should be neat and clean and time efficient.

Now, as you are applying as a PhD candidate, but you did not mention your test experience.

But to gain experience in coding you need to pick a pen and paper. Pick any data structure and algorithms book and practice problems mentioned there. I advise you to do practice in Python as this will also help you in AI.

As you are doing research in AI then start paraticing Keras (Python Library) also this will help you to know OOPS concept very well.


---

### Answer by username_2 on 2022-05-10. Score: 1

Computer science as practiced in an industrial setting is usually *applied* computer science. Outputs are typically products that consist largely of software, but may also involve hardware, documentation, publications, and patents. That means that pure computer science is enriched with elements of software engineering (an engineering discipline) and programming (a craft). As with other crafts, one becomes more proficient by **practice**, especially when doing so with guidance from a more senior practitioner, e.g. via code review.

Typical discoveries when transitioning from theory to working code are "integers are not unbounded" and "floating-point arithmetic is not math", plus how many different ways one can commit off-by-one errors. An interesting account of one such exercise is given by R. Lesuisse, "Some lessons drawn from the history of the binary search algorithm", *The Computer Journal*, Vol. 26, No. 2, 1983, pp. 154-163 ([online](https://academic.oup.com/comjnl/article-pdf/26/2/154/880257/260154.pdf)):

> Then, the important errors found in the 26 published algorithms are pointed out, with an attempt at discussing why these errors were made.

One modern way to practice the craft of programming is to provide answers to questions posed on our companion site [Stackoverflow](https://stackoverflow.com/), especially when they include concise self-contained code with a test scaffold. This is one way how I as a retired software engineer with a CS degree try too keep my skills fresh. I highly recommend lurking on the site for a few weeks prior to writing a first answer to develop a feel for what are considered good and poor answers in this specific context.

Interview questions in an industrial setting that involve programming often use simple algorithmic concepts and simple data structures such tables, arrays, linked lists, or bit manipulation of integers. They are designed to be solved in a relatively brief amount of time, and besides testing basic algorithmic understanding tend to check whether an interviewee demonstrates reasonable fluency in the language of implementation. A starter question may be a simple as an implementation of [FizzBuzz](https://en.wikipedia.org/wiki/Fizz_buzz), of which stories circulate that it trips up a fair number of candidates. If they are posed in an interactive setting, the questions may also be designed to assess how a candidate reacts to hints and guidance by the interviewer and allow on-the-fly adjustments to the degree of difficulty.

Interview question therefore frequently differ from questions posed in classical algorithm (text) books, and are covered by specialized publications such as Gayle Laakmann, *Cracking the Coding Interview* or Adnan Aziz and Amit Prakash, *Algorithms for Interviews*.

But working out answers to text book questions can help gain proficiency. When I studied CS in the 1980s, a starting point was provided by Niklaus Wirth's two books *Systematic Programming* and *Algorithms + Data Structures = Programs*, followed up by Aho, Hopcraft, Ullman *The Design and Analysis of Computer Programs*, David Gries *The Science of Programming*, and Jon Bentley's *Programming Pearls*. Of these, the books by Bentley and Wirth are closest to what one is likely to encounter in a programming interview. The book by Gries is mostly about constructing correct programs and probably the least helpful in the present context. However, all of them are showing their age four decades after first publication. My recommendation for a modern work would be Steven S. Skiena *The Algorithm Design Manual, 2nd ed.*.


---

### Answer by username_3 on 2022-05-13. Score: 1

As it is famous among programmers practice is the only key
first of all you should know some common algorithms which are handy when we solve problems and interview

[important-type-of-algorithms](https://www.geeksforgeeks.org/most-important-type-of-algorithms/)

then you should also [sorting-algorithms](https://www.geeksforgeeks.org/sorting-algorithms/)
you don't need to practice all you can google most common sorting algos

now comes the real beast
linked list, arrays trees and other Data Structures

to practice and learn them follwing resources are best known:

<https://neetcode.io/>

<https://leetcode.com/>

<https://www.hackerrank.com/>


---

