Coding Fun Java Permutation – Live Coding Example – Java Interview

Permutation – Live Coding Example – Java Interview

This is a live-coding session for a basic permutation problem. The code is not prepared in advance, so it should help to illustrate the thought process behind developing and testing a solution to this common computer-science algorithm.

You can find a written version of this on my blog here:

Tags: , , , , , , , ,

14 thoughts on “Permutation – Live Coding Example – Java Interview”

  1. Eddie Dylan says:

    wow this is the first video that makes sense to me! Thanks!

  2. This Function fails in case of Duplicate Elements.. prints out duplicate AABC –> 18 permutations but should have result in 12 combinations only. I can easily filter that using set but that decreases the efficiency of algorithm.

  3. mrtrex01 says:

    I would safe guard against the length of the string being passed with this recursive implementation.

  4. 陈嘉程 says:

    This is a really good video. Things are cleared by steps. Thanks!

  5. Hi John H, for private help how do I reach you. possible to share with me the email address so that I cam mail you kindly.

  6. Maciej Czech says:

    What keyboard do you use in this video ?

  7. Hi John, Thank You very much for the tutorial.

    I have just one question:

    how do I create permutations of 3,

    BUT WITHOUT repetitions?


    123 would normally give permutations of

    (132, 213, 231 321, 312)

    So, how do I then only have permutations of ONLY 123???

    (since the rest are sort of REPEATS of the same thing)

    thank you in Advance for your answer.


  8. Great . Awesome explanation , much helpful than the other videos i found on the internet .:)

  9. anirban saha says:

    Can you also mention runtime and space complexity which will make this tutorial great…

  10. Winner15 says:

    Awesome solution.easily able to grab it

  11. victorNaz says:

    Great solution, easiest to understand I found so far.

  12. Andrew Lee says:

    This is perfect. I think it's rarely to see someone present their code like they are in the actual interview like you said in the beginning. Thanks a lot!

  13. Rushi Desai says:

    Very short code compared to those I found on internet. Gee thanks!

Leave a Reply

Your email address will not be published. Required fields are marked *