Skip to content

Software Engineering: Interview Questions

codeshare.io is useful

  • What built-in datatypes are in python
  • What’s a dictionary, vs a list
  • What’s faster for a lookup, list or dictionary
  • What’s a tuple
  • What’s a lambda
  • What are decorators, classmethod, staticmethod
  • Ideal design for a function, how to keep clean code
  • How do you write code
  • How to find and kill a process from cli
  • Man page
  • PATH vs PYTHONPATH, what are they
  • What is a .bashrc, .bash_profile, difference
  • Systemctl, how to get logs from systemctl
  • Check disk left on a mount
  • Docker/Kubernetes, have you ever used
  • How many rows in a table
  • inner vs outer join
  • transactions
  • code interface with sql, whats important
  • how to find out why sql is slow
  • how is code deployed in current env
  • ideal deployment
  • git tags, branches, patching, etc…
  • canary deployments, dogfood

Definitions: Matching Algorithm: How we match/trade orders on the stock exchange. Order: Just a set of instructions from a customer. Looks like this: Buy 100 shares of Amazon for $220 each Book: The term that’s used for the ‘virtual’ marketplace that tracks what customers want.

Price/Time Matching Algorithm Assumptions: Fully handle 1 order at a time before it rests on the book Variables that can change: Side (buy or sell), order quantity, symbol and price

Price/Time Matching Algorithm:

  1. Execute against the best price first
  2. If price is the same, then the order that arrived first has priority

Examples: Example 1: Order 1) Buy 100 shares of Amazon for $170 each Order 2) Sell 100 shares of Amazon for $170 each

These orders will cross/trade/execute with each other and a trade will happen. (Customer 1 buys 100 shares of Amazon from customer 2 at $170 each)

Example 2: Order 1) Buy 100 shares of Amazon for $170 each Order 2) Buy 100 shares of Amazon for $170 each Order 3) Sell 200 shares of Amazon for $170

What do you think happens in example 2?

Come up with as many test cases as you can for the price/time algorithm.