← Experian Interview Insights

Experian·Data Scientist·Onsite - Cross-functional / Panel·Intermediate

IntermediatePrefer not to say
Jul 2026

Summary

Experian data scientist panel with a mix of algorithm design and infrastructure questions. The coding portion leaned heavier on CS fundamentals than I expected for a DS role, which threw me a bit.

Questions Asked (3)

Q1

Write an algorithm to find the length of the longest increasing subsequence in an array.

Algorithms & Data Structures
Author's notes

I knew the O(n^2) DP solution cold but blanked on the faster version.

Create a free account to read the full note

AI HintsAI Generated

Suggested Approach

Start by clarifying the problem (e.g., strictly increasing, subsequence not subarray) and then present the optimal O(n log n) solution using patience sorting with binary search. Explain the intuition behind the tails array and how it maintains the smallest possible tail for each subsequence length.

Pro tip: Mention the O(n^2) dynamic programming approach first to show understanding, then transition to the O(n log n) optimization, highlighting the trade-off between simplicity and efficiency. This demonstrates depth and awareness of practical constraints.

1. Clarify the problem

Confirm that the subsequence does not need to be contiguous and that 'increasing' means strictly increasing. Ask about edge cases like empty array or duplicates.

2. Discuss brute force and DP

Mention the O(n^2) dynamic programming solution where dp[i] stores the length of the longest increasing subsequence ending at index i. This shows foundational knowledge.

3. Introduce the O(n log n) approach

Explain the patience sorting algorithm: maintain an array tails where tails[i] is the smallest tail of all increasing subsequences of length i+1. For each element, use binary search to find its position and update tails.

4. Walk through an example

Trace the algorithm on a small array (e.g., [10,9,2,5,3,7,101,18]) to illustrate how tails evolves and why the final length is correct.

5. Analyze complexity and edge cases

State time complexity O(n log n) and space O(n). Discuss handling of empty arrays, all equal elements, and strictly decreasing arrays.

Key Points to Mention

  • Difference between subsequence and subarray
  • Dynamic programming recurrence: dp[i] = 1 + max(dp[j]) for j < i and nums[j] < nums[i]
  • Patience sorting / binary search optimization
  • Use of bisect_left (or equivalent) to find the first element >= current
  • Time and space complexity trade-offs
  • Edge cases: empty array, single element, duplicates, strictly decreasing

AI-generated suggestions, not part of the candidate's original notes. May be inaccurate — verify before relying on them.

Q2

Given a list of students who cannot sit next to each other, design an algorithm to seat them so no two listed friends are adjacent. What is the time complexity?

Algorithms & Data StructuresTechnical Trade-offs
Author's notes

Framed it as a graph coloring problem, which felt right.

Create a free account to read the full note

AI HintsAI Generated

Suggested Approach

Model the problem as a graph coloring or constraint satisfaction problem where students are vertices and 'cannot sit next to each other' edges define constraints. Then propose a greedy algorithm with backtracking or a heuristic like DSATUR to find a valid seating arrangement, and analyze the time complexity based on the algorithm chosen.

Pro tip: Mention that for large lists, a greedy approach may fail, so backtracking or a polynomial-time reduction to 2-SAT (if constraints are pairwise) could be more appropriate; also discuss average vs worst-case complexity.

1. Clarify the problem

Confirm whether the seating is linear (row) or circular (round table), and whether all students must be seated or only a subset. Also clarify if the 'cannot sit next to each other' list is symmetric and if there are multiple constraints per student.

2. Model as a graph

Represent students as vertices and forbidden adjacencies as edges. The problem becomes finding a Hamiltonian path (or cycle) in the complement graph, or a proper coloring of the conflict graph with seats as colors.

3. Choose an algorithm

For small N, use backtracking with pruning. For larger N, consider greedy with heuristics (e.g., DSATUR) or reduction to 2-SAT if constraints are pairwise and seating is linear. Note that the general problem is NP-hard.

4. Analyze time complexity

State the complexity of your chosen algorithm: backtracking is O(N!) worst-case, greedy is O(N^2) or O(N log N) with efficient data structures, and 2-SAT is O(N+E). Acknowledge that the problem is NP-hard in general, so no polynomial-time algorithm exists unless P=NP.

5. Discuss trade-offs and practical considerations

Mention that for real-world datasets (e.g., at Experian), N may be small enough for exponential algorithms, or constraints may be sparse, allowing faster heuristics. Also consider if approximate solutions are acceptable.

Key Points to Mention

  • Graph representation: students as vertices, forbidden pairs as edges.
  • Problem is equivalent to finding a Hamiltonian path in the complement graph or a proper coloring of the conflict graph.
  • General problem is NP-hard, so exact polynomial-time solution unlikely.
  • Backtracking with pruning can be efficient for small N.
  • Greedy heuristics like DSATUR can provide quick solutions but may not always find a valid seating.
  • Time complexity depends on algorithm: O(N!) for brute force, O(N^2) for greedy, O(N+E) for 2-SAT if applicable.

AI-generated suggestions, not part of the candidate's original notes. May be inaccurate — verify before relying on them.

Q3

How would you sort a file with 50 numbers? What if the file had a million numbers and was stored on disk?

Algorithms & Data StructuresSystem DesignTechnical Trade-offs
Author's notes

The 50-number case was easy, any in-memory sort works.

Create a free account to read the full note

AI HintsAI Generated

Suggested Approach

Start by clarifying the constraints: file size, memory availability, and whether the data fits in memory. For small files, an in-memory sort like quicksort or built-in sort is fine; for large files, discuss external sorting with chunking, sorting in memory, and merging. Emphasize trade-offs between time, space, and I/O.

Pro tip: Mention that for a million numbers on disk, you should avoid loading everything into memory; instead, use a k-way merge with a heap to efficiently combine sorted chunks. Also, note that if the numbers have a limited range, counting sort could be a faster alternative.

1. Clarify constraints

Ask about file size, available memory, data characteristics (e.g., range, duplicates), and performance requirements. This shows you consider the context before jumping to a solution.

2. Small file solution

For 50 numbers, simply read the entire file into memory and use an efficient in-memory sorting algorithm like quicksort or the language's built-in sort. Mention that this is O(n log n) and trivial for small n.

3. Large file solution

For a million numbers on disk, use external sorting: read chunks that fit in memory, sort each chunk, write sorted chunks to disk, then merge them using a k-way merge (e.g., with a min-heap). This minimizes memory usage and I/O.

4. Optimizations and alternatives

Discuss possible optimizations: if numbers are integers with a small range, counting sort or radix sort could be faster. Also, consider using memory-mapped files or parallel processing for further speedup.

5. Trade-offs and conclusion

Summarize the trade-offs: in-memory sort is fast but limited by memory; external sort handles large data but has higher I/O overhead. Choose based on constraints and data characteristics.

Key Points to Mention

  • In-memory sorting algorithms (quicksort, mergesort) and their time complexity O(n log n).
  • External sorting: chunking, sorting in memory, writing to disk, and k-way merge.
  • Use of a min-heap for efficient k-way merge.
  • Counting sort or radix sort for integer data with limited range.
  • Memory constraints and I/O overhead as key factors in algorithm choice.
  • Potential for parallelization or memory-mapped files to improve performance.

AI-generated suggestions, not part of the candidate's original notes. May be inaccurate — verify before relying on them.