Topics and questions for coding challenges

Table of Contents

Big O

https://www.bigocheatsheet.com/

Big O Basic Concepts

O(1): Constant Time

  1. Doesn’t depend on the size of the data set.
  2. Example: Accessing an array element by its index.

O(log n): Logarithmic Time

  1. Splits the data in each step (divide and conquer).
  2. Example: Binary search.

O(n): Linear Time

  1. Directly proportional to the data set size.
  2. Example: Looping through an array.

O(n log n): Linearithmic Time

  1. Splits and sorts or searches data.
  2. Example: Merge sort, quick sort.

O(n2): Polynomial Time

  1. Nested loops for each power of n.
  2. Example: Bubble sort (O(n2)).

Omega (Ω) – Best Case

  1. What it means: Omega (Ω) describes the best-case scenario for an algorithm.
  2. In simple terms: It tells you the fastest an algorithm can run in the best circumstances.

Theta (Θ) - Average Case

  1. In simple terms: It tells you what to generally expect in terms of time complexity.

Big O (O) - Worst Case

  1. What it means: Big O (O) describes the worst-case scenario for an algorithm.
  2. In simple terms: It tells you the slowest an algorithm can run in the worst circumstances.

Drop Constants

  1. O(2n) simplifies to O(n).

Drop Non-Dominant Terms

  1. In O(n^2 + n), focus on O(n^2) as it will dominate for large n.

Algorithms and Data Structures

  1. Data Structures
  2. Data types
  3. Trees
  4. Searching algorithms
  5. Sorting algorithms
  6. Bitwise operations
  7. Greatest Common Divisor (GCD)
  8. Least Common Multiple (LCM)
  9. Logarithms and Exponentials
  10. Divide, Conquer and Combine paradigm
  11. Permutations

System design

  1. design a distributed datastore for a movie recommendation site.
    1. Could you design an analytics tracking system to monitor all of the orders going through the site? How about building a flow so users can upload videos?
  2. How does Twitter or Facebook Messenger work? What are the underlying technologies?

The coolest part is that many companies share details of how they designed parts of their systems. Uber, for example, has tons of great articles on their engineering blog (LINK) about how they built out different pieces of technology.

This first step is very much a research process. Google “facebook messenger technology” or check out sites like Gainlo where he breaks down these sorts of design problems.

Object Oriented design questions

  1. What classes they would define.
  2. What methods go in each class (including signatures).
  3. What the class constructors are responsible for.
  4. What data structures the class will have to maintain.
  5. Whether any Design Patterns are applicable to this problem.

Design a deck of cards that can be used for different card game applications.

Likely classes: a Deck, a Card, a Hand, a Board, and possibly Rank and Suit. Drill down on who’s responsible for creating new Decks, where they get shuffled, how you deal cards, etc. Do you need a different instance for every card in a casino in Vegas?

Model the Animal kingdom as a class system, for use in a Virtual Zoo program.

Possible sub-issues: do they know the animal kingdom at all? (I.e. common sense.) What properties and methods do they immediately think are the most important? Do they use abstract classes and/or interfaces to represent shared stuff? How do they handle the multiple-inheritance problem posed by, say, a tomato (fruit or veggie?), a sponge (animal or plant?), or a mule (donkey or horse?)

Create a class design to represent a filesystem.

Do they even know what a filesystem is, and what services it provides? Likely classes: Filesystem, Directory, File, Permission. What’s their relationship? How do you differentiate between text and binary files, or do you need to? What about executable files? How do they model a Directory containing many files? Do they use a data structure for it? Which one, and what performance tradeoffs does it have?

Design an OO representation to model HTML.

How do they represent tags and content? What about containment relationships? Bonus points if they know that this has already been done a bunch of times, e.g. with DOM. But they still have to describe it.

The following commonly-asked OO design interview questions are probably too involved to be good phone-screen weeders:

Design a parking garage.

Design a bank of elevators in a skyscraper.

Model the monorail system at Disney World.

Design a restaurant-reservation system.

Design a hotel room-reservation system. See https://github.com/zeevolution/hotel-reservation

Research the following topics (read on wikipedia):

  1. Birthday problem
  2. Self-organizing list
  3. Self-balancing binary search tree
  4. Locality of reference
  5. CPU Cache
  6. Dynamic perfect hashing
  7. Fusion tree
  8. Cunningham’s law
  9. MonteCarlo simulation
  10. The Hungarian algorithm
  11. Luhn algorithm - https://www.geeksforgeeks.org/luhn-algorithm/
  12. staircase problem - make it generic. any combination of steps that can be taken to get to the top.
  13. The traveling salesman problem

Top 10 algorithms or algorithmic concepts for coding interviews - by Techlead and algoexpert

graph traversal or tree traversal

tree structures - getting to the leaf nodes and backtracking.

e.g. binary tree structure with letters in a string

e.g. take a tree and print it level by level

difference between 1 and 2 it the order of traversal.

3. matching brackets problems

is it valid?

what is the next bracket to be added?

using stacks

other ways are possible but not very straightforward

4. making use of hashtables

e.g. 2D matrix - visit the matrix but somehow keep track of the elements that are already visited.

e.g. largest amount of zeroes that are next to each other.

use hashtable to make sure yu don’t revisit grid coordinates that are already visited.

e.g. nth fibonacci number

5. how to manipulate multiple variables or pointers at once:

e.g. using two pointers for a string

e.g. using two pointers to traverse a linked list and each of them are going at different speeds from one another.

e.g. longest palindromic substring in a string. for every letter, start two pointers going in the opposite directions.

6. reversing a linked list

e.g. are there duplicates in a linked list

e.g. remove the duplicates in a linked list

creating a class for the node and then using it for traversals

7. sorting fundamentals

quick sort, merge sort, insertion sort, heap sort, bubble sort

not to memorize them but understand them fundamentally.

know the runtimes for these sorts.

8. recursion

9. knowing how to construct custom datastructures.

e.g. suffix tree like datastructure.

capture a bunch of strings in a datastructure.

quick sort works similar to binary search.

What is a list of data structures that a competitive programmer must know?

Reference: https://qr.ae/pNLa3S

Sameer Gulati · Updated August 12, 2019 Competitive Programming · International Master at Codeforces

This is a comprehensive list of Data Structures and Algorithms used in Competitive Programming with tutorials, implementations and problems. Use this list in conjunction with this strategy (Sameer Gulati’s answer to What made you good at competitive programming?). I originally posted this list on the Codechef Discuss Forum. Moving forward I will be keeping this list updated here on Quora:

  1. Tutorial, Problems - https://www.topcoder.com/community/data-science/data-science-tutorials/binary-search/
  2. Tutorial, Implementation - https://geeksquiz.com/binary-search/
  3. Problem -https://www.spoj.com/problems/AGGRCOW/

Quicksort

  1. Tutorial, Implementation - http://geeksquiz.com/quick-sort/
  2. Tutorial - https://www.topcoder.com/community/competitive-programming/tutorials/sorting

Merge Sort

  1. Tutorial, Implementation - http://geeksquiz.com/merge-sort/
  2. Tutorial - https://www.topcoder.com/community/competitive-programming/tutorials/sorting

Suffix Array

  1. Tutorial - http://web.stanford.edu/class/cs97si/suffix-array.pdf
  2. Tutorial, Implementation - http://discuss.codechef.com/questions/21385/a-tutorial-on-suffix-arrays
  3. Tutorial, Implementation - http://apps.topcoder.com/forums/%3Bjsessionid%3DBC99925E58CB2628CA9AA3AFC13F6593?module=Thread&threadID=627379&start=0
  4. Problem - http://www.spoj.com/problems/SUBST1/
  5. Problem - http://www.codechef.com/problems/MOU1H

Knuth-Morris-Pratt Algorithm (KMP)

  1. Tutorial - https://www.topcoder.com/community/data-science/data-science-tutorials/introduction-to-string-searching-algorithms/
  2. Tutorial, Implementation - http://www.geeksforgeeks.org/searching-for-patterns-set-2-kmp-algorithm/
  3. Tutorial - http://keithschwarz.com/interesting/code/?dir=knuth-morris-pratt
  4. Problem - http://www.codechef.com/problems/TASHIFT

Rabin-Karp Algorithm

  1. Tutorial, Implementation - http://www.geeksforgeeks.org/searching-for-patterns-set-3-rabin-karp-algorithm/
  2. Tutorial - https://www.topcoder.com/community/competitive-programming/tutorials/introduction-to-string-searching-algorithms/
  3. Problem - http://www.codechef.com/problems/SSTORY
  4. Problem - http://codeforces.com/problemset/problem/271/D

Tries

  1. Tutorial, Problems - https://www.topcoder.com/community/competitive-programming/tutorials/using-tries/
  2. Tutorial :
    1. I, - http://www.geeksforgeeks.org/trie-insert-and-search/
    2. II - http://www.geeksforgeeks.org/trie-delete/
  3. Tutorial - https://www.quora.com/q/threadsiiithyderabad/Tutorial-on-Trie-and-example-problems
  4. Problem -http://www.spoj.com/problems/SUBXOR/
  5. Problem - https://icpcarchive.ecs.baylor.edu/index.php?option=com_onlinejudge&Itemid=8&category=345&page=show_problem&problem=2683
  6. Problem - http://www.codechef.com/problems/EST

Depth First Traversal of a Graph

  1. Tutorial, Implementation - http://www.geeksforgeeks.org/depth-first-traversal-for-a-graph/
  2. Tutorial, Problems - https://www.topcoder.com/community/competitive-programming/tutorials/introduction-to-graphs-and-their-data-structures-section-2/
  3. Problem - http://www.spoj.com/problems/PARADOX/
  4. Problem - http://www.spoj.com/problems/BUGLIFE/
  5. Problem -http://www.spoj.com/problems/PT07Z/

Breadth First Traversal of a Graph

  1. Tutorial, Implementation - http://www.geeksforgeeks.org/breadth-first-traversal-for-a-graph/
  2. Tutorial Problems - https://www.topcoder.com/community/competitive-programming/tutorials/introduction-to-graphs-and-their-data-structures-section-2/
  3. Problem - http://www.codechef.com/problems/DIGJUMP
  4. Problem - http://www.spoj.com/problems/ONEZERO/
  5. Problem - http://www.spoj.com/problems/NAKANJ/
  6. Flood Fill - http://community.topcoder.com/tc?module=Static&d1=tutorials&d2=findSolution#floodfill

Dijkstra’s Algorithm

  1. Tutorial, Problems - https://www.topcoder.com/community/competitive-programming/tutorials/introduction-to-graphs-and-their-data-structures-section-3/
  2. Problem - http://www.codechef.com/problems/REN2013G
  3. Tutorial(greedy) - http://e-maxx.ru/algo/dijkstra
  4. Tutorial (with heap) - https://e-maxx.ru/algo/dijkstra_sparse
  5. Implementation - http://zobayer.blogspot.in/2009/12/dijkstras-algorithm-in-c.html
  6. Problem - http://www.spoj.com/problems/EZDIJKST/
  7. Problem - http://www.spoj.com/problems/SHPATH/

Binary Indexed Tree

  1. Tutorial, Problems - http://community.topcoder.com/tc?module=Static&d1=tutorials&d2=binaryIndexedTrees
  2. Tutorial - http://codeforces.com/blog/entry/619
  3. Original Paper - http://citeseerx.ist.psu.edu/viewdoc/download%3Bjsessionid%3DAB3AEBC0736E52FA815A3D4C633DE52F?doi=10.1.1.14.8917&rep=rep1&type=pdf
  4. Tutorial - http://sanugupta.wordpress.com/2014/08/29/binary-indexed-tree-fenwick-tree/
  5. Tutorial - http://cs.stackexchange.com/a/10541
  6. Problem - http://www.spoj.com/problems/HORRIBLE/
  7. Problem - http://www.spoj.com/problems/YODANESS/
  8. Problem - http://www.spoj.com/problems/INVCNT/
  9. Problem -http://www.spoj.com/problems/NICEDAY/
  10. Problem - http://www.spoj.com/problems/CTRICK/
  11. Problem - http://www.spoj.com/problems/DQUERY/
  12. Problem - http://www.spoj.com/problems/MCHAOS/

Segment Tree (with lazy propagation)

  1. Tutorial, Implementation - http://se7so.blogspot.in/2012/12/segment-trees-and-lazy-propagation.html
  2. Tutorial - http://se7so.blogspot.in/2012/12/segment-trees-and-lazy-propagation.html
  3. Tutorial, Problems, Implementation - http://letuskode.blogspot.in/2013/01/segtrees.html
  4. Tutorial, Implementation and Various Uses - http://e-maxx.ru/algo/segment_tree
  5. Persistent Segment Tree: -
    1. http://blog.anudeep2011.com/persistent-segment-trees-explained-with-spoj-problems/
    2. II - https://discuss.codechef.com/questions/101647/persistence-made-simple-tutorial
  6. problems same as BIT,
  7. Problem - http://www.spoj.com/problems/HORRIBLE/
  8. Problem - http://www.codechef.com/problems/IDOLS HLD is used as well

Z algorithm

  1. Tutorial, Problem - http://codeforces.com/blog/entry/3107
  2. Tutorial - https://www.cs.umd.edu/class/fall2011/cmsc858s/Lec02-zalg.pdf
  3. Tutorial - https://ivanyu.me/blog/2013/10/15/z-algorithm/
  4. problems same as KMP -

Floyd Warshall Algorithm

  1. Tutorial, Implementation - http://www.geeksforgeeks.org/dynamic-programming-set-16-floyd-warshall-algorithm/
  2. Problem - http://www.spoj.com/problems/AMR11F/
  3. Problem - http://community.topcoder.com/stat?c=problem_statement&pm=2356

Sparse Table (LCP, RMQ)

  1. Tutorial, Problems - https://www.topcoder.com/community/data-science/data-science-tutorials/range-minimum-query-and-lowest-common-ancestor/
  2. Tutorial, Implementation(C++) - http://mayanknatani.wordpress.com/2013/07/15/range-minimum-query/
  3. Java implementation - https://sites.google.com/site/indy256/algo/sparse_table_rmq

Heap / Priority Queue / Heapsort

  1. Implementation, Explanation - http://www.sourcetricks.com/2011/06/c-heaps.html#.U9z8J_mSzfc
  2. Tutorial - http://pages.cs.wisc.edu/~vernon/cs367/notes/11.PRIORITY-Q.html
  3. Implementation - http://www.cprogramming.com/tutorial/computersciencetheory/heapcode.html
  4. Problem - http://www.codechef.com/problems/REVERSE
  5. Chapter from CLRS -

Modular Multiplicative Inverse

  1. http://comeoncodeon.wordpress.com/2011/10/09/modular-multiplicative-inverse/

Binomial coefficients (nCr % M)

  1. Tutorial - http://discuss.codechef.com/questions/3869/best-known-algos-for-calculating-ncr-m
  2. Tutorial - http://fishi.devtail.io/weblog/2015/06/25/computing-large-binomial-coefficients-modulo-prime-non-prime/
  3. Paper - https://www.dropbox.com/s/h7665pcqto17pl4/BinCoeff.pdf (Link Not Working),
  4. Problem -https://www.codechef.com/problems/SANDWICH

