Factset interview questions

206 questions from 28 interviews · updated from reports 2015-2024

Practise Factset-style

About

FactSet is a financial data and software company that provides market data, analytics, and workflow tools to investment professionals. In India, it is known for hiring Software Engineers, SDE Interns, and Senior Software Engineers for product engineering and data platform work.

The roles that come up most are Software Engineer, SDE Intern and Senior Software Engineer. This covers 28 candidate interviews reported from 2015 to 2024. Most sat it at entry level (25 of 28 that recorded a level), with 1 internship interviews alongside. Among the 26 that recorded either route, arrivals split between campus drives (24, 92%) and off-campus applications (2, 8%). Most questions fall under DSA and CS fundamentals.

Category
Difficulty
Round

Interview questions

Q. Check if a given binary tree is a Sum Tree

asked 2xmediumTreesTechnical2021

Ans. Use a postorder traversal and, for each node, check whether its value equals the sum of values in its left and right subtrees. Empty nodes and leaf nodes are valid Sum Trees. Return both the subtree sum and a validity flag from each recursive call. This takes O(n) time and O(h) stack space.

Q. Count pairs from two sorted matrices whose sum equals a given value

asked 2xmediumArraysTechnical2021

Ans. Use a two pointer scan over the matrices as if they were flattened sorted arrays. Keep one pointer at the smallest element of the first matrix and one at the largest of the second. If the sum is low, advance the first pointer; if high, reduce the second. Count duplicate runs together. Time is O(n²), space O(1).

Q. Find the length of the longest substring without repeating characters

asked 2xmediumStringsTechnical2021

Ans. Use a sliding window and a hash map of each character’s most recent index to find the longest substring without repeats. Move the right pointer through the string; if a character was seen inside the current window, move the left pointer just after its previous index. Track the maximum window length. Time is O(n), space is O(k).

Q. Find the maximum path sum in a binary tree

asked 2xhardTreesTechnical2017-2021

Ans. Use a postorder DFS and keep a global best sum. For each node, compute the best downward gain from its left and right children, ignoring negative gains by taking zero. Update the global answer with node value plus both gains, then return node value plus the larger gain. Time is O(n), space is O(h).

Q. Find a peak element in a given array

asked 2xeasyArraysTechnical2021

Ans. Use binary search to find any peak element by comparing the middle element with its right neighbour. If arr[mid] is less than arr[mid + 1], a peak must exist on the right; otherwise, it exists on the left including mid. This takes O(log n) time and O(1) space.

Q. Check if there exists a root-to-leaf path in a binary tree with a given sum

asked 2xeasyTreesOnline test, Technical2015-2021

Ans. Use depth first search from the root, subtracting each node’s value from the target sum. When you reach a leaf, return true if the remaining sum equals the leaf’s value. Otherwise, recurse into left and right children. This visits each node once, so time is O(n), with O(h) recursion stack space.

Q. Explain the difference between a pointer to a constant and a constant pointer.

asked 2xeasyOOPTechnical2015-2018

Ans. A pointer to a constant means you cannot change the value through that pointer, while a constant pointer means the pointer itself cannot be changed to point elsewhere. The key detail is what const applies to: the pointed-to data, the pointer variable, or both if both are declared constant.

Q. Write a medium-level SQL query.

asked 1xmediumSQLOnline test2021

Ans. A medium-level SQL query can find the highest-paid employee in each department. Join employees to departments, use a window function to rank employees by salary within each department, then keep rank one. The main data structure is the indexed table, and performance is roughly linear after sorting within groups.

Q. Print the right view of a binary tree.

asked 1xmediumTreesTechnical2021

Ans. Use level order traversal and print the last node seen at each level. Keep a queue of nodes, process one level at a time using the current queue size, and record or print the node when it is the last in that level. Time complexity is O(n), and space complexity is O(w).

Q. Reverse a linked list in groups of size k.

