demand base logo
Demandbase· Senior Software Engineer

Demand Base | Interview Experience | 4 yrs experience

Result
Rejected
Experience
4 years
Posted
22 Mar 2025
284 reads

Summary

I interviewed for a Senior Software Engineer position at Demand Base, undergoing two intense technical rounds that covered Java fundamentals and data structures & algorithms. Despite my efforts, I was unfortunately rejected after the second round.

How it went

My interview experience at Demand Base for a Senior Software Engineer role was an on-site, face-to-face hiring drive.

Round 1: (1.5 hours)

This round focused heavily on Java concepts and data structures & algorithms. I was asked to explain the differences between final, finalize, and finally, and discussed Java's garbage collection mechanisms. A significant portion involved analyzing and predicting the output of provided Java code snippets. One such question required me to implement custom hashing logic for a CustomKey class to ensure its correct behavior as a HashMap key. Other theoretical questions included distinguishing between authentication and authorization, explaining the internal workings and time complexity of HashMap, and discussing the purpose of doFilter in Java Servlets. We also had a detailed conversation about pass-by-value versus pass-by-reference in Java. For coding, I was asked to find the maximum product of three elements in an array, considering various edge cases, and to write the code for the lowest common ancestor in a binary tree.

Round 2: (50 minutes)

This was another elimination round, primarily focused on algorithms. The first question was about converting a string s1 to s2 using a minimum number of operations, including Replace, Add, Delete, Swap, and Substitute. I found this question quite vague and needed clarification on the exact definition of some operations, and ultimately struggled to provide an optimal solution. The second question was a classic problem: merge k sorted linked lists using a priority queue. I was able to write a working solution for this, although I acknowledge it wasn't fully optimized.

Unfortunately, I was eliminated after the second round and did not proceed to the Hiring Manager round. The overall experience was challenging, requiring not just algorithmic knowledge but also a strong grasp of Java internals.

Questions asked (10)

  1. 01

    Difference between Final, Finalize, and Finally

    Other

    Explain the differences between the final keyword, the finalize() method, and the finally block in Java.

  2. 02

    Custom Hashing for HashMap Key

    Other · Medium

    Given the following CustomKey class, predict the output of the System.out.print statement. Then, write the logic (implement hashCode() and equals() methods) within the CustomKey class to ensure HashMap correctly retrieves the value for a matching key.

    class CustomKey {
       private int id; 
       private String name;
    
       public CustomKey(int id, String name) {
           this.id = id;
           this.name = name;
       }
    }
    
    public class Test {
       public static void main(String[] args) {
           Map<CustomKey, String> map = new HashMap<>();
    
           map.put(new CustomKey(1, "Alice"), "Value1");
           map.put(new CustomKey(2, "Bob"), "Value2");
           map.put(new CustomKey(3, "Charlie"), "Value3");
    
           System.out.print(map.get(new CustomKey(1, "Alice")));
       }
    }
    
  3. 03

    Authentication vs. Authorization

    Other

    Explain the key differences between authentication and authorization in the context of system security.

  4. 04

    HashMap Internal Working and Time Complexity

    Data Structures & Algorithms · Medium

    Discuss the internal working mechanism of a HashMap in Java, including how values are stored, collision resolution strategies, and the average and worst-case time complexities for common operations like put() and get().

  5. 05

    Purpose of doFilter in Java Servlets

    Other

    Explain the purpose and usage of the doFilter method within a Java Servlet Filter. Describe its role in the request processing lifecycle.

  6. 06

    Java Pass by Value/Reference and Object Mutation

    Other · Easy

    Given the CustomKey class (as defined previously) and the following methods, determine the output of sout(a.id) after each method call. Discuss the concepts of pass-by-value and how objects are handled in Java method calls.

    CustomKey a = new CustomKey(1, "Alice");
    a = new CustomKey(2, "Pasco");
    test(a);
    sout(a.id);
    test1(a);
    sout(a.id);
    
    Public void test(CustomKey a){
    	a = new CustomKey(4, "Bob");
    }
    Public void test1(CustomKey a){
    	a.id = 3;
    }
    
  7. 07

    Maximum Product of Three Numbers

    Data Structures & Algorithms · Easy

    Given an integer array, find three numbers whose product is maximum and return the maximum product. Discuss various edge cases, such as arrays with negative numbers or arrays shorter than three elements.

    Open the problem
  8. 08

    Lowest Common Ancestor of a Binary Tree

    Data Structures & Algorithms · Medium

    Write code to find the lowest common ancestor (LCA) of two given nodes in a binary tree. Assume both nodes exist in the tree and are unique.

    Open the problem
  9. 09

    Minimum Operations to Convert String S1 to S2 (Extended Edit Distance)

    Data Structures & Algorithms · Hard

    Given two strings, s1 and s2, find the minimum number of operations required to convert s1 to s2. Allowed operations include: Replace, Add, Delete, Swap (adjacent characters), and Substitute (single character replacement). The exact definitions of 'Swap' and 'Substitute' might need clarification with the interviewer.

  10. 10

    Merge k Sorted Lists

    Data Structures & Algorithms · Hard

    Merge k sorted linked lists into one single sorted linked list. Implement the solution using a priority queue.

    Open the problem

How they prepared

The interview format required me to write complete, executable code from scratch, rather than just filling in a template as is common in many LeetCode environments. This meant I needed to be proficient in initializing data structures like binary trees and linked lists, in addition to implementing the core logic for the problems.

Know someone preparing? Send it to them:WhatsAppLinkedInX

Interviewed at Demandbase recently?

Write up your rounds while you still remember the questions. It helps the next person more than you would think.

Share your experience
Discussion 0

Questions for the author, or how your own interview compared.

Join the discussion

Sign in with Google to comment or ask the author a question.

No comments yet

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