Suffix Automaton

  1. Detailed Paper - http://www.cs.nyu.edu/~mohri/pub/nfac.pdf
    1. Tutorial, Implementation (I) - http://www.geeksforgeeks.org/searching-for-patterns-set-5-finite-automata/
    2. Tutorial, Implementation (II) - http://www.geeksforgeeks.org/pattern-searching-set-5-efficient-constructtion-of-finite-automata/
  2. Problem - http://www.codechef.com/problems/SUBQUERY
  3. Problem - http://www.codechef.com/problems/TSUBSTR
  4. Problem - http://www.codechef.com/problems/SSTORY
  5. Problem - http://www.codechef.com/problems/MOU1H
  6. Tutorial, Implementation - http://e-maxx.ru/algo/suffix_automata

Lowest Common Ancestor

  1. Tutorial, Problems - http://www.topcoder.com/tc?d1=tutorials&d2=lowestCommonAncestor&module=Static
  2. Paper - http://www14.informatik.tu-muenchen.de/konferenzen/Jass08/courses/1/moufatich/El_Moufatich_Paper.pdf
  3. Paper - http://ab.inf.uni-tuebingen.de/people/fischer/lsa.pdf
  4. Problem - https://www.codechef.com/LTIME14/problems/TALCA
  5. Problem - https://www.spoj.com/problems/LCA/
  6. Problem - https://www.codechef.com/problems/TRIPS

Counting Inversions

  1. Divide and Conquer - http://www.geeksforgeeks.org/counting-inversions/
  2. Segment Tree, - https://www.quora.com/How-to-count-inversions-using-Segment-Tree-of-a-given-array
  3. Fenwick Tree - http://pavelsimo.blogspot.in/2012/09/counting-inversions-in-array-using-BIT.html
  4. Problem - http://www.codechef.com/problems/DYNAINV

Euclid’s Extended Algorithm

  1. http://discuss.codechef.com/questions/20842/a-tutorial-on-the-extended-euclids-algorithm

Suffix Tree

  1. Tutorial - http://stackoverflow.com/questions/9452701/ukkonens-suffix-tree-algorithm-in-plain-english
  2. Tutorial - http://marknelson.us/1996/08/01/suffix-trees/
  3. Intro - http://www.geeksforgeeks.org/pattern-searching-set-8-suffix-tree-introduction/
  4. Construction :
    1. II - http://www.geeksforgeeks.org/ukkonens-suffix-tree-construction-part-2/
  5. Implementation - http://marknelson.us/attachments/1996/suffix-trees/stree2006.cpp
  6. Implementation - http://www.sanfoundry.com/cpp-program-implement-suffix-tree/
  7. Problem - http://www.spoj.com/problems/LCS/
  8. Problem - http://www.codechef.com/OCT11/problems/REPSTR
  9. Problem - http://www.spoj.com/problems/BEADS/
  10. Problem - http://www.codechef.com/problems/TASTR

Dynamic Programming

  1. Chapter from CLRS(essential),
  2. Tutorial, Problems - https://www.topcoder.com/community/competitive-programming/tutorials/dynamic-programming-from-novice-to-advanced/
  3. Problem - http://www.codechef.com/problems/LEPAINT
  4. Problem - http://www.codechef.com/problems/COINS
  5. Problem - http://www.codechef.com/problems/MARCHA1
  6. Problem - http://discuss.codechef.com/questions/47239/frogv-editorial
  7. Tutorial - https://www.quora.com/Are-there-any-good-resources-or-tutorials-for-dynamic-programming-DP-besides-the-TopCoder-tutorial
  8. Problem - http://www.codechef.com/problems/TSHIRTS
  9. Problem - http://community.topcoder.com/stat?c=problem_statement&pm=11566
  10. Problem - http://www.spoj.com/problems/SOCOLA/
  11. Longest Increasing Subsequence - http://www.geeksforgeeks.org/longest-monotonically-increasing-subsequence-size-n-log-n/
  12. Bitmask DP - http://codeforces.com/blog/entry/337
  13. Bitmask DP - http://www.ugrad.cs.ubc.ca/~cs490/sec202/notes/dp/DP%202.pdf
  14. Optimization - http://codeforces.com/blog/entry/8219
  15. Problem - http://www.spoj.com/problems/TRSTAGE/
  16. Problem - http://www.spoj.com/problems/LAZYCOWS/
  17. Problem - http://www.spoj.com/problems/HIST2/
  18. Problem - http://www.spoj.com/problems/MKPAIRS/
  19. Problem - http://www.spoj.com/problems/NKLEAVES/
  20. Problem - http://www.spoj.com/problems/DRAGON2/
  21. Problem - http://codeforces.com/contest/461/problem/B
  22. DP on Trees :
    1. II - http://www.cs.berkeley.edu/~vazirani/s99cs170/notes/dynamic2.pdf

Basic Data Structures

  1. Tutorial - https://www.topcoder.com/community/competitive-programming/tutorials/data-structures/
  2. Stack Implementation - https://www.cs.bu.edu/teaching/c/stack/array/
  3. Queue Implementation, - http://geeksquiz.com/queue-set-1introduction-and-array-implementation/

Logarithmic Exponentiation

  1. http://discuss.codechef.com/questions/20451/a-tutorial-on-fast-modulo-multiplication-exponential-squaring

Graphs

  1. Definition, Representation - http://discuss.codechef.com/questions/17801/introduction-to-graphs-definitions-traversal-depth-first-search
  2. Definition, Representation - https://www.topcoder.com/community/competitive-programming/tutorials/introduction-to-graphs-and-their-data-structures-section-1/
  3. Problem - http://www.codechef.com/problems/DRGHTS
  4. Problem - http://www.codechef.com/problems/DIREL

Minimum Spanning Tree

  1. Tutorial - https://www.ics.uci.edu/~eppstein/161/960206.html
  2. Tutorial, Kruskal’s Implementation - http://www.geeksforgeeks.org/greedy-algorithms-set-2-kruskals-minimum-spanning-tree-mst/
  3. Prim’s Implementation - http://www.geeksforgeeks.org/greedy-algorithms-set-5-prims-minimum-spanning-tree-mst-2/
  4. Problem - http://www.spoj.com/problems/MST/
  5. Problem - http://www.spoj.com/problems/CSTREET/
  6. Problem - http://www.spoj.com/problems/BLINNET/
  7. Problem - http://community.topcoder.com/stat?c=problem_statement&pm=7921&rd=10765
  8. Problem - http://community.topcoder.com/stat?c=problem_statement&pm=7643&rd=12058

Efficient Prime Factorization

  1. http://www.geeksforgeeks.org/print-all-prime-factors-of-a-given-number/

Combinatorics

  1. Tutorial, Problems - https://www.topcoder.com/community/competitive-programming/tutorials/basics-of-combinatorics/
  2. Problem - http://www.codechef.com/problems/BINTOUR
  3. Tutorial - http://apps.topcoder.com/forums/?module=Thread&threadID=334598&start=0&mc=13#335550

Union Find/Disjoint Set

  1. Tutorial - http://www.cs.cornell.edu/~wdtseng/icpc/notes/graph_part4.pdf
  2. Tutorial, Problems - http://community.topcoder.com/tc?module=Static&d1=tutorials&d2=disjointDataStructure
  3. Problem - http://www.codechef.com/problems/DISHOWN
  4. Problem - http://www.spoj.com/problems/BLINNET/
  5. Problem - http://www.spoj.com/problems/CHAIN/

Knapsack problem

Solution, Implementation - http://www.geeksforgeeks.org/dynamic-programming-set-10-0-1-knapsack-problem/

Aho-Corasick String Matching Algorithm

  1. Tutorial - http://www.cs.sun.ac.za/~lvzijl/courses/rw778/autappl/crous-hw2.pdf
  2. Implementation -https://gist.github.com/andmej/1233426
  3. Problem - http://www.codechef.com/problems/FAVNUM
  4. Problem - http://community.topcoder.com/stat?c=problem_statement&pm=11514&rd=14544
  5. Problem - http://community.topcoder.com/stat?c=problem_statement&pm=6017
  6. Problem -http://www.spoj.com/problems/WPUZZLES/

Strongly Connected Components

  1. Tutorial, Implementation - http://www.geeksforgeeks.org/strongly-connected-components/
  2. Tutorial -http://www.cs.berkeley.edu/~vazirani/s99cs170/notes/lec12.pdf
  3. Problem - https://www.spoj.com/problems/BOTTOM/
  4. Problem - https://www.spoj.com/problems/BREAK/
  5. Problem - https://community.topcoder.com/stat?c=problem_statement&pm=8488&rd=11125

Bellman Ford algorithm

  1. Tutorial, Implementation - http://www.geeksforgeeks.org/dynamic-programming-set-23-bellman-ford-algorithm/
  2. Tutorial, Implementation - http://compprog.wordpress.com/2007/11/29/one-source-shortest-path-the-bellman-ford-algorithm/
  3. Problem - http://community.topcoder.com/stat?c=problem_statement&pm=10580
  4. Problem - http://codeforces.com/problemset/problem/346/D

Heavy-light Decomposition

  1. Tutorial, Problems - http://e-maxx.ru/algo/heavy_light
  2. Tutorial, Implementation -http://blog.anudeep2011.com/heavy-light-decomposition/
  3. Tutorial - http://wcipeg.com/wiki/Heavy-light_decomposition
  4. Implementation - http://apps.topcoder.com/forums/?module=Thread&threadID=796128&start=0&mc=8
  5. Implementation - http://pastie.org/private/ozpqitws20ylrj8a57tog
  6. Problem - http://www.spoj.com/problems/QTREE6/
  7. Problem - http://www.codechef.com/problems/PUSHFLOW
  8. Problem - http://www.codechef.com/problems/GERALD2

Convex Hull

  1. Tutorial, Jarvis Algorithm Implementation - http://www.geeksforgeeks.org/convex-hull-set-1-jarviss-algorithm-or-wrapping/
  2. Tutorial with Graham scan - http://www.geeksforgeeks.org/convex-hull-set-2-graham-scan/
  3. Tutorial - https://www.topcoder.com/community/data-science/data-science-tutorials/geometry-concepts-line-intersection-and-its-applications/
  4. Implementation - http://stanford.edu/~liszt90/acm/notebook.html#file8
  5. Problem - https://www.topcoder.com/stat?c=problem_statement&pm=3996&rd=7224
  6. Problem - http://codeforces.com/problemset/problem/166/B
  7. Problem - http://community.topcoder.com/stat?c=problem_statement&pm=1960&rd=4670
  8. Problem - http://acm.timus.ru/problem.aspx?space=1&num=1185
  9. Problem - http://www.spoj.com/problems/BSHEEP/

Line Intersection

  1. Tutorial, Implementation - http://www.geeksforgeeks.org/check-if-two-given-line-segments-intersect/
  2. Tutorial, Problems - https://www.topcoder.com/community/competitive-programming/tutorials/geometry-concepts-line-intersection-and-its-applications/

Sieve of Erastothenes

  1. http://www.geeksforgeeks.org/sieve-of-eratosthenes/

Interval Tree

  1. Tutorial, Implementation - http://www.geeksforgeeks.org/interval-tree/
  2. Problem - http://www.codechef.com/problems/FLIPCOIN/
  3. Problem - https://www.spoj.com/problems/THRBL/
  4. Problem - https://www.spoj.com/problems/LITE/
  5. Problem - https://www.spoj.com/problems/FREQUENT/
  6. Problem - http://www.spoj.com/problems/GSS1/
  7. Problem - http://www.spoj.com/problems/GSS3/
  8. Tutorial - http://www.dgp.toronto.edu/people/JamesStewart/378notes/22intervals/

Counting Sort

  1. http://www.geeksforgeeks.org/counting-sort/

Probabilities

  1. https://www.topcoder.com/community/competitive-programming/tutorials/understanding-probabilities/

Matrix Exponentiation

  1. Tutorial - http://discuss.codechef.com/questions/2335/building-up-the-recurrence-matrix-to-compute-recurrences-in-ologn-time
  2. Tutorial - http://zobayer.blogspot.in/2010/11/matrix-exponentiation.html

Network flow

  1. (Max Flow)Tutorial :
    1. I - https://www.topcoder.com/community/competitive-programming/tutorials/maximum-flow-section-1/
    2. II - http://community.topcoder.com/tc?module=Static&d1=tutorials&d2=maxFlow2
  2. Max Flow(Ford-Fulkerson) Tutorial, Implementation - https://www.geeksforgeeks.org/ford-fulkerson-algorithm-for-maximum-flow-problem/
  3. (Min Cut) Tutorial, Implementation - http://www.geeksforgeeks.org/minimum-cut-in-a-directed-graph/
  4. (Min Cost Flow)Tutorial :
    1. I, - http://community.topcoder.com/tc?module=Static&d1=tutorials&d2=minimumCostFlow1
    2. II - https://www.topcoder.com/community/competitive-programming/tutorials/minimum-cost-flow-part-two-algorithms/
    3. III - https://www.topcoder.com/community/competitive-programming/tutorials/minimum-cost-flow-part-three-applications/
  5. Dinic’s Algorithm with Implementation - http://e-maxx.ru/algo/dinic
  6. Max flow by Edmonds Karp with Implementation - http://e-maxx.ru/algo/edmonds_karp
  7. Problem - http://www.codechef.com/problems/TWOCOMP
  8. Problem - http://www.codechef.com/problems/LONGART
  9. Problem - http://www.codechef.com/problems/ANUBTT
  10. Problem - http://www.codechef.com/problems/ORDERAAM
  11. Problem - http://www.codechef.com/problems/PARADE
  12. Problem - http://www.codechef.com/problems/CAKE2AM
  13. Problem - http://www.spoj.com/problems/EN/
  14. Problem - http://www.spoj.com/problems/POTHOLE/
  15. Problem - http://www.spoj.com/problems/SCITIES/
  16. Problem - http://www.spoj.com/problems/GREED/
  17. Problem - http://www.spoj.com/problems/TOURS/
  18. Problem - http://community.topcoder.com/stat?c=problem_statement&pm=1931&rd=4709
  19. Problem - http://community.topcoder.com/stat?c=problem_statement&pm=2852&rd=5075
  20. Problem - http://community.topcoder.com/stat?c=problem_statement&pm=3530&rd=6535

K-d tree

  1. Tutorial - http://web.stanford.edu/class/cs106l/handouts/assignment-3-kdtree.pdf
  2. Tutorial - http://www.autonlab.org/autonweb/14665/version/2/part/5/data/moore-tutorial.pdf?branch=main&language=en
  3. Implementation - http://rosettacode.org/wiki/K-d_tree
  4. Problem - http://www.spoj.com/problems/GANNHAT/

Deque

  1. http://www.sourcetricks.com/2011/06/c-deque.html#.U--v__mSzfc

