De Shaw SDE Interview Question

de shaw logo
de shaw
software developerNo Offer
June 27, 20212 reads

Summary

I recently interviewed at De Shaw for an entry-level Software Developer position, where I was asked two challenging algorithmic problems. I struggled with one of them and was unable to provide a complete solution.

Full Experience

I recently had an interview at De Shaw for an entry-level Software Developer role. The interview process focused heavily on problem-solving skills, and I was presented with two distinct coding challenges. While I felt I understood the first problem and could approach it, the second question proved to be quite complex, and I unfortunately could not come up with a full solution during the allotted time.

Interview Questions (2)

Q1
Minimum Window Containing Elements from K Group Ranges
Data Structures & Algorithms

You are given 'k' number of groups, each having an unequal range (e.g., g1: 0-10, g2: 11-15, g3: 16-22, g4: 23-34). You are also given a sequence of numbers. The task is to find the length of the minimum window in the sequence that contains at least one element from every group. The interviewer specified that I had to solve this problem without using a map.

For example: Given sequence: 9, 5, 3, 12, 17, 25, 27 Expected Answer: 4

Q2
Longest AP Series in Binary Tree with Distance Constraints
Data Structures & Algorithms

You are given a binary tree. You need to find the length of the longest Arithmetic Progression (AP) series within the tree, subject to the following constraints:

  • No two nodes in the AP series can be consecutive (i.e., directly parent-child or sibling).
  • The 'distance' between any two consecutive terms of the AP series (defined as the number of nodes between the two nodes) should be from 1 to 3 (inclusive). This means there can be one, two, or three nodes separating consecutive terms in the sequence path.
  • You cannot revisit a node once you traverse it. For example, if the path is 1 -> 2 -> 5 -> 4 -> 3, then 1, 3, 5 is not a valid sequence for an AP series because of the traversal rules.
I was not able to solve this question.
Discussion (0)

Share your thoughts and ask questions

Join the Discussion

Sign in with Google to share your thoughts and ask questions

No comments yet

Be the first to share your thoughts and start the discussion!