Groww interview prep
5 practice questions on the topics candidates reported from Groww interviews, with answers. The questions are ours; each one links to the interview report that names its topic.
DSA 1
-
To find a peak (an element larger than its neighbours) by binary search, you compare a[mid] with a[mid + 1]. If a[mid] < a[mid + 1], what do you know?
- There is no peak
- A peak exists only to the left of mid
- mid is a peak
- A peak exists somewhere to the right of mid
Show the answer
D. A peak exists somewhere to the right of mid
Walking right from mid, the values either keep rising until the end (the last element is a peak) or fall at some point (the element before the fall is a peak). Halving each time gives O(log n).
This topic is named in a candidate’s interview report: SDE fresher interview, 2024, on Reddit.
Python 1
-
What does this print?
def ok(s, skip=True): i, j = 0, len(s) - 1 while i < j: if s[i] != s[j]: if not skip: return False return ok(s[i + 1:j + 1], False) or ok(s[i:j], False) i, j = i + 1, j - 1 return True print(ok("abca"), ok("abc"))- True True
- False False
- False True
- True False
Show the answer
D. True False
"abca" fails at b and c; deleting the c leaves "aba", a palindrome. "abc" fails at a and c, and neither "bc" nor "ab" is a palindrome. At most one deletion keeps it O(n).
This topic is named in a candidate’s interview report: SDE fresher interview, 2024, 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: SDE fresher interview, 2024, on Reddit.
Web development 1
-
How does Node.js serve many requests at once on a single JavaScript thread?
- It starts a new thread for every request
- It compiles JavaScript into separate processes
- It blocks on each request until it finishes
- An event loop runs callbacks while I/O such as disk and network is done asynchronously by the operating system and libuv's thread pool
Show the answer
D. An event loop runs callbacks while I/O such as disk and network is done asynchronously by the operating system and libuv's thread pool
Waiting on I/O does not tie up the thread, so thousands of connections can be open. A long CPU-bound task does block the loop, which is why heavy work goes to worker threads.
This topic is named in a candidate’s interview report: SDE fresher interview, 2024, on Reddit.
Machine learning 1
-
What does a support vector machine choose when separating two classes?
- The boundary that passes through the class means
- The boundary that touches the most points
- The boundary with the largest margin to the nearest training points of each class, the support vectors
- A random separating line
Show the answer
C. The boundary with the largest margin to the nearest training points of each class, the support vectors
Maximising the margin tends to generalise well. Kernels such as RBF let an SVM draw non-linear boundaries by working as if in a higher-dimensional space.
This topic is named in a candidate’s interview report: SDE fresher interview, 2024, on Reddit.