Binary Search Tree

  1. Tutorial, Implementation - http://www.sourcetricks.com/2011/06/binary-search-trees-in-c.html#.U--wAvmSzfc
  2. Searching and Insertion - http://geeksquiz.com/binary-search-tree-set-1-search-and-insertion/
  3. Deletion - http://geeksquiz.com/binary-search-tree-set-2-delete/

Quick Select

  1. Implementation - http://www.sourcetricks.com/2011/06/quick-select.html#.U_CQ0_mSzfc
  2. Implementation - http://rosettacode.org/wiki/Quickselect_algorithm#C.2B.2B

Treap/Cartesian Tree

  1. Tutorial(detailed) - http://habrahabr.ru/post/101818/
  2. Tutorial, Implementation - http://e-maxx.ru/algo/treap
  3. Uses and Problems - http://codeforces.com/blog/entry/3767
  4. Problem - http://www.codechef.com/problems/CARDSHUF/
  5. Problem - http://www.codechef.com/problems/CHEFC

Game Theory

  1. Detailed Paper - http://www.math.ucla.edu/~tom/Game_Theory/comb.pdf
  2. Tutorial, Problems - http://community.topcoder.com/tc?module=Static&d1=tutorials&d2=algorithmGames
  3. Grundy Numbers - http://letuskode.blogspot.ch/2014/08/grundy-numbers.html
  4. Tutorial with example problems -
    1. I, - http://www.thelearningpoint.net/home/mathematics/an-introduction-to-game-theory
    2. II, - http://www.thelearningpoint.net/home/mathematics/a-totorial-on-extensive-games-with-problems-and-solutions
    3. III, - http://www.thelearningpoint.net/home/mathematics/bayesian-games---games-with-incomplete-information
    4. IV - http://www.thelearningpoint.net/home/mathematics/repeated-games---tutorial-and-solved-problems
  5. Tutorial, Problems - http://www.codechef.com/wiki/tutorial-game-theory
  6. Problem - http://www.spoj.com/problems/NGM/
  7. Problem - http://www.spoj.com/problems/MCOINS/
  8. Problem - http://www.spoj.com/problems/QCJ3/
  9. Problem - http://www.spoj.com/problems/RESN04/
  10. Problem - http://www.spoj.com/problems/MMMGAME/
  11. Problem - http://www.spoj.com/problems/PEBBMOV/
  12. Problem - http://www.codechef.com/problems/CHEFBRO
  13. Problem - http://www.spoj.com/problems/HUBULLU/
  14. Problem - http://www.codechef.com/problems/BIGPIZA
  15. Problem - http://codeforces.com/contest/87/problem/C
  16. Problem - http://www.spoj.com/problems/CRSCNTRY/
  17. Nim - http://codeforces.com/blog/entry/3657

STL (C++)

  1. I - https://www.topcoder.com/community/competitive-programming/tutorials/power-up-c-with-the-standard-template-library-part-1/
  2. II - https://www.topcoder.com/community/competitive-programming/tutorials/power-up-c-with-the-standard-template-library-part-2/
  3. Crash Course - http://community.topcoder.com/tc?module=Static&d1=features&d2=082803

Maximum Bipartite Matching

  1. http://www.geeksforgeeks.org/maximum-bipartite-matching/

Manacher’s Algorithm

  1. Implementation - http://leetcode.com/2011/11/longest-palindromic-substring-part-ii.html
  2. Tutorial - http://tarokuriyama.com/projects/palindrome2.php
  3. Tutorial, Implementation - http://tristan-interview.blogspot.in/2011/11/longest-palindrome-substring-manachers.html
  4. Tutorial, Implementation - http://e-maxx.ru/algo/palindromes_count
  5. Problem - http://acm.timus.ru/problem.aspx?space=1&num=1937
  6. Problem - http://www.spoj.com/problems/LPS/
  7. Problem - http://www.spoj.com/problems/MSUBSTR/

Miller-Rabin Primality Test

  1. http://community.topcoder.com/tc?module=Static&d1=tutorials&d2=primalityTesting
  2. Code - http://rosettacode.org/wiki/Miller-Rabin_primality_test#C

Stable Marriage Problem

  1. http://www.geeksforgeeks.org/stable-marriage-problem/

Hungarian Algorithm

  1. http://community.topcoder.com/tc?module=Static&d1=tutorials&d2=hungarianAlgorithm
  2. Tutorial - https://math.uc.edu/~halpern/Linear.progr.folder/Handouts.lp.02/Hungarian.algorithm.pdf

Sweep line Algorithm

  1. I - https://www.topcoder.com/tc?module=Static&d1=tutorials&d2=lineSweep
  2. II - http://www.geeksforgeeks.org/given-a-set-of-line-segments-find-if-any-two-segments-intersect/

LCP

  1. Tutorial, Implementation - http://codeforces.com/blog/entry/12796#comment-175287
  2. Tutorial, Implementation - http://e-maxx.ru/algo/suffix_array#7

Gaussian Elimination

  1. http://compprog.wordpress.com/2007/12/11/gaussian-elimination/

Pollard Rho Integer Factorization

  1. http://www.cs.colorado.edu/~srirams/classes/doku.php/pollard_rho_tutorial
  2. problem - http://www.spoj.com/problems/FACT1/

Topological Sorting

  1. http://www.geeksforgeeks.org/topological-sorting/

Detecting Cycles in a Graph

  1. Directed -
    1. http://www.geeksforgeeks.org/detect-cycle-in-a-graph/
    2. II - http://www.geeksforgeeks.org/union-find/
  2. Undirected : http://www.geeksforgeeks.org/detect-cycle-undirected-graph/

Geometry

  1. Basics - https://www.topcoder.com/community/competitive-programming/tutorials/geometry-concepts-basic-concepts/
  2. Tutorial - http://web.stanford.edu/class/cs97si/09-computational-geometry.pdf

Backtracking

  1. N queens problem - http://www.geeksforgeeks.org/backtracking-set-3-n-queen-problem/
  2. Tug of War - http://www.geeksforgeeks.org/tug-of-war/
  3. Sudoku - http://www.geeksforgeeks.org/backtracking-set-7-suduku/

Eulerian and Hamiltonian Paths

  1. Tutorial - http://www.cs.sfu.ca/~ggbaker/zju/math/euler-ham.html#ham
  2. Tutorial - http://www.csd.uoc.gr/~hy583/papers/ch14.pdf
  3. (Eulerian Path and Cycle)Implementation - http://www.geeksforgeeks.org/eulerian-path-and-circuit/
  4. (Hamiltonian Cycle)Implementation - http://www.geeksforgeeks.org/backtracking-set-7-hamiltonian-cycle/

Graph Coloring

  1. Tutorial, Implementation - http://algorithm.daqwest.com/search?search=Coloring%20algorithm

Meet in the Middle

  1. Tutorial - http://www.infoarena.ro/blog/meet-in-the-middle
  2. Implementation - https://sites.google.com/site/indy256/algo/meet-in-the-middle

Arbitrary Precision Integer(BigInt)

  1. http://pastebin.com/aQ8NJ197
  2. https://github.com/anudeep2011/programming/blob/master/bigint.cpp

Radix Sort

  1. http://www.geeksforgeeks.org/radix-sort/

Bucket Sort

  1. http://www.geeksforgeeks.org/bucket-sort-2/

Johnson’s Algorithm

  1. Tutorial - http://www.geeksforgeeks.org/johnsons-algorithm/
  2. Tutorial - http://en.wikipedia.org/wiki/Johnson%27s_algorithm
  3. Implementation - https://gist.github.com/ashleyholman/6793360

Maximal Matching in a General Graph

  1. Blossom/Edmond’s Algorithm, Implementation - http://e-maxx.ru/algo/matching_edmonds
  2. Tutte Matrix - http://e-maxx.ru/algo/tutte_matrix
  3. Problem - http://www.codechef.com/problems/SEAGRP

Recursion

  1. I, - http://community.topcoder.com/tc?module=Static&d1=tutorials&d2=recursionPt1
  2. II - http://community.topcoder.com/tc?module=Static&d1=tutorials&d2=recursionPt2
  3. Towers of Hanoi - http://geeksquiz.com/c-program-for-tower-of-hanoi/
  4. with explanation - http://en.wikipedia.org/wiki/Tower_of_Hanoi#Recursive_solution

Inclusion and Exclusion Principle

  1. I - http://apps.topcoder.com/forums/?module=Thread&threadID=685138&start=0
  2. II - http://e-maxx.ru/algo/inclusion_exclusion_principle

Co-ordinate Compression

  1. https://www.quora.com/What-is-coordinate-compression-and-what-is-it-used-for

Sqrt-Decomposition

  1. Tutorial - http://e-maxx.ru/algo/sqrt_decomposition
  2. Tutorial - http://sysmagazine.com/posts/138946/
  3. Problem - http://www.spoj.com/problems/RACETIME/
  4. Problem - http://www.codechef.com/problems/GERALD07
  1. Tutorial - http://www.cs.cmu.edu/~sleator/papers/dynamic-trees.pdf
  2. Wiki - http://en.wikipedia.org/wiki/Link/cut_tree
  3. Tutorial, Implementation - http://www.cs.cmu.edu/~avrim/451f12/lectures/lect1009-linkcut.txt
  4. Problem - http://www.codechef.com/problems/QTREE6
  5. Problem - http://www.spoj.com/problems/DYNACON1/
  6. Problem - http://www.spoj.com/problems/DYNALCA/
  7. Problem - http://codeforces.com/contest/117/problem/E

Euler’s Totient Function

  1. Explanation, Implementation, Problems - http://e-maxx.ru/algo/euler_function
  2. Explanation, Problems - http://community.topcoder.com/tc?module=Static&d1=tutorials&d2=primeNumbers

Burnside Lemma

  1. Tutorial - http://e-maxx.ru/algo/burnside_polya
  2. Tutorial -http://petr-mitrichev.blogspot.in/2008/11/burnsides-lemma.html
  3. Problem - http://community.topcoder.com/stat?c=problem_statement&pm=9975

Edit/Levenshtein Distance

  1. Tutorial - https://web.stanford.edu/class/cs124/lec/med.pdf
  2. Introduction - http://en.wikipedia.org/wiki/Wagner%E2%80%93Fischer_algorithm
  3. Tutorial - http://www.csse.monash.edu.au/~lloyd/tildeAlgDS/Dynamic/Edit/
  4. Problem - http://www.codechef.com/problems/SEATSR
  5. Problem - http://www.spoj.com/problems/EDIST/

Branch and Bound

  1. http://www.academic.marist.edu/~jzbv/algorithms/Branch%20and%20Bound.htm

Math for Competitive Programming

  1. http://community.topcoder.com/tc?module=Static&d1=tutorials&d2=math_for_topcoders

Mo’s Algorithm

  1. Tutorial and Problems - http://blog.anudeep2011.com/mos-algorithm/

Interview Questions

  1. https://shirsh94.medium.com/top-100-interview-programming-questions-that-asks-many-times-5c5bf36449ab
  2. https://javaconceptoftheday.com/java-interview-programs-with-solutions/
  3. https://codeburst.io/review-these-50-questions-to-crack-your-java-programming-interview-69d03d746b7f
  4. https://www.java67.com/2017/08/difference-between-abstract-class-and-interface-in-java8.html
  5. https://javarevisited.blogspot.com/2014/07/default-defender-or-extension-method-of-Java8-example-tutorial.html
  6. https://javarevisited.blogspot.com/2015/01/how-to-use-lambda-expression-in-place-anonymous-class-java8.html
  7. https://www.java67.com/2021/01/spring-data-jpa-interview-questions-answers-java.html
  8. https://javarevisited.blogspot.com/2017/12/10-things-java-programmers-should-learn.html#axzz5atl0BngO
  9. https://javarevisited.blogspot.com/2021/02/spring-security-interview-questions-answers-java.html
  10. https://www.java67.com/2021/01/spring-cloud-interview-questions-with-answers-java.html
  11. https://www.java67.com/2021/02/microservices-interview-questions-answers-java-spring.html
  12. https://javarevisited.blogspot.com/2021/02/-spring-boot-testing-interview-questions-answers-java.html
  13. https://javarevisited.blogspot.com/2021/03/spring-aop-interview-questions-answers.html
  14. https://javarevisited.blogspot.com/2015/10/133-java-interview-questions-answers-from-last-5-years.html
  15. https://javarevisited.blogspot.com/2014/07/top-50-java-multithreading-interview-questions-answers.html
  16. https://javarevisited.blogspot.com/2021/03/top-dynamic-programming-problems-for-coding-interviews.html
  17. https://www.java67.com/2016/02/top-20-hibernate-interview-questions.html
  18. https://www.baeldung.com/java-collections-interview-questions
  19. https://www.baeldung.com/java-type-system-interview-questions
  20. https://www.baeldung.com/java-concurrency-interview-questions
  21. https://www.baeldung.com/java-classes-initialization-questions
  22. https://www.baeldung.com/java-memory-management-interview-questions
  23. https://www.baeldung.com/java-generics-interview-questions
  24. https://www.baeldung.com/java-flow-control-interview-questions
  25. https://www.baeldung.com/java-exceptions-interview-questions
  26. https://www.baeldung.com/java-annotations-interview-questions
  27. https://www.baeldung.com/spring-interview-questions
  28. https://medium.com/@wdn0612
  29. https://www.careermatch.com/job-prep/interviews/10-essential-java-interview-questions-and-answers/#:~:text=Tell%20me%20about%20yourself.,-This%20is%20typically&text=A%20sample%20answer%20could%20be,skilled%20at%20working%20in%20teams.
  30. https://www.simplilearn.com/java-8-interview-questions-and-answers-article
  31. https://www.interviewbit.com/java-8-interview-questions/
  32. https://www.interviewbit.com/spring-boot-interview-questions/

Implementations for ADTs

Look at the implementations for various topics in the following books: These books explain some very good concepts in a very good way.

  • Algorithhms by Robert Sedgewick, Kevin Wayne
  • ArrayResizing
  • ReverseArrayIterator
  • FixedCapacityStackOfStrings
  • ResizingArrayStack

Data Abstraction & Problem Solving with C++

Here is the table of contents from Data Abstraction and Problem Solving with C++

  • Link based implementations
  • Recursion as a problem solving technique
  • Stacks
  • Stack implementations
  • Lists
  • List implementations
  • Algorithm efficiency
  • Sorting algorithms and their efficiency
  • Sorted lists and their implementations
  • Queues and priority queues
  • Queue implementation
  • Trees
  • Tree implementations
  • Heaps
  • Dictionaries and their implementations
  • Balanced Search Trees
  • Graphs

Getting good at ADTs (abstract data types) will eventually get us ready for solving a lot of other problems like bracket balancing, etc. It will also lay a good foundation for trees and graphs.


Find an efficient implementation for generating a Fibonacci sequence - do not pay too much attention to the language - language doesn’t matter.


Top 75 Programming Interview Questions Answers to Crack Any Coding Job Interview