asked 1xmediumLinked listsTechnical2021

Ans. Reverse each block of k nodes by rewiring next pointers, then connect the previous block’s tail to the new head of the reversed block. Use three pointers to reverse a block in place, and first check that k nodes remain if partial groups should stay unchanged. Time complexity is O(n), space complexity is O(1).

Q. Search an element in a rotated sorted array

asked 1xmediumBinary searchTechnical2024

Ans. Use a modified binary search: compare the middle element with the ends to decide which half is sorted, then check whether the target lies inside that sorted half. If it does, search there, otherwise search the other half. For distinct elements, this takes O(log n) time and O(1) space.

Q. Find the median in a row-wise sorted matrix.

asked 1xmediumBinary searchTechnical2020

Ans. Use binary search on the value range, not on indices. For a mid value, count how many elements are less than or equal to it by binary searching each sorted row. If the count is at least the median position, move left; otherwise move right. Time is O(rows log cols log valueRange).

Q. Explain Maps, Trees, and LinkedHashMap in Java.

asked 1xmediumOOPTechnical2023

Ans. A Map in Java stores key value pairs with unique keys, while a tree is a hierarchical structure often used for sorted data, such as TreeMap. The key detail is ordering: HashMap gives no order, TreeMap sorts by key, and LinkedHashMap preserves insertion order or access order with predictable iteration.

Q. Compute the vertical sum of a given binary tree.

asked 1xmediumTreesTechnical2021

Ans. Compute horizontal distance for each node, with root at 0, left child at minus 1 and right child at plus 1, then add each node’s value to a map keyed by that distance. Traverse the tree using DFS or BFS. Finally print map values in sorted key order. Time is O(n log k), or O(n) with ordered tracking.

Q. Traverse a binary tree without using extra space.

asked 1xmediumTreesOnline test2017

Ans. Use Morris traversal, which visits the tree in O(1) extra space by temporarily creating threads from each node’s inorder predecessor back to the node. For inorder traversal, if a node has no left child, visit it and move right. Otherwise create or remove the thread, restoring the tree. Time complexity is O(n).

Q. Perform zigzag (spiral) traversal of a binary tree.

asked 1xmediumTreesTechnical2021

Ans. Use level order traversal with a queue, but alternate the order in which each level’s values are recorded. For each level, process all queued nodes, add children left then right, and write values either left to right or right to left. This takes O(n) time and O(w) space, where w is maximum width.

Q. Perform zig-zag (spiral) traversal of a binary tree.

asked 1xmediumTreesOnline test2015

Ans. Use level order traversal with a queue, but reverse the order of values on every alternate level. Process nodes level by level, store current level values in a list, append left and right children to the queue, then add the list normally or reversed. Time complexity is O(n), space complexity is O(n).

Q. Remove zero sum consecutive nodes from a linked list

asked 1xmediumLinked listsTechnical2021

Ans. Use prefix sums with a hash map to skip any consecutive nodes whose sum is zero. Add a dummy node before the head, scan the list, and map each prefix sum to its latest node. Scan again, setting each node’s next to the node after the latest matching prefix sum. Time is O(n), space is O(n).

Q. Write SQL queries using GROUP BY and HAVING clauses.

asked 1xmediumSQLTechnical2016

Ans. Use GROUP BY to aggregate rows by one or more columns, and HAVING to filter the aggregated groups after calculation. For example, group orders by customer and count them, then use HAVING to keep only customers with more than five orders. WHERE filters rows before grouping, while HAVING filters groups after aggregation.

Q. Count pairs from two sorted matrices with a given sum

asked 1xmediumArraysTechnical2021

Ans. Use a two-pointer scan over the sorted order of both matrices, one from the smallest element of the first matrix and one from the largest element of the second. If the sum is target, count it and move both pointers. If smaller, advance the first pointer; if larger, retreat the second. Time is O(n²), space O(1).

Q. Count the number of pairs (x, y) such that x^y > y^x.

