Lenskart Backend Developer Interview Experience
Lenskart Backend Developer Interview Experience
How I have applied?
Hello, I connected with the people of Lenskart by sending connection requests
with an invite. I sent requests to around 30-40 people out of which 5-6 people
connected and 2-3 agreed for providing referrals. They asked for my resume and
Job Id.
Invite message
Hello ABC,
I am Harshit working as a software engineer with 1.5 experience. I would
like to connect with your network and explore opportunities for
SE/SDE/Backend engineer position at Lenksart.
Thanks & regards
Thanks & regards
After a few days, received a call from HR. They asked about my skills and
background. And why I want to switch. After that, schedule an interview with
one of the experienced SE. And this is how communication was established.
Tech Interview 1
Duration - 45mins
Both joined at the time. Started with a brief introduction of both. Then asked
about the technologies worked on, my current company's work, and my role.
Then, switched to DSA questions
Q1. Given two arrays A and B. A sorted in non-decreasing order and B
sorted in non-increasing order. Merge both arrays such that the resulting
array is in descending order (no duplicates)
Testcase
I/p A[] = [ 2 5 7 8 9 ]
I/p B[] = [ 8 6 4 3 1 0 ]
O/p C[] = [9 8 7 6 5 4 3 2 1 0]
I started telling them about possible approaches. But the interviewer himself
didn't know the solution so, he just agreed with what I said. It seemed that
the question was picked at the point of the interview only.
Anyway, I explained the solution and started to pseudo-code the solution. The
interviewer doesn't seem to be satisfied, anyway, he asked a few questions and
boundary conditions about the solution. The problem was solved.
Pseudo-code
i = a.length - 1;
j = 0;
k = 0;
while(i >= 0 && j < b.length){
if(a[i] > b[j])
c[k] = a[i];
i--;
else if (a[i] == b[j])
c[k] = a[i];
i--;
j++;
else
c[k] = b[j];
j++;
k++;
}
while(i < a.length){
c[k++] = a[i];
}
while(j >= 0){
c[k++] = b[j];
}
j = 0;
k = 0;
while(i >= 0 && j < b.length){
if(a[i] > b[j])
c[k] = a[i];
i--;
else if (a[i] == b[j])
c[k] = a[i];
i--;
j++;
else
c[k] = b[j];
j++;
k++;
}
while(i < a.length){
c[k++] = a[i];
}
while(j >= 0){
c[k++] = b[j];
}
Q2. Given an array of strings, return the first anagram from array
(somewhat like
this)
Testcase:
I/p S[] = [ bad , abd , bat , tab ]
O/p Res[] = [ [ bad , abd ], [ bat , tab ] ]
Asked some questions about problem and started thinking and telling my
approach. Was able to pseudo-code it,
int count[26];
for(String s : str){
for(int i
=0;i<s.length;i++)
count[s[i] -'a']++;
String temp = count.toString()
if(hashset.contains(temp))
return s;
hashSet.add(temp);
}
then asked questions about its time and space complexity.
Interview done.
Technical Interview 2
Duration - 60mins
Next day. Started with a brief introduction of both. Focussed more on programming. Asked
fundamental questions from OOPs. Asked to present screen, gave me an input/
output question
public class Test {
public static void main(String[] args) {
Parent p=new Child();
p.myMethod();
p.myMethod2();
}
}
class Parent {
private String name;
public void myMethod(){
System.out.println("i am in parent");
}
}
class Child extends Parent{
@Overriding
public void myMethod(){
System.out.println("i am in child");
}
public void myMethod2(){
System.out.println("i am in parent 2");
}
}
Asked about the outputs. And some variations of it, concepts behind this
code (Polymorphism). The interviewer this time, was active and interested in
listening.
Then asked me about my favorite data structure. So, I told stack, therefore
he asked me about a linked list problem.
Delete the Kth node from the end of the linked list.
here
I/p
1 -> 2 -> 3 -> 4 -> 5 -> null
n = 2
O/p
1 -> 2 -> 3 -> 5 -> null
The first approach I tell was to iterate to calculate the length of LL. Then
again traverse and delete (length - k)th node. They found that trivial and
asked for a better approach.
Therefore, I told the other approach. Using two pointers start and shifted.
Same as GFG.
They asked me to code it and ran it locally. So wrote compilable java code.
But I was missing boundary conditions and the code was not working properly.
It took some time and help to resolve that. In the end, time was over however
the solution worked at the end. Looked convinced
class Test{
static class Node{
Node next;
int key;
Node(int k){
key = k;
next = null;
}
}
public static void main(String
args[]){
Node n1 = new Node(1);
Node n2 = new Node(2);
Node n3 = new Node(3);
n1.next = n2;
n2.next = n3;
System.out.println(deleteFromEnd(n1,3).key+" "+n1.next.key);
}
static Node deleteFromEnd(Node
head , int n){
Node start = head;
Node shifted = start;
int i = 0;
if(head == null )
return head;
while(i < n && shifted
!= null){
System.out.println(shifted.key);
shifted = shifted.next;
i++;
}
Node prev = null;
while(shifted != null ){
start = start.next;
prev = start;
shifted = shifted.next ;
}
if(prev != null)
prev.next = start.next;
else
head = head.next;
return head;
}
}
Now after that interview, they took 15 days to get back. I thought the
process was over and I was rejected. But after 15 days received a call from
HR for the final round. Surprised, why so late. The final round was
Techno-HR.
Techno-HR round
Duration - 40mins
Again same brief intro, and programming question.
Remove duplicate words from a string.
And SQL inner join query to count employees with given department name.
Then asked about my current CTC and experience, and I told them my current CTC
and I have 1.5 years of experience. Then, asked about my
expectation. So I told about what work I would like to do and expected CTC. Everything went right. I also asked questions about the team they are
working with, the work culture, and the location. And they gave an insightful
answer on that.
I was then offered the role.
Thanks for reading. Hope that helped.
Please like 👍 the button at the top and poll ☝ your programming choice at
the bottom.
Let's Play a simple programming quiz
Comments
Post a Comment
We need people who give us feedback and this is how we grow. Please do comment if you find something faulty, wrong , helpful, valuable in anyway. You can comment anonymously. Thanks for your contribution.