Razorpay interview prep
8 practice questions on the topics candidates reported from Razorpay interviews, with answers. The questions are ours; each one links to the interview report that names its topic.
DSA 2
-
You reverse a singly linked list in place by walking it once with three pointers, prev, curr and next. At each node, what do you do?
- Save next = curr.next, point curr.next at prev, then move prev to curr and curr to next
- Swap the node's value with the value at the other end of the list
- Push every node onto a stack, then pop them all
- Point curr.next at curr.next.next
Show the answer
A. Save next = curr.next, point curr.next at prev, then move prev to curr and curr to next
Saving next first keeps the rest of the list reachable after the link is turned round. When curr becomes null, prev is the new head. One pass, O(n) time, O(1) extra space.
This topic is named in a candidate’s interview report: Product support engineer intern interview, 2025, on Reddit.
-
What is the length of the longest common substring (contiguous) of "abcdxyz" and "xyzabcd"?
- 4
- 3
- 7
- 2
Show the answer
A. 4
"abcd" appears in both. The DP sets L[i][j] = L[i-1][j-1] + 1 when the characters match, else 0, and keeps the maximum: O(n * m). A common subsequence need not be contiguous, which is a different problem.
This topic is named in a candidate’s interview report: Product support engineer intern interview, 2025, on Reddit.
OOP 2
-
What is the difference between static (early) and dynamic (late) binding?
- Static binding picks the method when the program is compiled, as for overloads; dynamic binding picks the override at run time from the object's real type
- Dynamic binding happens at compile time
- They are the same thing
- Static binding only applies to variables
Show the answer
A. Static binding picks the method when the program is compiled, as for overloads; dynamic binding picks the override at run time from the object's real type
In Java, overloaded, static, private and final methods are bound at compile time. A call to an overridable instance method through a parent reference is bound at run time, which is what makes polymorphism work.
This topic is named in a candidate’s interview report: Product support engineer intern interview, 2025, on Reddit.
-
How does functional programming differ from object-oriented programming in style?
- Functional code favours pure functions and immutable data passed between them; OOP bundles mutable state with the methods that change it
- Functional code cannot use functions as values
- OOP has no functions
- Functional code always runs slower
Show the answer
A. Functional code favours pure functions and immutable data passed between them; OOP bundles mutable state with the methods that change it
Pure functions are easy to test and to run in parallel because they share no mutable state. Most modern languages mix both, for example Java streams and lambdas inside classes.
This topic is named in a candidate’s interview report: Product support engineer intern interview, 2025, on Reddit.
DBMS and SQL 1
-
Which statement about SQL and NoSQL databases is most accurate?
- SQL databases cannot run on more than one machine
- NoSQL databases cannot store structured data
- SQL databases store tables with a fixed schema, joins and strong transactions; NoSQL databases (document, key-value, column, graph) trade some of that for flexible schemas and easy horizontal scaling
- NoSQL means the database has no query language
Show the answer
C. SQL databases store tables with a fixed schema, joins and strong transactions; NoSQL databases (document, key-value, column, graph) trade some of that for flexible schemas and easy horizontal scaling
Choose SQL when data is relational and correctness across rows matters, as in payments. NoSQL suits flexible, very large or simple-lookup data, such as sessions in a key-value store.
This topic is named in a candidate’s interview report: Product support engineer intern interview, 2025, on Reddit.
Web development 2
-
How does REST differ from SOAP?
- REST uses plain HTTP methods on resource URLs, usually with JSON; SOAP is a protocol that wraps every call in an XML envelope with a formal contract (WSDL)
- SOAP works only in browsers
- REST requires XML
- They are the same protocol
Show the answer
A. REST uses plain HTTP methods on resource URLs, usually with JSON; SOAP is a protocol that wraps every call in an XML envelope with a formal contract (WSDL)
REST is lighter and the default for web and mobile APIs. SOAP survives where strict contracts and its WS-* standards for security and transactions are required, as in some banking systems.
This topic is named in a candidate’s interview report: Product support engineer intern interview, 2025, on Reddit.
-
Why use a WebSocket rather than repeated HTTP requests for a live dashboard?
- A WebSocket keeps one connection open in both directions, so the server can push updates as they happen instead of the client polling
- WebSockets are always encrypted while HTTP is not
- A WebSocket sends each message as a new HTTP request
- WebSockets only work between servers
Show the answer
A. A WebSocket keeps one connection open in both directions, so the server can push updates as they happen instead of the client polling
It starts as an HTTP request that is upgraded, then stays open with very little overhead per message. STOMP is a small messaging protocol often layered on top for topics and subscriptions.
This topic is named in a candidate’s interview report: Product support engineer intern interview, 2025, on Reddit.
Software engineering 1
-
Why is Redis often put in front of a main database?
- It is an in-memory key-value store, so it can serve frequently read data such as sessions or cached results in well under a millisecond
- It replaces the need for any database
- It stores data only on tape
- It makes SQL joins faster inside the main database
Show the answer
A. It is an in-memory key-value store, so it can serve frequently read data such as sessions or cached results in well under a millisecond
Reads that hit the cache never reach the slower database. The trade-off is keeping the cache fresh, with expiry times or by updating or deleting keys when the underlying data changes.
This topic is named in a candidate’s interview report: Product support engineer intern interview, 2025, on Reddit.