asked 1xmediumMathOnline test2015

Ans. Sort Y and precompute counts of 0, 1, 2, 3 and 4. For each x in X, count y values greater than x using binary search, then add y = 0 and y = 1 cases. Handle exceptions: x = 0 gives none, x = 1 gives only y = 0, x = 2 excludes y = 3, 4, and x = 3 includes y = 2. Time is O((n + m) log m).

Q. Given a tree, print the boundary elements of the tree.

asked 1xmediumTreesOnline test2015

Ans. Print the boundary by outputting root, the left boundary excluding leaves, all leaves left to right, then the right boundary excluding leaves in reverse. Use DFS for leaves and a stack or list for the right boundary. Handle missing left or right subtrees carefully. Time complexity is O(n), space is O(h).

Q. Given a number, find the next highest palindrome number.

asked 1xmediumMathTechnical2015

Ans. Mirror the left half of the number onto the right; if the result is greater than the original, it is the answer. Otherwise, increment the middle digit or digits, propagate any carry leftwards, then mirror again. If all digits are 9, the answer is 100...001. This takes O(n) time and O(n) space.

Q. Find the height of a binary tree without using recursion.

asked 1xmediumTreesTechnical2015

Ans. Use level order traversal with a queue and count how many levels you process. Put the root in the queue, then repeatedly process all nodes currently in the queue as one level and add their children. The level count is the height. Time complexity is O(n), and space complexity is O(w), where w is maximum width.

Q. Print all subsequences of a given string using recursion.

asked 1xmediumRecursionTechnical2024

Ans. Use recursion with an index and a current result string. At each character, make two calls: one including the character and one excluding it. When the index reaches the string length, print the current result. This generates all 2^n subsequences, with O(n) recursion depth.

Q. Find the longest subarray with at most K distinct elements

asked 1xmediumArraysTechnical2021

Ans. Use a sliding window with two pointers and a frequency map. Expand the right pointer, adding each element to the map, and while the map has more than K distinct keys, move the left pointer and decrease counts. Track the maximum valid window length. This runs in O(n) time and O(K) space.

Q. Find the smallest number formed by inserting a given digit

asked 1xmediumGreedyTechnical2021

Ans. Insert the digit at the earliest position where it makes the number smaller. For a positive number string, scan left to right and insert before the first digit greater than the given digit; if none exists, append it. For a negative number, insert before the first digit smaller than it. Time complexity is O(n).

Q. Find the largest sum contiguous subarray (Kadane’s Algorithm).

asked 1xmediumArraysTechnical2021

Ans. Use Kadane’s algorithm by scanning the array once, keeping the best subarray sum ending at the current index and the best sum seen so far. At each element, either extend the previous subarray or start a new one. It uses only a few variables, so the time complexity is O(n) and space is O(1).

Q. Print the covered and uncovered nodes of a Binary Search Tree.

asked 1xmediumTreesOnline test2016

Ans. Uncovered nodes are the boundary nodes on the left and right edges of the tree; covered nodes are all remaining nodes. Traverse the left boundary from root to leaf, then the right boundary, marking these nodes in a set. Do a full traversal and print marked nodes as uncovered, others as covered. Time is O(n).

Q. Implement a bidirectional hash map using other data structures.

asked 1xmediumHashingTechnical2015

Ans. Use two hash maps: one from key to value and one from value to key. On insert, first remove any existing mapping for that key or value, then add both directions. Lookup works through either map. Delete must remove from both maps. Average time is O(1) for insert, lookup, and delete.

Q. Check whether a given binary tree is a Binary Search Tree (BST).

asked 1xmediumTreesTechnical2015

Ans. Check it by traversing the tree recursively with an allowed value range for each node. The root can have an infinite range; the left child must be less than the node, and the right child greater. Use the call stack as the data structure. Time complexity is O(n), space is O(h).

Q. Find the minimum time required so that all oranges become rotten

