FactSet Research Systems, Inc Interview Question for Software Engineer / Developers


Country: United States




Comment hidden because of low score. Click to expand.
0
of 0 vote

I can only come up with a solution in PL/SQL to do it. Were you able to do it in SQL?

- kr.neerav March 29, 2014 | Flag Reply
Comment hidden because of low score. Click to expand.
0
of 0 vote

Run the query, and do the computations on the results you get.

- Anonymous March 30, 2014 | Flag Reply
Comment hidden because of low score. Click to expand.
0
of 0 votes

How do you do the computations without using sql aggregate function and only using sql queries?

- kr.neerav March 30, 2014 | Flag
Comment hidden because of low score. Click to expand.
0
of 0 votes

Huh?

If you want to find the average salary of employees under a specific manager, get the list of salaries (using the simple sql query), and find the average yourself by going through the returned results and computing the average yourself.

Might not be efficient, but that is what we get for putting idiotic constraints.

- Anonymous March 31, 2014 | Flag
Comment hidden because of low score. Click to expand.
0
of 0 vote

There is a way to do this with only basic SQL queries.

In fact, I believe that's how these aggregate functions are implemented behind the scenes. But I can't recall how. Some Googling will turn up an answer I'm sure.

- static416 April 06, 2014 | Flag Reply
Comment hidden because of low score. Click to expand.
0
of 0 vote

use cursor to get the sum and avg
use row_number cooperating with count to find the median

- Jessica April 08, 2014 | Flag Reply
Comment hidden because of low score. Click to expand.
0
of 0 vote

I have implemented the sum function using recursive with clause in Oracle SQL, similarly it can be modified for average (sum/count)

WITH s (iteration, num_sum)
     AS (SELECT row_id iteration, xn.num
           FROM (    SELECT NUM,
                            ROW_NUMBER () OVER (ORDER BY num) row_id
                       FROM xxtest_num) xn
          WHERE xn.row_id = 1 -- first row in the table
         UNION ALL
         SELECT s1.iteration + 1, s1.num_sum + xn1.num
           FROM s s1,
                (     SELECT NUM,
                            ROW_NUMBER () OVER (ORDER BY num) row_id
                       FROM xxtest_num) xn1
          WHERE s1.iteration <= 10 -- stopping condition count of rows
          AND s1.iteration + 1 = xn1.row_id)
SELECT num_sum
  FROM (  SELECT *
            FROM s s1
        ORDER BY num_sum DESC)
 WHERE ROWNUM = 1;

- monika.m.srivastava June 15, 2016 | Flag Reply


Add a Comment
Name:

Writing Code? Surround your code with {{{ and }}} to preserve whitespace.

Books

is a comprehensive book on getting a job at a top tech company, while focuses on dev interviews and does this for PMs.

Learn More

Videos

CareerCup's interview videos give you a real-life look at technical interviews. In these unscripted videos, watch how other candidates handle tough questions and how the interviewer thinks about their performance.

Learn More

Resume Review

Most engineers make critical mistakes on their resumes -- we can fix your resume with our custom resume review service. And, we use fellow engineers as our resume reviewers, so you can be sure that we "get" what you're saying.

Learn More

Mock Interviews

Our Mock Interviews will be conducted "in character" just like a real interview, and can focus on whatever topics you want. All our interviewers have worked for Microsoft, Google or Amazon, you know you'll get a true-to-life experience.

Learn More