cashfree logo

Cashfree Interviews

4 experiences116 reads15 questions25% success rate
Cashfree interview Experience
cashfree logo
Cashfree
June 18, 20259 reads

Summary

I had a one-hour technical interview with Cashfree on Hackerrank, where I was asked two questions: one DSA in C++ and one JavaScript problem. I was ultimately rejected.

Full Experience

Interview Experience – Hackerrank (1 Hour, C++, JavaScript)

I had a one-hour technical interview on Hackerrank where I was asked two questions. One was a DSA question to be coded in C++, and the other was based on JavaScript.


Q1. Leetcode 658 – Find K Closest Elements

Link: https://leetcode.com/problems/find-k-closest-elements/description/ Given a sorted array arr, two integers k and x, return the k closest integers to x in the array. The result should also be sorted in ascending order. An integer a is closer to x than an integer b if:

  • |a - x| < |b - x|, or
  • |a - x| == |b - x| and a < b

Example Input:

arr = [1,2,3,4,5], k = 4, x = 3  
Output: [1,2,3,4]

My C++ Code:

#include <cmath>
#include <cstdio>
#include <queue>
#include <vector>
#include <iostream>
#include <algorithm>
using namespace std;

int addNumbers(int a, int b) {
    return a+b;
}

// // // // // Input: arr = [1,2,3,4,5], k = 4, x = 3

int main() {
    // int size;
    vector<int>arr={23, 45, 67, 98};
    int k=2;
    int x=75;
    // cin>>size;
    // for (int i=0;i<size;i++){
    //     int temp;
    //     cin>>temp;
    //     arr.push_back(temp);
    // }
    vector<pair<int ,int>> diff;
    // vector<int> diff(arr.size(),0);
    for(int i=0;i<arr.size();i++){
        diff.push_back({abs(arr[i]-x),i});//O(n)
        // diff[i]=abs(arr[i]-x);
    }
    priority_queue<pair<int,int>>pq;
    for(int i=0;i<arr.size();i++){
        pq.push({diff[i].first,diff[i].second});//O(nlog(k))
        if(pq.size()>k) pq.pop();
    }
    vector<int>ans;
    while(pq.size()){
        pair<int,int> temp=pq.top();
        ans.push_back(arr[temp.second]);//O(k)
        // cout<<arr[temp.second];
        pq.pop();
    }
    sort(ans.begin(),ans.end());//O(k*log(k))
    for(int x:ans) cout<<x<<" ";
    return 0;
}

Q2. JavaScript – Flatten a Deeply Nested Array

Given a nested array like:

const nestedArray = [1, [2, 3], [4, [5]]];

Write a function to flatten it without using inbuilt functions like .flat().

Note: Interviewer asked to avoid inbuilt .flat() and recursion was allowed.

What I Said: I suggested using recursion and checking if the element is an array using Array.isArray(), but I couldn’t complete the code in time.

What I initially wrote:

const flattenedArray = deeplyNestedArray.flat(Infinity);

Expected Approach Using Recursion (Not allowed to use .flat()):


Verdict : Rejected

Interview Questions (2)

Q1
Find K Closest Elements
Data Structures & AlgorithmsMedium

Given a sorted array arr, two integers k and x, return the k closest integers to x in the array. The result should also be sorted in ascending order. An integer a is closer to x than an integer b if:

  • |a - x| < |b - x|, or
  • |a - x| == |b - x| and a < b

Example Input:

arr = [1,2,3,4,5], k = 4, x = 3  
Output: [1,2,3,4]
Q2
Flatten a Deeply Nested Array
Data Structures & AlgorithmsMedium

Given a nested array like:

const nestedArray = [1, [2, 3], [4, [5]]];

Write a function to flatten it without using inbuilt functions like .flat().

Note: Interviewer asked to avoid inbuilt .flat() and recursion was allowed.

Cashfree Frontend Intern Online assessment
cashfree logo
Cashfree
Frontend Intern
June 18, 20256 reads

Summary

I participated in Cashfree's Frontend Intern online assessment in mid-June, which included general knowledge questions and three coding problems, and I was selected for the interview round.

Full Experience

I had Participated in Cashfree Frontend Intern on mid of june had my OA scheduled and was asked 5 on Error codes , linkedList ,user experience and graph later I had 3 question 2 dsa question and 1 node.js (javascript Q). verdict selected for interview

Interview Questions (3)

Q1
The Employee That Worked on the Longest Task
Data Structures & AlgorithmsEasy