asked 1xmediumGraphsTechnical2021

Ans. Use multi-source BFS from all initially rotten oranges to find the minimum time. Put their positions in a queue, then spread rot level by level to adjacent fresh oranges, counting minutes per BFS layer. Track fresh oranges; if any remain after BFS, return -1. Time complexity is O(rows × columns).

Q. Given two merged linked lists, find the node at which they merge.

asked 1xmediumLinked listsTechnical2019

Ans. Use two pointers, one on each list, and move each one step at a time; when a pointer reaches the end, redirect it to the head of the other list. They will meet at the merge node, or both become null if there is no merge. This is O(n + m) time and O(1) space.

Q. Maximize the number N by inserting a given digit at any position.

asked 1xmediumStringsTechnical2021

Ans. Scan the number from left to right and insert the digit at the first position where it improves the value. For a positive N, insert before the first digit smaller than the given digit. For a negative N, insert before the first digit larger than it. If no such position exists, append it. Time is O(digits).

Q. Find the pivot element in a sorted rotated array in O(log n) time.

asked 1xmediumBinary searchTechnical2015

Ans. Use binary search to find the point where the order breaks, usually the largest element whose next element is smaller. Compare the middle element with the rightmost element. If middle is greater, the pivot lies to the right; otherwise it lies to the left or at middle. This takes O(log n) time and O(1) space.

Q. Search for an element in a row-wise and column-wise sorted matrix.

asked 1xmediumArraysTechnical2016

Ans. Start from the top-right element and eliminate one row or one column at a time. If the current value equals the target, return found. If it is greater, move left. If it is smaller, move down. This works because rows and columns are sorted. Time complexity is O(m + n), space is O(1).

Q. Find the maximum distance path in a matrix consisting of 0s and 1s.

asked 1xmediumGraphsOnline test2017

Ans. Use DFS with backtracking from every 1 cell to find the longest valid path of connected 1s, usually moving up, down, left and right without revisiting a cell. Keep a visited matrix and update the best length found. Time is exponential, about O(mn times 4^k), because longest simple paths require exploration.

Q. Count the number of subarrays having exactly K perfect square numbers

asked 1xmediumArraysTechnical2020

Ans. Convert each element to 1 if it is a perfect square and 0 otherwise, then count binary subarrays with exactly K ones. Use sliding window to compute subarrays with at most K ones, subtract at most K minus 1. Perfect square checking uses integer square root. Time is O(n), space is O(1).

Q. Find a subsequence of a given size whose sum is equal to a given value

asked 1xmediumArraysOnline test2015

Ans. Use dynamic programming over how many elements are chosen and the current sum, then reconstruct the chosen indices from stored predecessors. For each element, update states backwards by count and sum so it is used at most once. For non-negative integer sums, time is O(n k target) and space is O(k target).

Q. Decode an encoded string like a2[b3[cd]] to produce the decoded output.

asked 1xmediumStringsTechnical2017

Ans. The decoded output is abcdcdcdbcdcdcd. Use a stack to handle nested brackets: keep the current string and repeat count, push them when you see [, build inner text, then pop and repeat when you see ]. This runs in O(n + output length) time and uses O(n) stack space.

Q. Find the product of all elements of an array except the current element

asked 1xmediumArraysTechnical2015

Ans. Use a prefix and suffix product pass to build the result without division. First store, for each index, the product of all elements before it, then scan from the right multiplying by the product of all elements after it. This uses the output array, runs in O(n) time, and O(1) extra space.

Q. Given a number, shuffle all its digits to form the next biggest number.

asked 1xmediumArraysOnline test2017

Ans. Find the next permutation of the digit sequence. Scan from right to left to find the first digit smaller than the digit after it, swap it with the smallest larger digit to its right, then sort or reverse the suffix in ascending order. If no such digit exists, no bigger number can be formed. Time is O(n).

