SQL injection is when SQL statements are entered into data fields that are to be stored in an SQL database. The most usual mitigation techniques include parameterized statements, escaping characters with special meaning in SQL, pattern checking and limiting database permissions.

# Tag Archives: Software Developer

# IN SQL, WITH UNIQUE KEYS, WHAT DOES INNER AND OUTER JOIN DO?

Both operations join two tables. Inner join works as the intersection between the tables, so only keys that exists in both tables will be kept in the joined table. Outer join works as the union between the tables, so all rows are included in the joined table. (Left outer join will keep all rows from the left table, while only the rows with keys that also exists in the left table are included from the right table. Equivalently, right outer join includes all rows from the right table, but not necessarily all rows from the left.)

# HOW DOES THE A* ALGORITHM WORK?

A* is a path-finding algorithm that works on weighted graphs with a heuristic function that estimates the cost of travelling from node *n *to the goal node (The heuristic function is problem specific). The nodes to be considered at each step is stored in a collection – usually a priority queue. It starts by adding every node that is adjacent to the start node into the queue with their estimated total cost, based on the formula *f(n) = g(n) + h(n)*, where *g(n)* is the actual cost from the start node to node *n*, while *h(n)* is the heuristic function. At each iteration, the node with the smallest estimated cost *f(n)* is expanded. A path is found when the goal node is the one chosen for expansion. Alternatively, no path is found if the queue becomes empty.

# What is the average and worst case run time of the quicksort algorithm?

Average case: O(n log n) – Worst case: O(n2)

# WHAT IS A RECURSIVE FUNCTION?

A recursive function is a function that calls itself. At each function call, one or more parameters are changed. The recursion continues until a base case (a set of parameters which return a value instead of calling itself recursively) is reached, and the recursion is resolved.