A list of common coding questions

As always we look to provide you the best source of information and assistance in preparing for your next career progression.

Along with Google Search, there are many interesting search sites and applications to provide views and examples as answers to the questions that you submit. One service that we like to use is Quora and while we were browsing some of the answers we found a useful post on common interview coding questions that we thought might be of interest.

So we here are some of the questions posed:

Simple Factual Questions

  •     What port does HTTP use?
  •     What is the time complexity of merge sort?
  •     What data structure underlies a Python list?

Data Structure/Algorithms Questions

  •     Given two nodes in an arbitrary tree, write a function to find the most-specific-common-ancestor
  •     Given a list of n integers, write a function to determine if any two sum to k [2]
  •     Given k guards in a museum with n rooms that are connected in a certain way (was drawn on a whiteboard when I was asked this) write a function to determine which of the k guards is closest to each of the n rooms

Tedious Programming Questions

  •     Given an integer, write a function to print it out in words (e.g. given 342, print “three-hundred forty-two”
  •     Given an amount charged and cash tendered, write a function to make change using the fewest number of bills/coins possible

Language-Specific Questions

  •     What is the difference between an Interface and an Abstract Class in Java?
  •     If in a Python class, you inherit from multiple parent classes that both have an instance method of the same name, which implementation is picked by default for the child class?

Implement a Data Structure Questions

  •     Implement a “min-stack” (a data structure that behaves just like a stack in terms of push and pop but also supports a function min that returns (but does not pop) the minimum number currently on the stack)
  •     Implement an LRU cache
  •     Using only arrays and primitive types, implement an auto-resizing array

Math-y Questions

  •     How many trailing zeros does the number 52! have?
  •     Given a streaming input of integers and only constant storage, for any n, how can you randomly select one of the n integers you have seen so far such that each has probability 1/n of being selected?

Explain a CS Concept Questions

  •     Explain how heapsort works
  •     How can you sort in sub-n log n time?
  •     What is a mutex?
  •     What’s the difference between a thread and a process?

Explain a Real-World System

  •     How does DNS work? [3]
  •     When you type “google.com” into your address bar and press enter, what happens? [4]
  •     How does virtual memory work?

Security Questions

Describe the browser security model
How does SSL work?
What is a SQL injection attack?
What is XSS?

System Design Questions

  •     How would you design an elevator system?
  •     How would you design a system for running A/B tests on some fraction of the user base?

“Real World” Questions

  •     How do you prevent click-jacking?
  •     How would you implement a “People You May Know” feature in our product?

Database Questions

  •     Given some application and desired functionality, how would you lay out the schema?
  •     Given this schema, write a query to retrieve x
  •     How could you make this query run faster?

Unix Tools Questions

  •     Write a command to find all occurrences of a string for all files in a directory
  •     Given standard Apache access logs, write a command to find the number of unique IPs that hit your web server in the last week

Programming Experience Questions

  •     What is your favorite language and why?
  •     What are your favorite frameworks?
  •     What are some cross-browser inconsistencies?
  •     What is your favorite third-party API?
  •     What’s your favorite version control system?

To read the full article and many of the very useful comments, click here

Developement, Hints & Tips, Hints for the Interview