Q. Maximize the median of an array after performing K addition operations.

asked 1xmediumBinary searchTechnical2020

Ans. Sort the array and only increase elements from the middle index to the end. Binary search the largest possible median value, and for each candidate compute how many increments are needed to raise all upper-half elements below it. If the cost is at most K, it is feasible. Time complexity is O(n log n + n log range).

Q. Convert a string like "aabbbccx" to "a2b3c2x1" without using extra space.

asked 1xmediumStringsTechnical2016

Ans. Use two pointers on a mutable character array: one reads each run, the other writes the character and its count. For each group, count repeated characters, write the character, then write the decimal count in place. This is O(n) time and O(1) extra space, assuming the array has enough capacity.

Q. Write a complex SQL query using a SELF JOIN to satisfy a given condition.

asked 1xmediumSQLOnline test2021

Ans. Use a self join by treating the same table as two logical tables with aliases, such as Employee and Manager, then join Employee.manager_id to Manager.id and filter where Employee.salary is greater than Manager.salary. The key detail is clear aliasing. With indexes on id and manager_id, lookup is efficient, roughly linear plus index access.

Q. Find the nearest smaller element to the left for each element in an array.

asked 1xmediumStacksTechnical2021

Ans. Use a monotonic increasing stack while scanning the array from left to right. For each element, pop stack elements greater than or equal to it; the new stack top is the nearest smaller element to its left, or none if the stack is empty. Then push the current element. Time is O(n), space is O(n).

Q. Find the kth smallest element in a row-wise and column-wise sorted 2D array

asked 1xmediumBinary searchTechnical2021

Ans. Use binary search on the value range from the top-left to bottom-right elements. For each mid value, count how many elements are less than or equal to it using a staircase scan from bottom-left or top-right. Adjust the range until it converges. This uses no extra data structure and takes O((rows + columns) log valueRange) time.

Q. Design a stack that supports getMin() in O(1) time without using extra space

asked 1xmediumStackTechnical2015

Ans. Use one stack and one variable min, storing encoded values when a new minimum is pushed. If x is less than min, push 2*x - min and set min to x. On pop, if the stored value is less than min, restore old min as 2*min - stored. All operations are O(1).

Q. Find the minimum number of deletions required to make a string a palindrome.

asked 1xmediumDynamic programmingTechnical2020

Ans. The minimum deletions required is the string length minus the length of its longest palindromic subsequence. Compute the LPS using dynamic programming, commonly as LCS between the string and its reverse. Use a 2D DP table, or optimise to two rows. Time complexity is O(n²), space is O(n²) or O(n).

Q. Write a program to find the Longest Common Subsequence (LCS) of two strings.

asked 1xmediumDynamic programmingTechnical2016

Ans. Use dynamic programming with a two-dimensional table where dp[i][j] stores the LCS length of the first i characters of one string and first j characters of the other. If characters match, extend the diagonal value; otherwise take the maximum from left or top. Time complexity is O(mn), with O(mn) space.

Q. Design a database schema for a supermarket system considering discounts and customer offers.

asked 1xmediumDBMSTechnical2015

Ans. Use tables for products, customers, baskets or orders, order_lines, discounts, customer_offers, and discount_applications. Products hold current price and category; order_lines store snapshot price, quantity, and tax. Discounts define type, scope, dates, priority, and stacking rules. customer_offers links offers to customers. discount_applications records exactly which discounts affected each line or order.

Q. How would you convince a manager to improve or refactor a part of source code that has been in use for 20 years?

asked 1xmediumConflict resolutionManagerial2019

Ans. Pick a case where old code caused measurable risk, cost, slow delivery, incidents, or onboarding pain. Emphasise respect for its proven value, then propose evidence, tests, incremental refactoring, rollback plans, and business impact. Interviewers listen for pragmatism, risk awareness, stakeholder communication, and not refactoring just because the code is old.