LeetCode problem 2432: The Employee That Worked on the Longest Task.

Q2
Distinct One Counts After One Flip
Data Structures & Algorithms

Problem: Distinct One Counts After One Flip

You are given a binary array arr of length n, consisting only of 0s and 1s.

You are allowed to choose exactly one subarray (possibly empty) and flip all of its elements — that is, convert all 0s in the subarray to 1s, and all 1s to 0s.

Your task is to determine how many distinct values for the total number of 1s in the array can be obtained after performing exactly one flip operation.


Function Signature

int getDistinctOneCounts(vector<int> arr);

Input

  • arr: A vector of n integers, where each element is either 0 or 1.
  • Constraints:
    • $1 \leq n \leq 2 \times 10^5$
    • Each element of arr is either 0 or 1.

Output

  • Return an integer representing the number of distinct possible counts of 1s in the array after exactly one subarray flip operation.

Note

  • A subarray is a contiguous portion of the array.
  • You are allowed to flip an empty subarray, which results in no change to the array.

Example

Input

arr = [0, 1, 1, 0]

Output

4

Explanation

Possible flips and resulting 1-counts:

Subarray Chosen (0-based indices)Flipped ArrayNumber of 1s
None (empty subarray)[0, 1, 1, 0]2
[0, 0][1, 1, 1, 0]3
[1, 2][0, 0, 1, 0]1
[0, 3][1, 0, 0, 1]2
[0, 1][1, 0, 1, 0]2
[2, 3][0, 1, 0, 1]2
[1, 3][0, 0, 0, 1]1
[0, 2][1, 0, 0, 0]1
[1, 2][0, 0, 0, 0]0

The distinct counts of 1s after these flips are: {0, 1, 2, 3} → total 4 distinct values.


Q3
Custom Auction System
System Design

Problem: Custom Auction System

You are building a custom auction system with unique bidding rules:

  • An auction starts with an initial price.
  • Bidders can place bids via updatePrice, but only if their bid is higher than the current bid.
  • To win the item, a bidder must explicitly claim it using callBid with a valid offer.
  • Once an item is claimed via a successful callBid, no further bids or claims are allowed on it.

Function Definitions

You need to implement the following three functions to manage the auction process:


1 startAuction(auctions, entity, startingPrice)

Starts an auction for a given item.

  • Parameters:
    • auctions (object): A shared object that stores all auctions.
    • entity (string): The name of the item.
    • startingPrice (number): The minimum price to start the auction.
  • Returns: Nothing (updates the auctions object).

2 updatePrice(auctions, entity, bidPrice)

Places a new bid for the item.

  • A new bid is only accepted if it is greater than both the starting price and the current highest bid.
  • Bids are ignored if the item has already been claimed.
  • Parameters:
    • auctions (object): The shared auction data.
    • entity (string): The item being bid on.
    • bidPrice (number): The new bid price.
  • Returns: Nothing (updates the bid in auctions).

3️ callBid(auctions, entity, callPrice)

Attempts to claim the item with a final offer.

  • If the item is unclaimed and the callPrice is greater than or equal to the current bid, the call is "successful" and the item is marked as sold.
  • Otherwise, the call is "unsuccessful".
  • Parameters:
    • auctions (object): The shared auction data.
    • entity (string): The item to claim.
    • callPrice (number): The price the bidder wants to claim the item at.
  • Returns: "successful" or "unsuccessful"

Sample Test Case 0

Input

startAuction vase 100
updatePrice vase 150
updatePrice vase 200
callBid vase 210

Output

successful

Explanation:

  • Auction for vase starts at 100.
  • Bids of 150 and 200 are valid and update the price.
  • A callBid of 210 is higher than the current bid (200) — item is claimed.

Sample Test Case 1

Input

startAuction car 5000
callBid car 4500
callBid car 5000

Output

unsuccessful
successful

Explanation:

  • callBid of 4500 is below starting price — rejected.
  • callBid of 5000 is equal to starting price — accepted.

Constraints

  • Item names are unique lowercase English strings (1 ≤ length ≤ 100).
  • 1 ≤ startingPrice, bidPrice, callPrice ≤ 10^5.
  • Once claimed, no further updates or claims are allowed on that item.

CashFree Interview Experience
cashfree logo
Cashfree
December 1, 202246 reads

Summary

I interviewed with CashFree for an on-campus role, which involved three technical rounds and one HR round. The first technical round focused on a challenging coding problem involving complementary string pairs.

Full Experience

