Backend interview questions

Sources:

Important questions and links:

TSQL Questions:

  • Finding Grand parent in a parent-child table (http://sqlfiddle.com/#!6/24c7b/6)
  • There are three projects and each have its table. Table have information of employee ids and hours of work they have done in that project. Print list of all employees and total hours they have worked across all projects. (Full Outer Join with Coalesce)
  • Implementation of SCD – 2 (Pull data from sources, make a dimension which has 4 of its columns trended)
  • Output for a query that contains a self-joined table on condition A.ID = B.ID – 1 and select has subtraction of fact
  • Many to many relationship (keep mapping table)
  • Left Join and WHERE clause (which works as EXCEPT

SQL Hacks: http://sqlzoo.net/wiki/Running_Total

SQL Hacks book: (Download it from 4shared.com)

Important hacks:

  • 3
  • 10 (Without the subquery, the optimizer finds it much easier to use your indexes)
  • 11
  • 23
  • 24 (Multiply across result set) (Exp, SUM, Log)
  • 25
  • 27 (Join on equality condition and OR)
  • 31
  • 51
  • 52
  • 56
  • 75
  • 78
  • 80
  • 81
  • 82
  • 84
  • 85
  • 88
Advertisements

Leave a comment

Filed under Interviews

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s