Q. Given 9 identical items where one is heavier, what is the minimum number of comparisons needed to find the heavier item?

asked 1xmediumLogical reasoningHR2015

Ans. The minimum is 2 comparisons using a balance scale. Split the 9 items into three groups of 3. Compare two groups. If one group is heavier, the heavy item is in it; if they balance, it is in the third group. Then compare two items from that group to identify the heavier one.

Q. If a rectangular section is cut from a rectangle, in how many ways can it be divided equally into two parts such that the cut section is also divided equally?

asked 1xmediumLogical reasoningHR2015

Ans. Usually, one way: draw the straight line joining the centre of the original rectangle to the centre of the cut-out rectangle. Any line through a rectangle’s centre divides it into two equal areas, so this line bisects both rectangles. Therefore it also divides the remaining shape equally. If the centres coincide, there are infinitely many.

Q. Design an efficient data structure to automatically convert website content to the default language of the country based on the IP address. You are given country name, language, and IP range.

asked 1xmediumData structuresTechnical2017

Ans. Use a sorted array of IP ranges, with each IP converted to a 32 or 128 bit integer, and store the country and default language for each range. For a request, convert the IP and binary search the range start, then verify the end. Lookup is O(log n), storage is O(n).

Q. Find the median of a running stream of integers.

asked 1xhardHeapsTechnical2015

Ans. Use two heaps: a max heap for the lower half of numbers and a min heap for the upper half. Insert each new number into the correct heap, then rebalance so their sizes differ by at most one. The median is the larger heap’s top, or the average of both tops. Insert is O(log n), median is O(1).

Q. Fill digits from 0 to 9 in blanks such that if digit X is placed over digit Y, then Y appears exactly X times in the entire sequence.

asked 1xhardLogical reasoningTechnical2015

Ans. Let ai be the digit written above i. Then ai is the number of times digit i appears in the whole sequence, so the ai values must sum to 10. The only consistent counts are six 0s, two 1s, one 2, and one 6. Therefore the sequence over 0 to 9 is 6210001000.

Q. Given a real-time stream of stock sales with company name and price arriving every second, return the top 10 companies whose stocks are sold the most at any instant in O(1) time.

asked 1xhardStream processingTechnical2017

Ans. Maintain cumulative sale counts in a hash map and keep a cached, sorted top 10 list. For each sale, increment that company’s count, then compare and reposition only within the 10-entry list, which is constant size. Returning the answer is O(1) because it simply reads the cached list. Price is irrelevant here.

Q. Solve quantitative aptitude problems on time and distance.

asked 1xeasyTime distanceOnline test2019

Ans. Use the core formula speed equals distance divided by time, and rearrange it as needed. Keep units consistent, especially minutes to hours and metres to kilometres. For relative motion, add speeds when objects move towards each other and subtract when moving in the same direction. Use ratios when distance or speed is compared.

Q. Solve quantitative aptitude problems on pipes and cisterns.

asked 1xeasyLogical reasoningOnline test2019

Ans. Use rates, not times. If a pipe fills a tank in x hours, its rate is 1/x tank per hour. An outlet emptying in y hours has rate minus 1/y. Add all working rates, including signs. The total time is 1 divided by the net rate, adjusting units if minutes are used.

Showing 60 of 206 questions. Ranked by how often the same question came back across interviews.

Practise a Factset-style interview

A spoken interview built from these questions, scored when you finish; the feedback is yours.

Start practising

When you are ready, record The One: a single interview hiring teams watch, so you stop repeating first rounds.

Common questions

What questions does Factset ask?

Candidate interviews most often cover DSA (80%) and CS fundamentals (15%).

How many rounds does Factset interview have?

Candidate interviews show an average of 3.8 rounds per experience, with a typical sequence of Online test → Technical → Technical → HR. Individual interview paths can vary.

Is the Factset interview hard?

Among questions with a recorded difficulty, the mix is easy 31%, medium 57%, hard 12%.