Hello guys, if you are preparing for your next Programming Job interview and looking for some frequently asked Coding or Programming questions to practice then you have come to the right place. In this article, I am going to share some of the most commonly asked Coding questions from Programming Job interviews (https://javarevisited.blogspot.com/2011/06/top-programming-interview-questions.html). In order to do well on the Coding interview you need practice, you just can’t go there and try to solve the coding problems in limited time, that’s actually one of the most common reasons to fail your programming Job interviews. Sometimes, the interviewer also asks a little bit easier coding questions on a telephonic interview like revering array in place (https://javarevisited.blogspot.com/2015/03/how-to-reverse-array-in-place-in-java.html#axzz5ajxLp4iD) or reversing a string in place (https://www.java67.com/2016/06/how-to-reverse-string-in-place-in-java.html).

Sometimes, when you hear these popular coding questions first time on the interview, you stumble because of nervousness and lack of preparation and that’s where knowledge of popular coding questions is important before going for any programming job interviews.

Most of the coding questions are based upon data structures (https://hackernoon.com/50-data-structure-and-algorithms-interview-questions-for-programmers-b4b1ac61f5b0) like an array, string, linked list, binary tree, etc, but sometimes you also get algorithmic, tricky, logical and scenario-based questions like how to swap two integers without using a temp variable or how to check if two rectangles overlap on each other or not.

That’s why I have divided this list of coding problems into five categories, I mean array-based coding questions, string-based questions, linked list questions, binary tree questions, and others miscellaneous questions, where you will find questions on bit manipulation, design (https://www.java67.com/2018/05/top-20-system-design-interview-questions-answers-programming.html), tricky, logical and other miscellaneous topics.

Btw, good knowledge of Data Structure and Algorithm is essential and even though you will learn a lot of new concepts by solving these questions, I suggest you first refresh your knowledge of Data Structure and Algorithm before attempting these questions by joining a comprehensive course like Data Structures and Algorithms: Deep Dive Using Java on Udemy.

There is no point in attempting these questions if you don’t have sufficient knowledge of data structure and Algorithms.

Top 50 Coding Interview Questions for Programmers

Here is my list of some of the most popular coding questions to crack any programming job interviews.

The questions are more like you find in the popular book Cracking the Coding Interview by Gayle Lakmann Mcdowell, one of the essential books to do well on a Job interview, but more focus on Data Structure and Coding rather than touching every single possible topic required for a programming job interview like SQL (https://www.java67.com/2013/04/10-frequently-asked-sql-query-interview-questions-answers-database.html), UNIX (https://www.java67.com/2012/09/10-linux-and-unix-interview-questions-answers-wipro-tcs-capegemini.html), Database (https://javarevisited.blogspot.com/2018/05/top-5-sql-and-database-courses-to-learn-online.html#axzz5h5DWdBCL), Networking (https://javarevisited.blogspot.com/2014/08/socket-programming-networking-interview-questions-answers-Java.html), etc, for that, you need to read books and you can find many good titles here (https://www.java67.com/2017/06/10-books-to-prepare-technical-coding-job-interviews.html).

We’ll start the list by first exploring array based questions e.g. finding pairs whose sum is given a number and then move to string-based questions, linked list based questions, binary tree questions, and finally tackler other topics.

1. Array-based Programming Interview Questions

If you ask me just one topic to prepare really well for coding interviews, I would pick the array. It’s one of the essential data structures and favorite darling of coding interviews. There are so many popular coding interview questions (https://javarevisited.blogspot.com/2015/02/50-programmer-phone-interview-questions-answers.html) that are based upon the array, some of them are easy and some are tough but you can be sure that you will see some questions based upon array in your next programming job interview.

If you don’t know, an array is a data structure that holds other objects like String, int, float, etc. It holds them in a contiguous location in memory which makes it easily searchable and retrieval in O(1) time using the index.

Insertion and deletion of an array are tough because you cannot change the size of an array once created and you need to create a new array and copy elements from old to new.

Anyway, here are some of the most popular array based coding interview questions for your preparation:

  1. How to find the missing number in a given integer array of 1 to 100? (https://javarevisited.blogspot.com/2014/11/how-to-find-missing-number-on-integer-array-java.html)

  2. How to find the duplicate number on a given integer array? (https://javarevisited.blogspot.com/2014/01/how-to-remove-duplicates-from-array-java-without-collection-API.html)

  3. How to find the largest and smallest number in an unsorted integer array? (https://www.java67.com/2014/02/how-to-find-largest-and-smallest-number-array-in-java.html)

  4. How to find all pairs of integer array whose sum is equal to a given number? (https://javarevisited.blogspot.com/2014/08/how-to-find-all-pairs-in-array-of-integers-whose-sum-equal-given-number-java.html)

  5. How to find duplicate numbers in an array if it contains multiple duplicates? (https://javarevisited.blogspot.com/2014/03/3-ways-to-find-first-non-repeated-character-String-programming-problem.html)

  6. How to remove duplicates from a given array in Java? (https://javarevisited.blogspot.com/2014/01/how-to-remove-duplicates-from-array-java-without-collection-API.html)

  7. How to sort an integer array in place using QuickSort algorithm? (https://javarevisited.blogspot.com/2014/08/quicksort-sorting-algorithm-in-java-in-place-example.html)

  8. How to remove duplicates from an array in place? (https://javarevisited.blogspot.com/2014/01/how-to-remove-duplicates-from-array-java-without-collection-API.html)

  9. How to reverse an array in place in Java? (https://javarevisited.blogspot.com/2013/03/how-to-reverse-array-in-java-int-String-array-example.html)

  10. How to find multiple missing numbers in given integer array with duplicates? (https://javarevisited.blogspot.com/2018/04/how-to-find-k-missing-numbers-in-array-java.html#axzz5E2uHdG3w)

I have linked to all the solution but you should try to solve them by yourself before looking at the solution, especially if you have time. That’s the only sure way to learn to program by solving these coding questions.

If you find these questions difficult to solve then once again I suggest you first refresh your knowledge of fundamental data structures like an array by going through a comprehensive course. If you need recommendations, Algorithms, and Data Structures Part 1 and Part 2 by Robert Horvick are two of the best course to start with (https://javarevisited.blogspot.com/2018/11/top-5-data-structures-and-algorithm-online-courses.html#axzz5YFaOvjsh). You will also learn about Big(O) notation and how to calculate time and space complexity.

Array based Programming Interview Questions Answers

If you think these 10 questions from the array are not enough and you are interested in solving more array-based programming problems then you can also check out these 30 array-based coding questions (https://javarevisited.blogspot.com/2015/06/top-20-array-interview-questions-and-answers.html) for more practice.

2. String-based Coding Interview Questions

After array, String is the next popular topic on Programming job interviews, but if you have a good understanding of array then you can easily deal with String programming questions (https://www.java67.com/2018/04/21-string-programming-and-coding-interview-questions-answers.html) because String is nothing but a character array.

The string is implemented differently in a different programming language like in C it’s a NULL-terminated character array but in Java, it’s an object. Though, you can still get access to the underlying array to apply your logic.

Here is a list of some of the frequently asked coding questions which are based on String. Though some of them are quite old, you can still expect this in your programming job interview:

  1. How to Print duplicate characters from String? (https://www.java67.com/2014/03/how-to-find-duplicate-characters-in-String-Java-program.html)

  2. How to print first non repeated character from String? (https://javarevisited.blogspot.com/2014/03/3-ways-to-find-first-non-repeated-character-String-programming-problem.html)

  3. How to reverse a given String using recursion? (https://javarevisited.blogspot.com/2012/01/how-to-reverse-string-in-java-using.html)

  4. How to check if a String contains only digits? (https://javarevisited.blogspot.com/2012/10/regular-expression-example-in-java-to-check-String-number.html)

  5. How to find duplicate characters in a String? (https://www.java67.com/2014/03/how-to-find-duplicate-characters-in-String-Java-program.html)

  6. How to count a number of vowels and consonants in a given String? (https://www.java67.com/2013/11/how-to-count-vowels-and-consonants-in-Java-String-word.html)

  7. How to count the occurrence of a given character in String? (https://javarevisited.blogspot.com/2012/12/how-to-count-occurrence-of-character-in-String.html)

  8. How to find all permutations of String? (https://javarevisited.blogspot.com/2015/08/how-to-find-all-permutations-of-string-java-example.html)

  9. How to reverse words in a given sentence without using any library method? (https://www.java67.com/2015/06/how-to-reverse-words-in-string-java.html)

  10. How to check if two String is a rotation of each other? (https://www.java67.com/2017/07/string-rotation-in-java-write-program.html)

  11. How to check if given String is Palindrome? (https://www.java67.com/2015/06/how-to-check-is-string-is-palindrome-in.html)

If you want to get most of this article, you better solve these questions without looking at the answers. Only when you stuck and running out-of-time, you can look at the solution.

And, if you find these frequently asked String problems difficult to solve, maybe it’s time to go back to the drawing board and learn the fundamentals of String data structure again. If you need resources then Data Structures and Algorithms Specialization on Coursera is one of the best online resources you can use to make your foundations rock solid.

You can also learn from it by comparing your solution with the solution I have given. It’s not necessarily to be the same but you can learn a lot by comparing them and if you need more practice, here is another list of 20 String algorithm questions (https://javarevisited.blogspot.com/2015/01/top-20-string-coding-interview-question-programming-interview.html).

3. Linked list based Programming Interview Questions

Along with array and string, a linked list is another popular data structure in the programming world as well as on coding interviews. You will find a lot of questions on a linked list like reversing a linked list (https://javarevisited.blogspot.com/2017/03/how-to-reverse-linked-list-in-java-using-iteration-and-recursion.html), adding a new element, removing an element from the middle, etc.

It’s also the counterpart of an array data structure. While array stores elements on contiguous memory location, the linked list stored them at different locations and find them by storing there address. a linked list is made of nodes, an internal data structure which holds the value as well as the address of the next node.

Because of its structure, it’s easier to add and remove elements from the linked list (https://www.java67.com/2016/01/how-to-implement-singly-linked-list-in-java-using-generics-example.html) like on O(1) time if you are adding or removing from the head but the search is equally difficult and takes O(n) time, as you have to literally walk through each element.

Anyway, here is a collection of some of the simple and tricky linked list based coding question for your practice:

  1. How to find the middle element of a singly linked list in one pass? (javarevisited.blogspot.sg/2012/12/how-to-find-middle-element-of-linked-list-one-pass.html)

  2. How to check if a given linked list contains a cycle? How to find the starting node of the cycle? (https://javarevisited.blogspot.com/2013/05/find-if-linked-list-contains-loops-cycle-cyclic-circular-check.html)

  3. How to reverse a linked list? (https://www.java67.com/2016/07/how-to-reverse-singly-linked-list-in-java-example.html)

  4. How to reverse a singly linked list without recursion? (https://javarevisited.blogspot.com/2017/03/how-to-reverse-linked-list-in-java-using-iteration-and-recursion.html)

  5. How to remove duplicate nodes in an unsorted linked list? (??)

  6. How to find the length of a singly linked list? (https://javarevisited.blogspot.com/2016/05/how-do-you-find-length-of-singly-linked.html)

  7. How to find the 3rd node from the end in a singly linked list? (https://javarevisited.blogspot.com/2016/07/how-to-find-3rd-element-from-end-in-linked-list-java.html)

  8. How do you find the sum of two linked lists using Stack? (https://javarevisited.blogspot.com/2017/07/top-50-java-programs-from-coding-Interviews.html)

You should only look them once you solved the problem on your own or you feel stuck.

A key to solving the linked list is a good understanding of recursion because a linked list is a naturally recursive data structure, for example, if you take one node out of the linked list, the result is another linked list, but many programmers struggle to understand recursion.

That was the case with me as well but after practice and visualizing how recursion really works, I overcome that deficiency. If you are on the same boat, I strongly suggest you go through a visual course like Visualizing Data Structures and Algorithms in Java to learn Recursion and data structure. That will help you a lot in your thought process and problem-solving skills.

Top 75 Programming Interview Questions and Solutions

Once you understand recursion, most of the linked list based problems have an easy recursive solution than their iterative version. And if you need more practice, here is another list of 30 linked list programming questions (https://javarevisited.blogspot.com/2017/07/top-10-linked-list-coding-questions-and.html) for your reference.

4. Binary Tree based Coding Interview Questions

A tree is another popular data structure in the programming world and coding interviews. Unlike array (https://javarevisited.blogspot.com/2016/02/6-example-to-declare-two-dimensional-array-in-java.html) and linked list (https://javarevisited.blogspot.com/2013/07/difference-between-array-and-linked-list-java.html), which are considered linear data structure, a tree is considered a hierarchical data structure and used to arrange information in hierarchical order.

There are a lot of different types of tree e.g. a binary tree, binary search tree, AVL tree, Red-Black tree, etc but Binary and Binary search trees are also known as BST are two of most popular ones and most of the question are based upon them.

Some questions are also based upon theoretical knowledge of tree data structure e.g. finding the height of the tree, finding leaf nodes, checking if the tree is balanced or not, etc, hence you should also spend some time learning the basics, along with practicing coding questions.

Anyway, here is a list of a popular binary tree and binary search tree based coding question to practice before your job interview:

  1. Can you write a program to implement a binary search tree? (https://javarevisited.blogspot.com/2015/10/how-to-implement-binary-search-tree-in-java-example.html#axzz4wnEtnNB3)

  2. How do you perform Pre-order traversal in a given binary tree? (https://javarevisited.blogspot.com/2016/07/binary-tree-preorder-traversal-in-java-using-recursion-iteration-example.html#axzz5ArdIFI7y)

  3. Write a Program to traverse a given binary tree in Pre-order without recursion (https://www.java67.com/2016/07/binary-tree-preorder-traversal-in-java-without-recursion.html)

  4. How to perform an In order traversal in a given binary tree? (https://www.java67.com/2016/08/binary-tree-inorder-traversal-in-java.html)

  5. How to print all nodes of given binary tree using inorder traversal without recursion (https://www.java67.com/2016/08/binary-tree-inorder-traversal-in-java.html)

  6. How to implement a Post-order traversal algorithm? (https://www.java67.com/2016/10/binary-tree-post-order-traversal-in.html)

  7. How to traverse a binary tree in Postorder traversal without recursion (https://www.java67.com/2017/05/binary-tree-post-order-traversal-in-java-without-recursion.html)

  8. How to Print all leaves of a binary search tree? (https://www.java67.com/2016/09/how-to-print-all-leaf-nodes-of-binary-tree-in-java.html)

  9. How to count a number of leaf nodes in a given binary tree? (https://javarevisited.blogspot.com/2016/12/how-to-count-number-of-leaf-nodes-in-java-recursive-iterative-algorithm.html)

  10. How to perform a binary search in a given array? (https://javarevisited.blogspot.com/2015/10/how-to-implement-binary-search-tree-in-java-example.html#axzz4wnEtnNB3)

Like an array, linked list, and string questions, I have also linked to all solutions for binary tree questions but you should only look them once you have tried it yourself.

One trick I would like to share with you while solving tree questions is to remember that, similar to a linked list, the tree is also a recursive data structure and most of the tree based problems has an easy recursive solution.

For example, a subtree is also a tree which means you can apply the same steps to subtree can devise a recursive solution. In the above list, many popular tree algorithms e.g. pre-order, post-order, in-order are implemented recursively as well as iterative.

If you don’t feel confident to solve these problems and want to refresh your knowledge of binary tree and other data structure before attempting these questions, then you should check out Data Structures and Algorithms: Deep Dive Using Java from Udemy.

Top 75 Essential Programming Interview Questions to Crack Any Coding Interview

  1. Miscellaneous Programming Interview Questions

Even though data structure-based questions make the bulk of the Coding Interview, there are always some questions from topics like sorting algorithms, bit manipulation, software design (https://www.java67.com/2016/07/top-5-object-oriented-design-interview-questions.html), Dynamic Programming (https://www.freecodecamp.org/news/these-are-the-best-free-courses-to-learn-data-structures-and-algorithms-in-depth-4d52f0d6b35a/), and other logical and tricky questions.

In this list below, you will find most of the common searching and sort questions as well as a couple of design and bit manipulation questions.

  1. How to implement the Bubble Sort algorithm? (https://javarevisited.blogspot.com/2014/08/bubble-sort-algorithm-in-java-with.html#axzz5ArdIFI7y)

  2. How to implement Iterative QuickSort Algorithm? (https://javarevisited.blogspot.com/2016/09/iterative-quicksort-example-in-java-without-recursion.html#axzz5ArdIFI7y)

  3. How to implement the Insertion Sort Algorithm? (https://www.java67.com/2014/09/insertion-sort-in-java-with-example.html)

  4. How to implement Merge Sort Algorithm? (https://www.java67.com/2018/03/mergesort-in-java-algorithm-example-and.html)

  5. How to implement the Bucket Sort Algorithm? (https://javarevisited.blogspot.com/2017/01/bucket-sort-in-java-with-example.html)

  6. How to implement the Counting Sort Algorithm? (https://www.java67.com/2017/06/counting-sort-in-java-example.html)

  7. How to implement Radix Sort Algorithm? (https://www.java67.com/2018/03/how-to-implement-radix-sort-in-java.html)

  8. How to swap two numbers without using the third variable? See SwapIntegersWithoutUsingATempVariable.java

  9. How to check if two rectangles overlap with each other? (https://javarevisited.blogspot.com/2016/10/how-to-check-if-two-rectangle-overlap-in-java-algorithm.html)

  10. How to check if a given number is a Palindrome? See IntegerPalindrome.java (http://javarevisited.blogspot.sg/2012/12/how-to-check-if-number-is-palindrome-or-not-example.html)

  11. How do you check if a given number is an Armstrong number? (https://www.java67.com/2012/07/java-program-to-find-armstrong-numbers.html)

  12. How do you find all prime factors of a given number? (https://javarevisited.blogspot.com/2014/05/how-to-find-prime-factors-of-integer-number-java.html#axzz5E2uHdG3w)

  13. How do you check if a given number is positive or negative in Java? (https://javarevisited.blogspot.com/2013/01/how-to-check-if-number-is-positive-or-negative-java-example.html#axzz5E2uHdG3w)

  14. How to find the largest prime factor of a given integral number? (https://javarevisited.blogspot.com/2015/03/how-to-find-largest-prime-factor-of.html#axzz5E2uHdG3w)

  15. Write a Program to print all prime numbers up to a given number? (https://javarevisited.blogspot.com/2012/04/java-program-to-print-prime-numbers-in.html#axzz5E2uHdG3w)

  16. Write a Program to print Floyd’s triangle? (https://javarevisited.blogspot.com/2014/12/how-to-print-floyds-triangle-in-java.html)

  17. Write a Program to print Pascal’s triangle? (https://www.java67.com/2016/06/how-to-print-pascal-triangle-in-java.html)

  18. How to calculate the square root of a given number? (https://javarevisited.blogspot.com/2016/10/how-to-find-square-root-of-number-in-java-algorithm.html#axzz5E2uHdG3w)

  19. How to check if the given number is a prime number? (https://www.java67.com/2014/01/how-to-check-if-given-number-is-prime.html)

  20. How to implement the Sieve of Eratosthenes Algorithm? (https://javarevisited.blogspot.com/2015/05/sieve-of-Eratosthenes-algorithm-to-generate-prime-numbers-in-java.html)

  21. How to add two numbers without using the plus operator in Java? (https://javarevisited.blogspot.com/2013/06/how-to-add-two-integer-numbers-without-plus-arithmetic-operator-java-example.html)

  22. Write a Program to subtract two binary numbers? (https://www.java67.com/2018/03/java-program-to-subtract-two-binary-numbers.html)

  23. Write a Program to transpose a Matrix? (https://www.java67.com/2016/10/how-to-transpose-matrix-in-java-example.html)

  24. Write a Program to add or subtract two Matrices? (https://www.java67.com/2016/10/how-to-add-and-subtract-two-matrices-in-java.html)

  25. Write a Program to multiply two Matrices in Java? (https://www.java67.com/2016/10/how-to-multiply-two-matrices-in-java.html)

  26. How to calculate the average of all numbers in a given array? (https://www.java67.com/2016/10/how-to-calculate-average-of-all-numbers-in-given-array-java.html)

  27. How to check if a given number is even/odd without using an Arithmetic operator? (https://www.java67.com/2012/07/how-to-find-even-and-odd-number-in-java-program.html)

  28. Write a Program to find GCD of two numbers using Euclid’s Algorithm? (https://www.java67.com/2012/08/java-program-to-find-gcd-of-two-numbers.html)

  29. How to find the number of 1s (the Set bit) in a given Bit Sequence? (https://www.java67.com/2016/01/how-to-count-number-of-1s-in-given-bit-sequence-in-java.html)

  30. Write a Program to given Pyramid structure? (https://www.java67.com/2015/10/how-to-print-pyramid-pattern-in-java-example.html)

  31. How to find the highest repeating world from a given file in Java? (https://www.java67.com/2015/10/java-program-to-find-repeated-words-and-count.html)

  32. How to reverse given Integer in Java? (https://www.java67.com/2015/08/how-to-reverse-integer-in-java-leetcode-solution.html)

  33. How to convert a decimal number to binary in Java? (https://www.java67.com/2014/03/decimal-to-binary-conversion-in-java.html)

  34. How to check if a given year is a leap year in Java? (https://www.java67.com/2012/12/how-to-check-leap-year-in-java-program.html)

Like previous topics, I have provided links to a solution but you should only look them once you tried to solve the questions yourself. That’s important for learning.

That’s all about some of the essential Programming and Coding Interview questions to crack any programming Job interviews. This list covers the most important topics like an array, string, linked list, binary tree, and several others.

Once you have gone through all these coding questions, you can not only solve them when you see them in the interview but also develop the coding sense and problem-solving ability which will help you to solve new and slightly modified versions of these questions on real programming interview.

AnonymousJuly 26, 2020 at 1:22 AM

This is a great list of problems, but I believe readers should look elsewhere for correct solutions. I haven’t opened all of them, but some of them (e.g. “remove duplicate chars from string”, “find square root of a number”) have some pretty bizarre solutions.

100+ Coding Interview Questions for Programmers

  1. How is a bubble sort algorithm implemented? (http://javarevisited.blogspot.sg/2014/08/bubble-sort-algorithm-in-java-with.html#axzz5ArdIFI7y)

  2. How is a merge sort algorithm implemented? (http://www.java67.com/2018/03/mergesort-in-java-algorithm-example-and.html)

  3. How do you count the occurrence of a given character in a string? (http://javarevisited.blogspot.sg/2012/12/how-to-count-occurrence-of-character-in-String.html)

  4. How do you print the first non-repeated character from a string? (http://javarevisited.blogspot.sg/2014/03/3-ways-to-find-first-non-repeated-character-String-programming-problem.html)

  5. How do you convert a given String into int like the atoi()? (https://javarevisited.blogspot.com/2011/08/convert-string-to-integer-to-string.html)

  6. How do you implement a bucket sort algorithm? (http://javarevisited.blogspot.sg/2017/01/bucket-sort-in-java-with-example.html)

  7. How do you implement a counting sort algorithm? (http://www.java67.com/2017/06/counting-sort-in-java-example.html)

  8. How do you remove duplicates from an array in place? (http://javarevisited.blogspot.com/2014/01/how-to-remove-duplicates-from-array-java-without-collection-API.html)

  9. How do you reverse an array in place in Java? (http://javarevisited.blogspot.com/2013/03/how-to-reverse-array-in-java-int-String-array-example.html)

  10. How are duplicates removed from an array without using any library? (http://javarevisited.blogspot.sg/2014/01/how-to-remove-duplicates-from-array-java-without-collection-API.html)

  11. How is a radix sort algorithm implemented? (http://www.java67.com/2018/03/how-to-implement-radix-sort-in-java.html)

  12. How do you swap two numbers without using the third variable? See SwapIntegersWithoutUsingATempVariable.java

  13. How do you check if two rectangles overlap with each other? (http://javarevisited.blogspot.sg/2016/10/how-to-check-if-two-rectangle-overlap-in-java-algorithm.html)

  14. How do you find the missing number in a given integer array of 1 to 100? (http://javarevisited.blogspot.com/2014/11/how-to-find-missing-number-on-integer-array-java.html)

  15. How do you find the duplicate number on a given integer array? (http://javarevisited.blogspot.com/2014/01/how-to-remove-duplicates-from-array-java-without-collection-API.html)

  16. How do you find duplicate numbers in an array if it contains multiple duplicates? (http://javarevisited.blogspot.com/2014/03/3-ways-to-find-first-non-repeated-character-String-programming-problem.html)

  17. Difference between a stable and unstable sorting algorithm? (https://javarevisited.blogspot.com/2017/06/difference-between-stable-and-unstable-algorithm.html)

  18. How is an iterative quicksort algorithm implemented? (http://javarevisited.blogspot.sg/2016/09/iterative-quicksort-example-in-java-without-recursion.html#axzz5ArdIFI7y)

  19. How do you find the largest and smallest number in an unsorted integer array? (http://java67.blogspot.com/2014/02/how-to-find-largest-and-smallest-number-array-in-java.html)

  20. How do you find all pairs of an integer array whose sum is equal to a given number? (http://javarevisited.blogspot.com/2014/08/how-to-find-all-pairs-in-array-of-integers-whose-sum-equal-given-number-java.html)

  21. How do you implement an insertion sort algorithm? (http://www.java67.com/2014/09/insertion-sort-in-java-with-example.html)

  22. How are duplicates removed from a given array in Java? (http://javarevisited.blogspot.com/2014/01/how-to-remove-duplicates-from-array-java-without-collection-API.html)

  23. how to remove the duplicate character from String? (https://javarevisited.blogspot.com/2016/06/how-to-remove-duplicate-characters-from-String-Java.html)

  24. How to find the maximum occurring character in given String? (http://javarevisited.blogspot.com/2012/12/how-to-count-occurrence-of-character-in-String.html)

  25. How is an integer array sorted in place using the quicksort algorithm? (http://javarevisited.blogspot.com/2014/08/quicksort-sorting-algorithm-in-java-in-place-example.html)

  26. How do you reverse a given string in place? (http://www.java67.com/2016/06/how-to-reverse-string-in-place-in-java.html)

  27. How do you print duplicate characters from a string? (http://java67.blogspot.sg/2014/03/how-to-find-duplicate-characters-in-String-Java-program.html)

  28. How do you find all the permutations of a string? (http://javarevisited.blogspot.com/2015/08/how-to-find-all-permutations-of-string-java-example.html)

  29. How can a given string be reversed using recursion? (http://javarevisited.blogspot.sg/2012/01/how-to-reverse-string-in-java-using.html)

  30. How do you check if a given string is a palindrome? (http://java67.blogspot.com/2015/06/how-to-check-is-string-is-palindrome-in.html)

  31. How do you find the length of the longest substring without repeating characters?

  32. How do you find the longest palindromic substring in str?

  33. How do you check if a string contains only digits? (http://javarevisited.blogspot.sg/2012/10/regular-expression-example-in-java-to-check-String-number.html)

  34. How to convert a sorted list to a binary search tree? (https://leetcode.com/problems/convert-sorted-list-to-binary-search-tree/solution/)

  35. How do you find duplicate characters in a given string? (http://java67.blogspot.sg/2014/03/how-to-find-duplicate-characters-in-String-Java-program.html)

  36. How do you count a number of vowels and consonants in a given string? (http://java67.blogspot.sg/2013/11/how-to-count-vowels-and-consonants-in-Java-String-word.html)

  37. How do you reverse words in a given sentence without using any library method? (http://java67.blogspot.com/2015/06/how-to-reverse-words-in-string-java.html)

  38. How do you check if two strings are a rotation of each other? (http://www.java67.com/2017/07/string-rotation-in-java-write-program.html)

  39. How to convert a byte array to String? (https://javarevisited.blogspot.com/2014/08/2-examples-to-convert-byte-array-to-String-in-Java.html)

  40. How do you remove a given character from String? (http://java67.blogspot.com/2013/03/how-to-replace-string-in-java-character-example.html)

  41. How is a binary search tree implemented? (http://javarevisited.blogspot.sg/2015/10/how-to-implement-binary-search-tree-in-java-example.html#axzz4wnEtnNB3)

  42. How do you perform preorder traversal in a given binary tree? (http://javarevisited.blogspot.sg/2016/07/binary-tree-preorder-traversal-in-java-using-recursion-iteration-example.html#axzz5ArdIFI7y)

  43. How do you traverse a given binary tree in preorder without recursion? (http://www.java67.com/2016/07/binary-tree-preorder-traversal-in-java-without-recursion.html)

  44. How do you perform an inorder traversal in a given binary tree? (http://www.java67.com/2016/08/binary-tree-inorder-traversal-in-java.html)

  45. How do you print all nodes of a given binary tree using inorder traversal without recursion? (http://www.java67.com/2016/08/binary-tree-inorder-traversal-in-java.html)

  46. How do you implement a postorder traversal algorithm? (http://www.java67.com/2016/10/binary-tree-post-order-traversal-in.html)

  47. How do you traverse a binary tree in postorder traversal without recursion? (http://www.java67.com/2017/05/binary-tree-post-order-traversal-in-java-without-recursion.html)

  48. How are all leaves of a binary search tree printed? (http://www.java67.com/2016/09/how-to-print-all-leaf-nodes-of-binary-tree-in-java.html)

  49. How do you count a number of leaf nodes in a given binary tree? (http://javarevisited.blogspot.sg/2016/12/how-to-count-number-of-leaf-nodes-in-java-recursive-iterative-algorithm.html)

  50. How do you perform a binary search in a given array? (http://javarevisited.blogspot.sg/2015/10/how-to-implement-binary-search-tree-in-java-example.html#axzz4wnEtnNB3)

  51. How to Swap two numbers without using the third variable? (http://www.java67.com/2015/08/how-to-swap-two-integers-without-using.html)

  52. How to check if two rectangles overlap with each other? (http://javarevisited.blogspot.sg/2016/10/how-to-check-if-two-rectangle-overlap-in-java-algorithm.html)

  53. How to check if a given number is a Palindrome? (http://javarevisited.blogspot.sg/2012/12/how-to-check-if-number-is-palindrome-or-not-example.html)

  54. How to check if a given number is an Armstrong number? (http://www.java67.com/2012/07/java-program-to-find-armstrong-numbers.html)

  55. How to find all prime factors of a given number? (http://javarevisited.blogspot.com/2014/05/how-to-find-prime-factors-of-integer-number-java.html#axzz5E2uHdG3w)

  56. How to check if a given number is positive or negative in Java? (http://javarevisited.blogspot.sg/2013/01/how-to-check-if-number-is-positive-or-negative-java-example.html#axzz5E2uHdG3w)

  57. How to find the largest prime factor of a given integral number? (http://javarevisited.blogspot.sg/2015/03/how-to-find-largest-prime-factor-of.html#axzz5E2uHdG3w)

  58. How to print all prime numbers up to a given number? (http://javarevisited.blogspot.sg/2012/04/java-program-to-print-prime-numbers-in.html#axzz5E2uHdG3w)

  59. How to print Floyd’s triangle? (http://javarevisited.blogspot.sg/2014/12/how-to-print-floyds-triangle-in-java.html)

  60. How to print Pascal’s triangle? (http://www.java67.com/2016/06/how-to-print-pascal-triangle-in-java.html)

  61. How to calculate the square root of a given number? (http://javarevisited.blogspot.sg/2016/10/how-to-find-square-root-of-number-in-java-algorithm.html#axzz5E2uHdG3w)

  62. How to check if the given number is a prime number? (http://www.java67.com/2014/01/how-to-check-if-given-number-is-prime.html)

  63. How to add two numbers without using the plus operator in Java? (http://javarevisited.blogspot.sg/2013/06/how-to-add-two-integer-numbers-without-plus-arithmetic-operator-java-example.html)

  64. How to check if a given number is even/odd without using Arithmetic operator? (http://www.java67.com/2012/07/how-to-find-even-and-odd-number-in-java-program.html)

  65. How to print a given Pyramid structure? (http://www.java67.com/2015/10/how-to-print-pyramid-pattern-in-java-example.html)

  66. How to find the highest repeating world from a given file in Java? (http://www.java67.com/2015/10/java-program-to-find-repeated-words-and-count.html)

  67. How to reverse given Integer in Java? (http://www.java67.com/2015/08/how-to-reverse-integer-in-java-leetcode-solution.html)

  68. How to convert a decimal number to binary in Java? (http://www.java67.com/2014/03/decimal-to-binary-conversion-in-java.html)

  69. How to check if a given year is a leap year in Java? (http://www.java67.com/2012/12/how-to-check-leap-year-in-java-program.html)

  70. Can you implement a Binary search Algorithm without recursion? (https://javarevisited.blogspot.com/2018/06/binary-search-in-java-without-recursion.html)

  71. Difference between a stable and unstable sorting algorithm? (https://javarevisited.blogspot.com/2017/06/difference-between-stable-and-unstable-algorithm.html)

  72. What is Depth First Search Algorithm for a binary tree?

  73. How is an iterative quicksort algorithm implemented? (http://javarevisited.blogspot.sg/2016/09/iterative-quicksort-example-in-java-without-recursion.html#axzz5ArdIFI7y)

  74. How do you implement an insertion sort algorithm? (http://www.java67.com/2014/09/insertion-sort-in-java-with-example.html)

  75. How is a merge sort algorithm implemented? (http://www.java67.com/2018/03/mergesort-in-java-algorithm-example-and.html)

  76. What is the difference between Comparison and Non-Comparison Sorting Algorithms? (https://javarevisited.blogspot.com/2017/02/difference-between-comparison-quicksort-and-non-comparison-counting-sort-algorithms.html)

  77. How do implement Sieve of Eratosthenes Algorithms for Prime Number? (https://javarevisited.blogspot.com/2015/05/sieve-of-Eratosthenes-algorithm-to-generate-prime-numbers-in-java.html)

https://www.geeksforgeeks.org/must-coding-questions-company-wise/?ref=leftbar-rightbar

https://www.geeksforgeeks.org/practice-for-cracking-any-coding-interview/?ref=leftbar-rightbar

Link based implementations - mathematical induction

Try to go with topic in geeks for geeks instead of picking problems from all over the place and many websites at random.

http://www-igm.univ-mlv.fr/~lecroq/string/ - EXACT STRING MATCHING ALGORITHMS

Write your own logic for MooshakCatchingCheese.java

Practice:

  1. Write a small Java application that uses the String class to input one word at a time and

outputs a complete sentence when a terminating punctuation mark is entered.

  1. Write an application similar to the one in exercise 1, but output the words in the sentence in

reverse order.

  1. Write the same application using a single StringBuffer object passed to the input

method to collect the words in the sentence.

  1. Write a class MutableInteger similar to the Java core class Integer but with the

capability to change the value of the integer. (The Integer class, like the String class, is immutable after it is initialized.)

Data Structures for Coding Interviews in Java

https://www.educative.io/courses/data-structures-coding-interviews-java?affiliate_id=5073518643380224

  1. Complexity Measures

    1. Comparing Algorithms
    2. Example 1: Measuring Time Complexity of a Single Loop Algorithm
    3. Example 2: Time Complexity of an Algorithm With Nested Loops
    4. Introduction to Asymptotic Analysis and Big O
    5. Other Common Asymptotic Notations and Why Big O Trumps Them
    6. Useful Formulae
    7. Common Complexity Scenarios
    8. Challenge 1: Big (O) of Nested Loop with Addition
    9. Solution Review: Big O of a Nested Loop with Addition
    10. Challenge 2: Big (O) of Nested Loop with Subtraction
    11. Solution Review: Big O of a Nested Loop with Subtraction
    12. Challenge 3: Big O of Nested Loop with Multiplication
    13. Solution Review: Big O of Nested Loop with Multiplication
    14. Challenge 4: Nested Loop with Multiplication (Basic)
    15. Solution Review: Nested Loop with Multiplication (Basic)
    16. Challenge 5: Nested Loop with Multiplication (Intermediate)
    17. Solution Review: Nested Loop with Multiplication (Intermediate)
    18. Challenge 6: Nested Loop with Multiplication (Advanced)
    19. Solution Review: Nested Loop with Multiplication (Advanced)
    20. Challenge 7: Nested Loop with Multiplication (Pro)
    21. Solution Review: Nested Loop with Multiplication (Pro)
    22. Complexity Interview Questions
  2. Arrays

    1. What is an Array?
    2. Two Dimensional Arrays
    3. Challenge 1: Remove Even Integers from an Array
    4. Solution Review: Remove Even Integers from an Array
    5. Challenge 2: Merge Two Sorted Arrays
    6. Solution Review: Merge Two Sorted Arrays
    7. Challenge 3: Find Two Numbers that Add up to “n”
    8. Solution Review: Find Two Numbers that Add up to “n”
    9. Challenge 4: Array of Products of All Elements Except Itself
    10. Solution Review: Array of Products of All Elements Except Itself
    11. Challenge 5: Find Minimum Value in Array
    12. Solution Review: Find Minimum Value in an Array
    13. Challenge 6: First Non-Repeating Integer in an Array
    14. Solution Review: First Non-Repeating Integer in an Array
    15. Challenge 7: Find Second Maximum Value in an Array
    16. Solution Review: Find Second Maximum Value in an Array
    17. Challenge 8: Right Rotate the Array by One Index
    18. Solution Review: Right Rotate the Array by One Index
    19. Challenge 9: Re-arrange Positive & Negative Values
    20. Solution Review: Re-arrange Positive & Negative Values
    21. Challenge 10: Rearrange Sorted Array in Max/Min Form
    22. Solution Review: Re-arrange Sorted Array in Max/Min Form
    23. Array Interview Questions
  3. Linked Lists

    1. What is the Singly Linked List (SLL)?
    2. Basic Linked List Operations
    3. Insertion in a Singly Linked List
    4. Challenge 1: Insertion in a Singly Linked List (insert at End)
    5. Solution Review: Insertion in a Singly Linked List(insert at End)
    6. Insertion in Singly Linked List (Insert After)
    7. Challenge 2: Search in Singly Linked List
    8. Solution Review: Search in a Singly Linked List
    9. Singly Linked List Deletion (Implementation)
    10. Challenge 3: Deletion in Singly Linked List(Delete by Value)
    11. Solution Review: Deletion in Singly Linked List
    12. Linked Lists vs. Arrays
    13. What is a Doubly Linked List (DLL)?
    14. Linked List with Tail
    15. Challenge 4: Find the Length of a Linked List
    16. Solution Review: Find the Length of a Linked List
    17. Challenge 5: Reverse a Linked List
    18. Solution Review: Reverse a Linked List
    19. Challenge 6: Detect Loop in a Linked List
    20. Solution Review: Detect Loop in a Linked List
    21. Challenge 7: Find the Middle Value of a Linked List
    22. Solution Review: Find the Middle Value of a Linked List
    23. Challenge 8: Remove Duplicates from a Linked List
    24. Solution Review: Remove Duplicate from a Linked List
    25. Challenge 9: Union & Intersection of Lists
    26. Solution Review: Union & Intersection of Lists
    27. Challenge 10: Return the Nth node from End
    28. Solution Review: Return the Nth node from End
    29. Challenge 11: Find if Doubly Linked-list is a Palindrome
    30. Solution: Find if a Doubly Linked-list is a Palindrome
    31. Linked list Interview Questions
  4. Stack/Queues

    1. What is a Stack?
    2. Stack (Implementation)
    3. What is a Queue?
    4. Queue (Implementation)
    5. Challenge 1: Generate Binary Numbers from 1 to n using a Queue
    6. Solution Review: Generate Binary Numbers from 1 to n using Queue
    7. Challenge 2: Implement Two Stacks using one Array
    8. Solution Review: Implement Two Stacks using one Array
    9. Challenge 3: Reversing the First k Elements of a Queue
    10. Solution Review: Reversing the First k Elements of a Queue
    11. Challenge 4: Implement Queue using Stack
    12. Solution Review: Implement Queue using Stack
    13. Challenge 5: Sort the Values in a Stack
    14. Solution Review: Sort the Values in a Stack
    15. Challenge 6: Evaluate Postfix Expressions using Stacks
    16. Solution Review: Evaluate Postfix Expressions using Stacks
    17. Challenge 7: Next Greater Element using Stack
    18. Solution Review: Next Greater Element using Stack
    19. Challenge 8: Solve a Celebrity Problem using a Stack
    20. Solution Review: Solve a Celebrity Problem using a Stack
    21. Challenge 9: Check for Balanced Parentheses using a Stack
    22. Solution Review: Check for Balanced Parentheses using a Stack
    23. Challenge 10: Create Stack where min() gives minimum in O(1)
    24. Solution Review: Create Stack where min() gives minimum in O(1)
    25. Stack/Queue Interview Questions
  5. Graphs

    1. What is a Graph?
    2. Representation of Graphs
    3. Graph Implementation
    4. Complexities of Graph Operations
    5. What is a Bipartite Graph?
    6. Graph Traversal Algorithms
    7. Challenge 1: Implement Breadth First Search
    8. Solution Review: Implement Breadth First Search
    9. Challenge 2: Implement Depth First Search
    10. Solution Review: Implement Depth First Search
    11. Challenge 3: Cycle Detection in a Directed Graph
    12. Solution Review: Cycle Detection in a Directed Graph
    13. Challenge 4: Find “Mother Vertex” in a Directed Graph
    14. Solution Review: Find “Mother Vertex” in a Directed Graph
    15. Challenge 5: Count the Number of Edges in an Undirected Graph
    16. Solution Review: Count the number of Edges in an Undirected Graph
    17. Challenge 6: Check if a Path Exists Between Two Vertices
    18. Solution Review: Check if a Path Exists Between Two Vertices
    19. Challenge 7: Check if a Directed Graph is Tree or not
    20. Solution Review: Check if a Directed Graph is Tree or not
    21. Challenge 8: Find Length of Shortest Path between Two Vertices
    22. Solution Review: Find the Shortest Path between Two Vertices
    23. Challenge 9: Remove Edge from a Directed Graph
    24. Solution Review: Remove Edge from a Directed Graph
    25. Graph Interview Questions
  6. Trees

    1. What is a Tree?
    2. Types of Trees
    3. What Makes a Tree Balanced?
    4. What is a Binary Tree?
    5. More on Complete Binary Trees
    6. Skewed Binary Tree
    7. What is a Binary Search Tree (BST)?
    8. Insertion in Binary Search Trees
    9. Insertion in BST (Complete Implementation)
    10. Search in Binary Search Trees (Implementation)
    11. Deletion in Binary Search Trees
    12. Deletion in Binary Search Trees (Implementation)
    13. Pre-Order Traversal in Binary Search Trees
    14. In-Order Traversal in Binary Search Trees
    15. Post-Order Traversal in Binary Search Tree
    16. What is an AVL Tree?
    17. AVL Insertion
    18. AVL Deletion
    19. What is a Red-Black Tree?
    20. Red-Black Tree Insertion
    21. Red-Black Tree Deletion
    22. What is a 2-3 Tree?
    23. 2-3 Insertion
    24. 2-3 Deletion (Case #1)
    25. 2-3 Deletion (Case #2)
    26. 2-3-4 Trees
    27. Overview of Trees
    28. Challenge 1: Find the Minimum Value in a Binary Search Tree
    29. Solution Review: Find the Minimum Value in a Binary Search Tree
    30. Challenge 2: Find kth Maximum Value in a Binary Search Tree
    31. Solution Review: Find kth Maximum Value in a Binary Search Tree
    32. Challenge 3: Find Ancestors of Given Node in Binary Search Tree
    33. Solution Review: Find Ancestors of a Given Node in a Binary Tree
    34. Challenge 4: Find the Height of a Binary Search Tree
    35. Solution Review: Find the Height of a Binary Search Tree
    36. Challenge 5: Find Nodes at “k” Distance from the Root
    37. Solution Review: Find Nodes at “k” Distance from the Root
    38. Tree Interview Questions
  7. Trie (Advanced Trees)

    1. What is a Trie?
    2. The Structure of a Trie
    3. Insertion in a Trie
    4. Search in a Trie
    5. Deletion in a Trie
    6. Challenge 1: Total Number of Words in a Trie
    7. Solution Review: Total Number of Words in a Trie
    8. Challenge 2: Find All of the Words in a Trie
    9. Solution Review: Find All of the Words in a Trie
    10. Challenge 3: Sort the Elements of an Array using a Trie.
    11. Solution Review: Sort the Elements of an Array using a Trie.
    12. Challenge 4: Word Formation from a Given Dictionary using a Trie
    13. Solution Review: Word Formation from Given Dictionary using Trie
    14. Trie Interview Questions
  8. Heaps

    1. What is a Heap
    2. Why Use Heaps?
    3. Heap Representation in Arrays
    4. Max Heap: Introduction
    5. Max Heap (Implementation)
    6. Min Heap: An Introduction
    7. Min Heap (Implementation)
    8. Challenge 1: Convert a Max-Heap to a Min-Heap
    9. Solution Review: Convert a Max-Heap to a Min-Heap
    10. Challenge 2: Find the k Smallest Elements in an Array
    11. Solution Review: Find the k Smallest Elements in an Array
    12. Challenge 3: Find the k Largest Elements in an Array
    13. Solution Review: Find the k Largest Elements in an Array
    14. Heap Interview Questions
  9. Hash Tables

    1. What is a Hash Table?
    2. Hash Functions
    3. Collisions in Hash Tables
    4. Building a Hash Table from Scratch
    5. Add/Remove & Search in a Hash Table (Implementation)
    6. Complete Implementation of Hash Tables
    7. Trie vs Hash Table
    8. HashMap vs HashSet
    9. Challenge 1: Find whether an array is a subset of another array
    10. Solution Review: Find whether an array is a subset of another array
    11. Challenge 2: Check if the given arrays are disjoint
    12. Solution Review: Check if the given arrays are disjoint
    13. Challenge 3: Find symmetric pairs in an Array
    14. Solution Review: Find symmetric pairs in an Array
    15. Challenge 4: Trace the complete path of a journey
    16. Solution Review: Trace the complete path of a journey
    17. Challenge 5: Find two pairs in an Array such that a+b = c+d
    18. Solution Review: Find two pairs in an Array such that a+b = c+d
    19. Challenge 6: Find If a Subarray with a Sum Equal to 0 Exists
    20. Solution Review: Find if a subarray with a sum equal to 0 exists.
    21. Challenge 7: First Non-Repeating Integer in an Array
    22. Solution Review: First Non-Repeating Integer in an Array
    23. Challenge 8: Remove Duplicate from a Linked List using Hashing
    24. Solution Review: Remove Duplicate from Linked List using Hashing
    25. Challenge 9: Union and Intersection of Lists using Hashing
    26. Solution Review: Union and Intersection of Lists using Hashing
    27. Challenge 10: Find Two Numbers that Add up to “n”
    28. Solution Review: Find Two Numbers that Add up to “n”
    29. Hashing Interview Questions
  10. Summary of Data Structures

    1. Overview of Linear & Non-Linear Data Structures
    2. Conclusion

Catalog

Topic Name of the challenge Java Go Rust Haskell
Abstract data types Implement Bag Using LinkedList yes
Implement Queue Using LinkedList yes
Implement Stack Using DoubleLinkedList yes
Implement Stack Using LinkedList yes
Queue using Stacks - https://www.geeksforgeeks.org/dsa/queue-using-stacks/
Implement Stack using Queues - https://www.geeksforgeeks.org/dsa/implement-stack-using-queue/
Implement k stacks in an array - https://www.geeksforgeeks.org/dsa/efficiently-implement-k-stacks-single-array/
Implement a stack using single queue - https://www.geeksforgeeks.org/dsa/implement-a-stack-using-single-queue/
Implement stack using priority queue or heap? - https://www.geeksforgeeks.org/dsa/implement-stack-using-priority-queue-or-heap/
Implement Stack and Queue using Deque - https://www.geeksforgeeks.org/dsa/implement-stack-queue-using-deque/
Stack using two queues - https://www.geeksforgeeks.org/problems/stack-using-two-queues/1
Evaluate Postfix Expressions or Reverse Polish Notation (RPN) yes
ExpressionEvaluation yes
FixedCapacityStack yes
FullyParenthesizedArithmeticExpressionEvaluation yes
ResizingArrayStack yes
ReverseAGivenStack yes
ReverseUsingStack.java yes
Array ArrayCyclicRotation yes
OddNumberOfAnArray yes
ArrayResizing yes
BirthdayCakeCandles yes
DropFirstNElementsOfAnArray yes
EquilibriumIndexOfArray yes
KadanesAlgorithm.pdf
LargestSumSubarray yes
MaximumAndMinimumElementsInAnArray yes
MaximumContiguousSubarraySumProblems.pdf
MoveNegativeElementsToTheLeft yes
SearchForANumberInAnArray yes
SequentialParallelAlgorithms4MaxSubarrayProblem yes
SimpleArraySum yes yes
SmallestIndexInAnArrayThatHasAllTheElements yes
SubarraysWithNegativeSum yes
SumOfNaturalNumbersUptoN yes
SwapElementsToMakeSumEqual yes
Two Sum yes yes yes
TwoSumFromTwoDifferentArrays yes
TwoSumInputArrayIsSorted yes
UniqueNumbersInAnArray yes
VeryBigArraySum yes
WriteArrayBackwards yes
Compute number of inversion in an array
Polygon concavity index
Flood depth
Slalom skiing
Array recovery
Binary Search Min Max Division
Nailing Planks
CaterpillarMethod absolute distinct count of this array
count distinct slices
count triangles
minimal absolute value of a sum of two elements
Counting elements Frog river one
Max counters
Permutation check
smallest positive number missing from array
Dynamic programming Min Abs Sum
Number Solitaire
Euclidean algorithm GCD
Chocolates by numbers
Common prime divisors
Fibonacci numbers Fib Frog
Ladder
Fibonacci Sequence until N yes
Fibonacci number at position N yes
EvenFibonacciSequence yes yes yes
Fractions CropRatio.java yes
PlusMinus.java yes
Greedy algorithms max non overlapping segments
tie ropes
Hacker Rank 3DSurfaceArea.pdf
AbsolutePermutation.pdf
ACM-ICPC-Team.pdf
AlmostSorted.pdf
AngryProfessor yes
AppendAndDelete.pdf
AppleAndOrange.pdf yes yes
BeautifulDaysAtTheMovies.java
BeautifulTriplets.pdf
BetweenTwoSets yes yes
BiggerIsGreater.pdf
BirthdayChocolate.pdf
BonAppetit.pdf
BreakingTheRecords.pdf yes
CatsAndAMouse.pdf
CavityMap.pdf
ChocolateFeast.pdf
CircularArrayRotation.pdf
ClimbingTheLeaderboard.pdf
CountingValleys.pdf
CutTheSticks.pdf
DayOfTheProgrammer.pdf yes
DesignerPdfViewer.pdf
DivisibleSumPairs.pdf yes
DrawingBook.pdf
ElectronicsShop.pdf
EmasSupercomputer.pdf
Encryption.pdf
EqualiseTheArray.pdf
ExtraLongFactorials.pdf
FairRations.pdf
FindDigits.pdf
FlatlandSpaceStations.pdf
FormingAMagicSquare.pdf
GradingStudents.pdf yes yes
HalloweenSale.pdf
HappyLadybugs.pdf
JumpingOnTheClouds.pdf
JumpingOnTheCloudsRevisited.pdf
Kangaroo.pdf yes
LarrysArray.pdf
LibraryFine.pdf
LisasWorkbook.pdf
ManasaAndStones.pdf
MatrixLayerRotation.pdf
MigratoryBirds.pdf yes
MinimumDistances.pdf
ModifiedKaprekarNumbers.pdf
NonDivisibleSubset.pdf
OrganizingContainersOfBalls.pdf
PickingNumbers.pdf
QueensAttack2.pdf
RepeatedString.pdf
SaveThePrisoner.pdf
SequenceEquation.pdf
ServiceLane.pdf
SherlockAndSquares.pdf
SimpleArraySum yes
SockMerchant.pdf yes
StrangeCounter.pdf
TaumAndBday.pdf
TheBombermanGame.pdf
TheGridSearch.pdf
TheHurdleRace.pdf
TheTimeInWords.pdf
UtopianTree.pdf
VeryBigArraySum yes yes
ViralAdvertising.pdf
Higher order functions 11EtaConversion.org yes
12ANoteAboutListEfficiency.org yes
13CurriedFunctions.hs yes
14SomeHigherOrderismIsInOrder.hs yes
15MapsAndFilters.hs yes
16Lambdas.hs yes
17Folds.hs yes
18Scans.hs yes
19FunctionApplicationWith$.org yes
20FunctionComposition01.org yes
21FunctionComposition.hs yes
Hash Maps IteratingAHashMap yes
Hash Tables ChainingHashTableClient yes
IteratingAHashTable yes
LinearProbingHashTableClient yes
SimpleHashTable_Chaining yes
SimpleHashTable_LinearProbing yes
Heap Heap yes
HeapClient yes
PriorityQueueClient yes
Iterations Binary gap yes
Linked list (jdk) JdkLinkedListClient yes
Linked list (singly linked list) Sorted Integer LinkedList yes
Employee Single Linked List yes
Reverse a linked list in place
Add an element at the middle of the linked list
Sort a linked list in Java (http://www.java67.com/2016/02/how-to-sort-linkedlist-in-java-example.html)
Remove Nth Node from the end of a linked list (https://leetcode.com/problems/remove-nth-node-from-end-of-list/solution/)
Merge two sorted linked list
Find the middle element of a singly linked list in one pass? (http://javarevisited.blogspot.sg/2012/12/how-to-find-middle-element-of-linked-list-one-pass.html)
Check if a given linked list contains a cycle? How do you find the starting node of the cycle? (http://javarevisited.blogspot.sg/2013/05/find-if-linked-list-contains-loops-cycle-cyclic-circular-check.html)
Reverse a linked list? (http://www.java67.com/2016/07/how-to-reverse-singly-linked-list-in-java-example.html)
Reverse a singly linked list without recursion? (http://javarevisited.blogspot.sg/2017/03/how-to-reverse-linked-list-in-java-using-iteration-and-recursion.html)
Remove duplicate nodes from an unsorted linked list? (https://www.geeksforgeeks.org/remove-duplicates-from-an-unsorted-linked-list/)
Remove duplicates from a sorted linked list? (https://leetcode.com/problems/remove-duplicates-from-sorted-list/solution/)
Find the length of a singly linked list? (http://javarevisited.blogspot.sg/2016/05/how-do-you-find-length-of-singly-linked.html)
Find the third node from the end in a singly linked list? (http://javarevisited.blogspot.sg/2016/07/how-to-find-3rd-element-from-end-in-linked-list-java.html)
Find the sum of two linked lists using Stack? (https://www.geeksforgeeks.org/sum-of-two-linked-lists/)
Find the node at which the intersection of two singly linked lists begins. (https://leetcode.com/problems/intersection-of-two-linked-lists/solution/)
Given a linked list and a value , partition it such that all nodes less than x come before nodes greater than or equal to x. (https://leetcode.com/problems/partition-list/solution/)
Check if a given linked list is a palindrome?
AddTwoNumbersAsALinkedList.txt
DetectLinkedListCycle.txt
DetermineIfLinkedListIsPalindrome.txt
IntersectionOfLinkedLists.txt
MergeKSortedLinkedLists.txt
RemoveDuplicateFromLinkedList.txt
RemoveDuplicatesFromSortedList.txt
RemovekthLastElementFromLinkedList.txt
ReverseALinkedList.txt
RotateLinkedList.txt
SwapEveryTwoNodesInALinkedList.txt
Remove all elements from a linked list of integers which matches with given value?
Linked list (doubly linked list) Employee Double LinkedList yes
Lists CompareTriplets yes
IteratingAnArrayList yes
List Ranges yes
Infinite Lists yes
List comprehensions yes
Tuples yes
CountFrequencyOfElementsInAList yes
EveryNthElementInAList yes
FindFirstDuplicate yes
GetTheMiddleElementsOfAList yes
IsListSymmetric yes
LengthOfAList yes
MaxAndMinElementsInAListAndTheirIndices yes
RemoveDuplicatesFromList yes
UniqueElementsInAList yes
Maps Bag Of Words yes
Top K Frequent Words yes
Matrix Diagonal Difference yes
Absolute difference between the sums of its diagonals in a square matrix yes
Mooshak Catching Cheese yes
There are a lot of helpful methods for matrices here :
https://introcs.cs.princeton.edu/java/95linear/Matrix.java.html
Numbers Collatz Sequences yes
FindOddNumbersBetweenLAndR.java yes
GCDOfNumbersInAnArray.java yes
GCDOfTwoNumbersUsingEuclideanAlgorithm.java yes
Integer Palindrome yes
LargestNumberUnderNDivisibleByAGivenNumber.java yes
LCMOfNumbersInAnArray.java yes
LCMOfTwoNumbers.java yes
MiniMaxSum.java yes
ReverseInteger.java yes
RightTriange.java yes
SumOfAllOddSquaresSmallerThanN.java yes
SwapIntegersWithoutUsingATempVariable.java yes
Absolute yes
AddTwoNumbers yes
CalculateEndTimeByStartTimeAndDuration yes
CollatzSequences yes
Convert list to decimal number yes
Double all numbers in a list of integers yes yes
Check if number is even or odd yes
Generate a list of even Numbers Till N yes yes yes
Generate a list of First N Even Numbers yes yes yes
Generate a list of N even numbers from a given number yes
FibonacciSequence yes yes yes
GenerateAListOfAllEvenNumbersTillN yes yes
GenerateAListOfFirstNEvenNumbers yes yes
Largest number under n divisible by a given number yes
LeapYear yes
Primes yes
RightTriangle yes
SumOfAllEvenNumbersInAListOfIntegers yes
SumOfAllOddSquaresSmallerThanN yes
SumOfEvenValuedFibonacciTermsLessThanMaxValue yes
SumOfFirstNMultiplesOf3Or5 yes
SumOfIntegersInAList yes
SumOfMultiplesOf3Or5SmallerThanN yes
SumSquareDifference yes
NumberLineJumps.pdf NumberLineJumps.hs yes
Numbers.NumeralSystems Roman To Decimal yes
Numbers.NumeralSystems Decimal To Roman yes
Leader Dominator
EquiLeader
Maximum Slice problem max double slice sum
max double slice sum
max profit
max slice sum
Prefix sums CountDiv yes
GenomicRangeQuery yes
CountDiv yes
GenomicRangeQuery yes
MaxOrMinAvgSubArrayOfSpecifiedSize yes
MinAvgTwoSlice2 yes
MinAvgTwoSlice3 yes
MinAvgTwoSlice yes
MinAvgTwoSliceProof.pdf yes
MushroomPicker yes
PassingCars yes
PrefixSums yes
PrimeAndCompositeNumbers CountFactors
Flags
MinPerimeterRectangle
Peaks
Shunting yard algorithm TransformAnInfixExpressionToPostfixNotation.java yes
Determine if string with multiple parentheses types is properly nested
Number of fish alive
Determine if string with single parentheses type is properly nested
Minimum number of blocks needed to build a wall
SieveOfEratosthenes CountNonDivisible
CountSemiprimes
CountNonDivisible
Sorting Distinct
MaxProductOfThree
NumberOfDiscIntersections
Triangle
Strings symmetry point of a string
depth of a peculiarly represented tree yes yes
reverse characters in a string (for loop) yes
reverse characters in a string using linked list (See String Palindrome) yes
reverse characters in a string using queue (See String Palindrome) yes
longest password
dwarfs rafting
BalancedParanthesis yes
FizzBuzz yes yes yes
FizzBuzzMultithreaded yes
MostCommonCharacterInString yes
Permutations yes
ReverseWordsInASentence yes
Staircase yes
StringPalindrome yes yes
StringReversal yes
TimeConversion yes
ToCamelCase yes
AddLineNumbersToSourceCode.hs yes
Anagram.hs yes
Angles Of A Clock yes
AssessMovies.hs yes
CaesarCipher.hs yes
CheckIfAllCharsOfAStringAreInAnotherString.hs yes
ConvertAStringToLowerCase.hs yes
ExamScoreProcessing.hs yes
FizzBuzz.hs yes
GeneralizedFibonacciSelector.hs yes
GetTheMiddleCharactersOfAString.org yes
GroupNamesByAlphabets.hs yes
ISBNVerifier.hs yes
LongestCommonSubsequenceBetweenTwoStrings.hs yes
Pagination.hs yes
Pangram.hs yes
RailFenceCipher.hs yes
RemoveSubstringFromAString.hs yes
Count the number of words in a file WordCount.hs
Count the number of characters in a file WordCount.hs
Recursion ChoosingKOutOfNThings yes
Factorial yes yes
FindTheKthSmallestValueOfAnArray yes
MultiplyingRabbits yes
OrganizingAParade yes
ProductOfFirstNRealNumbersInArrayUsingRecurson yes
ProductOfIntegersInArrayUsingRecursion yes
TowersOfHanoi yes
Search BinarySearch yes
LinearSearch yes
Sorting BubbleSort yes
BucketSort yes
CountingSort yes
HeapSort yes
InsertionSort yes
MergeSort yes
Quicksort yes yes
RadixSort yes
SelectionSort yes
ShellSort yes
LinearTimeSort yes
Sorting by enums Person.java yes
PersonRole.java yes
Sorting objects ArraysAndListsComparator.java yes
Fruit.java yes
NameComparator.java yes
QuantityComparator.java yes
RatingAndNameComparator.java yes
RatingComparator.java yes
Time complexity Frog jumps
Perm missing element
Tape equilibrium
Trees BinaryTree_ArithmeticBT.txt
BinaryTree_BreadthFirstTreeTraversal_ListsByLevel.txt
BinaryTree_BreadthFirstTreeTraversal.txt
BinaryTree_BuildBinarySearchTree.txt
BinaryTree_CeilingOfAGivenElement.txt
BinaryTree_ChangeSortedListOfNumbersIntoBalancedBinarySearchTree.txt
BinaryTree_CheckIfItIsValidBST.txt
BinaryTree_ConvertBinaryTreeToFullBinaryTree.txt
BinaryTree_CountFullNodesInABinaryTree.txt
BinaryTree_CountNumberOfNodesInACompleteBinaryTree.txt
BinaryTree_CountNumberOfNodesInAFullBinaryTree.txt
BinaryTree_DeleteAnElementFromATree.txt
BinaryTree_DepthFirstTreeTraversal.txt
BinaryTree_FindAllDuplicateSubtrees.txt
BinaryTree_FindIfASubtreeExistsInATree.txt
BinaryTree_FindTheDeepestNode.txt
BinaryTree_Flatten.txt
BinaryTree_FloorOfAnElementInABT.txt
BinaryTree_HeightAndDepth.txt
BinaryTree_HeightBalancedBT.txt
Binary Tree - In-order traversal using O1 space.txt
BinaryTree_Invert a binary tree in place.txt
BinaryTree_LargestBSTInABinaryTree.txt
BinaryTree_LargestPathFromRootToLeaf.txt
BinaryTree_LevelOfTreeWithMaximumSum.txt
BinaryTree_LevelOfTreeWithMinimumSum.txt
BinaryTree_MaximumAndMinimumElementsInATree.txt
BinaryTree_MinimumPathSumFromRootToLeaf.txt
BinaryTree_NumberOfCousinsInLevelOrder.txt
BinaryTree_PathsFromRootToAllLeaves.txt
BinaryTree_PrintNodesInBoustrophedonOrder.txt
BinaryTree_PruneByLeafNodeValues.txt
BinaryTree_ReconstrunctBinaryTreeFromPreorderAndInorderTraversals.txt
BinaryTree_RemoveNodesToMakeAFullBT.txt
BinaryTree_ReturnNodeValuesAtAGivenHeight.txt
BinaryTree_RootToLeafNumbersSummed.txt
BinaryTree_SearchForAnElementInATree.txt
BinaryTree_TargetSumFromRootToLeaf.txt
BinaryTree_UnivalSubtrees.txt
BinaryTree_ZigZagBinaryTree.txt
Build a Huffman Tree.txt
CartesianTree.txt
Cartesian Tree With a Sequence.txt
CloneTrees.txt
Cousins for all nodes in a tree.txt
CousinsForAllNodes.txt
GenerateAFiniteTreeInConstantTime.txt
Horizontal Distance of each node in a tree and Bottom View of the tree with and without horizontal distance.txt
ImplementLockingInABinaryTree
LeafSimilarTrees.txt
Level of the tree with minimum sum.txt
MakingAHeightBalancedBinarySearchTree.txt
MaximumPathSumInBinaryTree.txt
Merge trees by adding nodes at the same positions.txt
MergeTwoBinaryTreesBasedOnCriteria.txt
MinimumDepthOfNodesInBinaryTree.txt
MostFrequentSubtreeSum.txt
PrintATreeLevelByLevelWithLineBreaks.txt
RemoveEdgesInATree.txt
SplitABinarySearchTree.txt
SymmetricKaryTree.txt
TreeSerialization.txt
Unidentified Hilbert maze
Rectangle builder greater area
Tree product
Diamonds count
Socks laundering
Tennis tournament
PersonalizedCoupons yes
Geometry (Cube) yes
Geometry (Cuboid) yes
Geometry (Sphere) yes
Algebraic Data Types yes
10RecursiveDataStructure.hs yes
Association Lists yes
Pattern matching yes
Guards yes
Object Oriented and System Design examples LRU Cache (Hash map and double linked list) yes
Vending machine yes
Design a Lift system
Design a Trade Position Aggregator or Portfolio Manager
Design a Traffic Controller System for a Junction
Design a URL shortener service

TODO

  1. AbsolutePath.txt
  2. AddDigits.txt
  3. Angry Professor.txt
  4. AnIntroToBacktracking.txt
  5. Autocompletion.txt
  6. Balanced Parantheses Quesions.txt
  7. Between two sets.txt
  8. BuddyStrings.txt
  9. Calculate the fractions positive, negative, and zero elements in an array.txt
  10. CharacterMap.txt
  11. Rearrange String to make it a palindrome.txt
  12. Check if an array is a permutation.txt
  13. ChoosingKOutOfNThings.txt
  14. CircleOfChainedWords.txt
  15. CitySkyline.txt
  16. ClosestPointsToOrigin.txt
  17. ClosestTo3Sum.txt
  18. CollatzSequences.txt
  19. CommonCharacters.txt
  20. CompareVersionNumbers.txt
  21. Compute number of integers divisible by a number.txt
  22. ConcatenatedWords.txt
  23. ConnectedColorsInAGrid.txt
  24. ConsecutiveOnes.txt
  25. ConstructAllPossibleBSTs.txt
  26. ContiguousSubArrayWithMaximumSum.txt
  27. ConvertDecimalNumeralsToRoman.txt
  28. ConvertFractionToDecimal.txt
  29. ConvertRomanNumeralsToDecimal.txt
  30. ConvertToBaseTwo.txt
  31. ConvertToHexadecimal.txt
  32. CoursePrerequisites.txt
  33. CreateASimpleCalculator.txt
  34. DecodeString.txt
  35. DeepCopyGraph.txt
  36. DesignTicTacToe.txt
  37. DetermineIfNumber.txt
  38. DistributeBonuses.txt
  39. Earliest time when a frog can jump to the other side of a river.txt
  40. EditDistance.txt
  41. Equilibrium index of an array.txt
  42. Evaluate expression.txt
  43. EvaluatePostfixExpression.txt
  44. Even Fibonacci Numbers.txt
  45. FallingDominoes.txt
  46. FindClosestPoints.txt
  47. FindCyclesInAGraph.txt
  48. FindDuplicates.txt
  49. FindKthLargestElementInAList.txt
  50. FindNonDuplicateNumber.txt
  51. FindTheKthLargestNumber.txt
  52. FindTheKthSmallestValueOfAnArray.txt
  53. FindTheNumberOfIslands.txt
  54. FindTheSingleElementInAnArrayOfDuplicates.txt
  55. FirstAndLastIndicesOfAnElementInSortedArray.txt
  56. FirstMissingPositiveInteger.txt
  57. FirstRecurringCharacter.txt
  58. FixBrackets.txt
  59. Split string into parts with equal number of opening and closing brackets.txt
  60. FixedCapacityStack.txt
  61. FixedPoint.txt
  62. FizzBuzzMultithreaded.txt
  63. FizzBuzz.txt
  64. FlattenDictionary.txt
  65. Frog jumps.txt
  66. FullyParenthesizedArithmeticExpressionEvaluation.txt
  67. GenerateAllIPAddresses.txt
  68. Genomic Range Query.txt
  69. HIndex.txt
  70. HowToPickARandomElementFromAnInfiniteStream.txt
  71. HowToSolveAHardProgrammingInterviewQuestion.txt
  72. IndexOfLargestNextNumber.txt
  73. InorderSuccessor.txt
  74. IntersectionOfLists.txt
  75. IntersectionOfTwoArrays.txt
  76. JumpToTheEnd.txt
  77. KaprekarsConstant.txt
  78. KClosestElements.txt
  79. LargestProductOfThreeElements.txt
  80. list.txt
  81. LongestCommonPrefix.txt
  82. LongestConsecutiveSequence.txt
  83. LongestIncreasingSubsequenct.txt
  84. LongestPalindromicSubstring.txt
  85. LongestSubstringWithKDistinctCharacters.txt
  86. LongestSubstrWithoutRepeatingCharacters.txt
  87. LookAndSaySequence.txt
  88. LowestCommonAncestorOfTwoGivenNodes.txt
  89. MajorityElement.txt
  90. MakeTheLargestNumber.txt
  91. MakingChange.txt
  92. MaxAndMinWithMinimumComparisons.txt
  93. MaximumInAStact.txt
  94. MaximumNonAdjacentSum.txt
  95. MaximumProfitFromStocks.txt
  96. Max Or Min Avg SubArray Of Specified Size.txt
  97. MazePaths.txt
  98. MergeListOfNumberIntoRanges.txt
  99. MergeOverlappingIntervals.txt
  100. Minimal average of any slice containing at least two elements.txt
  101. MinimumNumberOfOperations.txt
  102. MinimumRemovalsForValidParanthesis.txt
  103. MinimumSizeSubarraySum.txt
  104. MinRangeNeededToSort.txt
  105. MinStack.txt
  106. Missing element in a permutation.txt
  107. MissingRanges.txt
  108. MostCommonCharacterInString.txt
  109. MoveZeroes.txt
  110. MultiplyingRabbits.txt
  111. Multiply.txt
  112. Multitasking.txt
  113. MyStory.txt
  114. NearestPoints.txt
  115. Next smallest integer from a sorted array.txt
  116. NoAdjacentRepeatingCharacters.txt
  117. NonDecreasingArrayWithSingleModification.txt
  118. NthFibbonacciNumber.txt
  119. NumberOf1Bits.txt
  120. NumberOfConnectedComponents.txt
  121. NumberOfMeetingRooms.txt
  122. NumberOfWaysToClimbStairs.txt
  123. OptimizedListSum.txt
  124. OrganizingAParade.txt
  125. PartitionAList.txt
  126. PascalsTriangle.txt
  127. Passing cars.txt
  128. PerfectNumber.txt
  129. PermutationsOfNumbers.txt
  130. PhoneNumbers.txt
  131. PickingUpChange.txt
  132. PlusOne.txt
  133. PostorderTraversal.txt
  134. PowerFunction.txt
  135. Print a staircase of size N.txt
  136. ProductOfArrayExceptSelf.txt
  137. PythagoreanTriplets.txt
  138. QueensOnAChessboard.txt
  139. QueueUsingTwoStacks.txt
  140. RangeSearchingInASortedList.txt
  141. RansonNote.txt
  142. RectangleIntersection.txt
  143. RemoveAdjacentDuplicateCharacters.txt
  144. RemoveCharacterToCreatePalindrome.txt
  145. RemoveConsecutiveNodesThatSumToZero.txt
  146. RemoveOneLayerOfParanthesis.txt
  147. ReshapingMatrix.txt
  148. ResizingArrayStack.txt
  149. ReverseADirectedGraph.txt
  150. ReverseBits.txt
  151. Reverse digits of an integer.txt
  152. ReverseInteger.txt
  153. ReversePolishNotationCalculator.txt
  154. ReverseWordsInASentence.txt
  155. ReverseWordsInAString.txt
  156. ReverseWords.txt
  157. RoomScheduling.txt
  158. Root to leaf path that sums up to k.txt
  159. RotateArray.txt
  160. RotateMatrix.txt
  161. RunningMedian.txt
  162. ScheduleTasks.txt
  163. SemanticVersionComparator.txt
  164. ShiftedString.txt
  165. ShortestDistanceToCharacter.txt
  166. ShortestUniquePrefix.txt
  167. SmallestNumberThatIsNotASumOfASubsetOfList.txt
  168. Smallest positive number missing from a series.txt
  169. SortAListWithThreeUniqueNumbers.txt
  170. SortAPartiallySortedList.txt
  171. SortColors.txt
  172. SortedSquareNumbers.txt
  173. SortingWindowRange.txt
  174. SpiralTraversalOfGrid.txt
  175. SpreadsheetColumns.txt
  176. SpreadsheetColumnTitle.txt
  177. Squareroot.txt
  178. StayingOnAChessBoard.txt
  179. StringCompression.txt
  180. StringToInteger.txt
  181. SubArrayWithTargetSum.txt
  182. SudokuCheck.txt
  183. SumBinaryNumbers.txt
  184. Sum of all odd squares that are smaller than 10,000.txt
  185. SumOfSquares.txt
  186. SwapBits.txt
  187. SwapElementsToMakeSumEqual.txt
  188. SwapIntegersWithoutUsingATempVariable.txt
  189. Tape Equilibrium.txt
  190. TheBiggestMistakeInTheCodingInterviewsCandidatesMake.txt
  191. TheRealSecretToGettingAJobAtATopCompany.txt
  192. ThreeSum.txt
  193. TopKFrequenntWords.txt
  194. TransformAnInfixExpressionToPostfixNotation.txt
  195. TransposeMatrix.txt
  196. TrappingRainwater.txt
  197. ValidMountainArray.txt
  198. WaysToTraverseAGrid.txt
  199. Welcome.txt
  200. WhyPython.txt
  201. WitnessOfTheTallPeople.txt
  202. WordConcatenation.txt
  203. WordOrderingInADifferentAlphabeticalOrder.txt
  204. WordSearch.txt
  205. Print array as table.txt
  206. Substrings of size K with K distinct chars.txt
  207. Find the first circular tour that visits all petrol pumps.txt

Links to this note