上周 1 月,Snapdeal 在我的校园为软件开发人员进行了安置活动。资格 – 所有 CSE(无指针标准)
在线测试-
1 小时内 21 (MCQ) +2 (编码)。对hackerrank进行的测试
21 MCQ 有近 10 个基于能力和 11 个 C 输出的问题。
优先考虑编码问题。尝试解决这两个问题(通过其中一个问题的所有测试用例并尝试另一个问题(即使是蛮力也会通过许多测试用例)
天赋不是一分钟就能解决的。首先解决基于 C o/p 的问题。
问题-
1.重叠画,找不到。可以清楚地看到的画作,给出了画作的极端坐标。绘画的排序很重要。 (假设所有画的高度相同,给出开始和结束坐标)
E.g.
5
1 4
2 6
3 4
8 10
7 10
XXXX
XXXXXX
XX
XXX Simple O(N^2) solution. Starting from rightmost painting, check if it completely hides any painting or not based on start and end coordinates. ( modification of interval selection problem )2- Given points of two lines segments A(x1,y1 x2,y2) & B(x3,y3 x4,y4) find whether the 2 segments intersect or not.Simpler approach ( short code )-http://community.topcoder.com/tc?module=Static&d1=tutorials&d2=geometry2#line_line_intersectionLength / complicated soln-https://www.geeksforgeeks.org/check-if-two-given-line-segments-intersect/Expected cut-off -I solved 2nd question and passed 1 test case for first question ( misunderstood the question during online round !! :p ) and solved 4 MCQ's only ( all fluke )So my advice, do solve both coding questions for sure and solve C o/p questions in last 15 minRound 1 – F2F TechnicalAvg 20-30 mins. 22 shortlistedMy went on for 1 hr to 1hr 15 minsInternship based dicussion (20-30 mins ). Based on Cloud, Virtualization, NetworkingQ1- Given N, find LCM from of all numbers from 2 to N. Give the complexity expressed in the form of Number of prime numbers <= N. Had to be really precise in terms of complexity ( in terms of prime factors, maximum recurrences, each recurrence complexity ). Long dicussion on complexity. Don't say any method whose complexity you cannot prove. (E.g saying that i can use Sieve of Eratosthenes for prime pre-processing will lead to question of complexity of Sieve which is O( Log LogN), that cannot be proved trivally. ) So avoid using any such terms
Q3- Spring / Hibernate in JAVA
Told him i work in C/C++ only. No experience in JAVA
Q2- Types of SQL- NoSQL and SQL(Relational DBMS ). Why the need of NoSQL- Big Data Analytics
Q3- How would you design DBMS for Snapdeal's website's shoe section.
Now if you want to further break it into Sports and Casual Shoe would you break the DB into two or add another entity ? Full justificdation
I initially answered with a multi-level indexed structure for DBMS storage. Could not answer on the second part of the question. He asked if i knew DBMS and i told him I do not know DBMS. He skipped the question and ended the interview. Told him i had advanced DBMS lab in my course currenlty and would learn it before graduating.
Round 2- Coding Round ( 2 Hrs )10 shortlistedQ1- Turn an image by 90 degreeQ2- Given a sequence of words, print all anagrams togetherQ3- Find a triplet that sum to a given valueI was the first one to solve all 3 in 45 mins roughly and went for next interview. Shortlisting criteria- 2 questions in 1 hr – 1hr 15 mins even though they said that we had 2 hrs to solve all 3 questions !!Round 3- F2F Technical4 shortlisted. This round went for almost 1hr 45 min - 2 hrs for me since I solved the Round 2 question earliest. Other 3 had almost 45 mins interview.Q1- Variation ofPrint all possible words from phone digitsGiven a dictionary of words and a number n. Find count of all words in dictionary that can be formed by given number n.I started by exponential solution and reduced it to polynomial. We discussed various approaches and tried a variety of methods and after 1-1.5 hrs of discussion finally ended up with an O(1) solution with some pre-processing overhead. After achiveing O(1) time complexity, he asked to further optimize the space complexity.Usage of Trie / TST. Internal Implementation of Hashing structure and replacing the hashing mechanism using Trie / TST.Q2- Given an array of elements. We can perform following operation only- Increase an array element. Cost of operation is the amount of increment made per array element. Now for a given H, we need to make any H ( not necessarily consecutive ) elements of array equal with minimum cost.E.g.N=6, H=42 3 5 6 4 4changes to -> 4 4 5 6 4 4Cost is ( 4-2 + 4-3 = 3 )N=6, H=32 3 5 6 4 4changes to -> 2 4 5 6 4 4Cost is ( 4-3 = 1 )Optimal complexity- O(N)Round 4 -F2F (HR)3 shortlistedTypical HR round.I would like to thank geeksforgeeks for a exhaustive set of interview questions and study material on data structures-algorithms.All Practice Problems for Snapdeal !Related Practice ProblemsGroup Anagrams Together