My interview process with CashFree, conducted on campus, consisted of four rounds: three technical and one HR.

In the first round, I was given a coding question. The interviewer asked me to find the number of complementary pairs from a given vector of strings. A pair (i,j) is complementary if the concatenation of s[i] and s[j] (where i != j) results in a string for which any permutation is a palindrome. The interviewer specifically looked for an O(N) approach.

The second round delved into Computer Science fundamentals, covering topics like Computer Networks (CN), Operating Systems (OS), and Database Management Systems (DBMS).

The third round revolved around my projects. I explained my projects in detail, and the interviewer asked follow-up questions related to them.

Finally, there was an HR round.

Interview Questions (1)

Q1
Complementary Palindrome Pairs
Data Structures & Algorithms

Given a vector of strings, find the number of complementary pairs. A complementary pair (i,j) (where i!=j) is defined such that if you concatenate the string at the i-th position and the string at the j-th position, any permutation of the resulting concatenated string forms a palindrome. The pairs (i,j) and (j,i) are treated as the same.
Example:
I/P: ["aba","abc","d","aa"]
O/P: 2 (Pairs: "aba" + "aa", "d" + "aa")
The interviewer specifically asked for an O(N) approach.

CashFree SDET Role
cashfree logo
Cashfree
sdetOffer
September 1, 202255 reads

Summary

I recently interviewed for an SDET position at CashFree. The process included four rounds, covering coding challenges, in-depth technical discussions on various CS fundamentals, and a final HR interaction. I successfully cleared all rounds and received an offer.

Full Experience

My interview journey at CashFree began with Round 1, which featured two coding questions. I managed to solve one: finding all palindromic substrings in a given string, which was a LeetCode Medium problem. The second was a hard DP problem where I explained two approaches but couldn't fully solve it even with a hint.

Round 2 also consisted of three coding challenges. I successfully solved 'Search in Rotated Sorted Array' (LeetCode Medium) and 'Find the Cheapest Flights With K Stops' (LeetCode Medium). The third question was 'Edit Distance', a LeetCode Hard DP problem, which I also managed to solve.

In Round 3, the discussion moved beyond coding. We delved into my internship experiences and projects. The interviewer also tested my fundamental knowledge across various computer science domains, including RDBMS, OOPS, Computer Networks, and Operating Systems. Specific questions included: 'Why do we use HTTP?', 'What's the difference between WebSocket and HTTP?', 'Why do we create different schemas?', 'What's the difference between SQL and NoSQL?', and a discussion on different paging algorithms. I was also asked to write a few SQL queries.

The final Round 4 was with HR. We discussed my future career goals, my interest in the Fintech industry, and specifically why CashFree. We also touched upon my hobbies and other general topics.

Following these rounds, I awaited the results and was pleased to receive an offer with a CTC of 22 lacs, including a 10 lac base and 1 lac variable.

Interview Questions (9)

Q1
All Palindromic Substrings
Data Structures & AlgorithmsMedium

Given a string, find all possible palindromic substrings within it.

Q2
Search in Rotated Sorted Array
Data Structures & AlgorithmsMedium

Given a sorted array that has been rotated at some unknown pivot, search for a target element's index.

Q3
Cheapest Flights Within K Stops
Data Structures & AlgorithmsMedium

Given a list of flights and their costs, find the cheapest price to travel from a source city to a destination city with at most K stops.

Q4
Edit Distance
Data Structures & AlgorithmsHard

Given two strings word1 and word2, return the minimum number of operations required to convert word1 to word2. The allowed operations are insert a character, delete a character, or replace a character.

Q5
Purpose of HTTP
Other

Explain the fundamental reasons and role of HTTP in web communication.

Q6
HTTP vs. WebSocket
Other

Describe the key differences between HTTP and WebSocket protocols, including their connection models, use cases, and advantages/disadvantages.

Q7
Purpose of Database Schemas
Other

Explain the reasons and benefits behind creating and using different schemas in a database system (e.g., for organization, security, access control).

Q8
SQL vs. NoSQL Databases
Other

Discuss the fundamental differences between SQL (relational) and NoSQL (non-relational) databases, covering aspects like data models, scalability, flexibility, and typical use cases.

Q9
Paging Algorithms
Other

Discuss various paging algorithms used in operating systems for memory management, explaining their principles and common examples (e.g., FIFO, LRU, Optimal).

Have a Cashfree Interview Experience to Share?

Help other candidates by sharing your interview experience. Your insights could make the difference for someone preparing for their dream job at Cashfree.