silentScream's blog

By silentScream, 2 months ago, In English

In every hiring challenge/cp contest we see some issues with that platform.

Today, in Codeagon, 1 problem had incorrect testcases. Is this what we should be expecting from one of the biggest cp/hiring contest of India?

 
 
 
 
  • Vote: I like it
  • +70
  • Vote: I do not like it

»
2 months ago, # |
  Vote: I like it +37 Vote: I do not like it

FYI, this is a competitive programming related platform not a hiring one.Post this somewhere else.

  • »
    »
    2 months ago, # ^ |
      Vote: I like it +32 Vote: I do not like it

    Codeagon is also one of the biggest competitive progamming contest of India.

»
2 months ago, # |
  Vote: I like it +29 Vote: I do not like it

I don't know why these hiring platforms are so adamant on having us use their ides. They have 0 debugging functionality, no autocompletion. Hackerrank atleast has these features.

  • »
    »
    2 months ago, # ^ |
      Vote: I like it +6 Vote: I do not like it
    • They don't support pbds
    • No auto correction
    • Zero Debugging support
    • »
      »
      »
      2 months ago, # ^ |
      Rev. 2   Vote: I like it 0 Vote: I do not like it

      Although I agree with all other points , but InterviewBit support PBDS . I used it in 3rd and it compiled.

      • »
        »
        »
        »
        2 months ago, # ^ |
          Vote: I like it 0 Vote: I do not like it

        I was also trying to use that but it was showing compilation error. Although same code was running in my system. After that I switched to segment tree.

»
2 months ago, # |
  Vote: I like it +9 Vote: I do not like it

Also they changed test cases in the middle of the contest XD

  • »
    »
    2 months ago, # ^ |
      Vote: I like it +5 Vote: I do not like it

    *near the end of the contest. Also, they don't even bother to change the "trivial testcases" so that the participants get confused XD

»
2 months ago, # |
  Vote: I like it +28 Vote: I do not like it

I think testcases for the Jeff/ELon problem were also wrong. For the planet 6, if we manually calculate, I think the answer should be 6 and not 7.

This overcounting is happening due to planet 4 segments i,e ([5,6]U[6,8]). Can anyone verify this?

  • »
    »
    2 months ago, # ^ |
      Vote: I like it +5 Vote: I do not like it

    Yes exactly, but overcounting passed.

    • »
      »
      »
      2 months ago, # ^ |
        Vote: I like it +36 Vote: I do not like it

      I had to "think like the setter" to make it pass. XD Shit man, I was looking forward to this contest since 1 year. Now it's ruined. :)

  • »
    »
    2 months ago, # ^ |
      Vote: I like it 0 Vote: I do not like it

    yes, considering the overlapping indexes twice got accepted

  • »
    »
    2 months ago, # ^ |
      Vote: I like it 0 Vote: I do not like it

    Yes exactly,won't they rejudge? because I was damn sure that the tcs are incorrect so I didn't change my solution and submitted the same:(

  • »
    »
    2 months ago, # ^ |
      Vote: I like it 0 Vote: I do not like it

    XD I wasted alot of time on this question thinking that I am not understanding this question properly.Read this question 5-6 times.Later on gave up and went for the next question,same started happening for the next question ( question related to groups).I gave up and went to sleep

    • »
      »
      »
      2 months ago, # ^ |
        Vote: I like it +3 Vote: I do not like it

      same I thought that I am not understanding the question

»
2 months ago, # |
  Vote: I like it +3 Vote: I do not like it

I hope they rejudge the submissions for Swap it harder problem post-contest. I will have 1 extra AC. :)

  • »
    »
    2 months ago, # ^ |
    Rev. 2   Vote: I like it +13 Vote: I do not like it

    Btw it will be unfair for those who has to do if(a==0 && b==0) return(2)

    to make it pass. XD, which I did initially.

    • »
      »
      »
      2 months ago, # ^ |
        Vote: I like it 0 Vote: I do not like it

      Everyone who got AC initially did that XD

    • »
      »
      »
      2 months ago, # ^ |
        Vote: I like it 0 Vote: I do not like it

      Was that the problem "DP integers"? My first submission was correct (A=0,B=0 gave 0). Then I had to put condition to pass it.

      I just want to see the ranklist now. Who is rank 1 in this contest XD?

    • »
      »
      »
      2 months ago, # ^ |
        Vote: I like it 0 Vote: I do not like it

      I also did the same but didn't know about change in testcases and didn't resubmit
      and now it will fail :(

  • »
    »
    2 months ago, # ^ |
      Vote: I like it 0 Vote: I do not like it

    Sorry, I thought you are talking of "DP and integer". Why will they rejudge swap it harder? It was alright right?

    • »
      »
      »
      2 months ago, # ^ |
        Vote: I like it +8 Vote: I do not like it

      That grouping + lexicographically problem had incorrect tests.

      For the array = [ 8,7,6,6,5,3,0,6,0], it gave answer = 3. But the answer is 0.

      • »
        »
        »
        »
        2 months ago, # ^ |
        Rev. 2   Vote: I like it 0 Vote: I do not like it

        The groups are [8,7,6,5,3,0],[6],[6,0]

        If you merge

        Final array will be

        8,7,6,5,3,0,6,6,0

        Which will give answer 3

        • »
          »
          »
          »
          »
          2 months ago, # ^ |
            Vote: I like it +3 Vote: I do not like it

          But you can get a lexicographically greater sequence if your groups are [8,7.6] [6,5,3,0] and [6,0]

        • »
          »
          »
          »
          »
          2 months ago, # ^ |
            Vote: I like it 0 Vote: I do not like it

          If you bring that 0 from first group to 2nd group. It'll be larger lexicographically.

          The array i gave as input is already optimal [8,7,6],[6,5,3,0],[6,0]. Notice my array also has 3 groups, and is larger lexicographically.

          • »
            »
            »
            »
            »
            »
            2 months ago, # ^ |
            Rev. 2   Vote: I like it +6 Vote: I do not like it

            Turns out many people had wrong solution which got full AC, and people who had optimal solution had to scratch their hairs for 2 hours to realize that the test cases are wrong and most likely setters solution as well. XD XD

            • »
              »
              »
              »
              »
              »
              »
              2 months ago, # ^ |
                Vote: I like it 0 Vote: I do not like it

              If they rejudge.. it'll drastically change the ranklist.

              • »
                »
                »
                »
                »
                »
                »
                »
                2 months ago, # ^ |
                  Vote: I like it 0 Vote: I do not like it

                Yeah but what about the wasted time.

                • »
                  »
                  »
                  »
                  »
                  »
                  »
                  »
                  »
                  2 months ago, # ^ |
                    Vote: I like it +11 Vote: I do not like it

                  I don't care about the pentalty time anymore. I wasted FOUR HOURS ..that too.. FROM A SUNDAY on this contest. :)

          • »
            »
            »
            »
            »
            »
            2 months ago, # ^ |
              Vote: I like it 0 Vote: I do not like it

            Yes, you are correct. Setter thought the same way as me.. XXDD. But What's the optimal solution?

        • »
          »
          »
          »
          »
          2 months ago, # ^ |
            Vote: I like it 0 Vote: I do not like it

          You need to pivot your groups around the smallest most frequent element.

»
2 months ago, # |
  Vote: I like it +21 Vote: I do not like it

Were testcases wrong for problem 3?

  • »
    »
    2 months ago, # ^ |
      Vote: I like it 0 Vote: I do not like it

    I think It was for 2nd question, don't know the order were same for all users or not.

»
2 months ago, # |
  Vote: I like it 0 Vote: I do not like it

How many of you did all 6?

»
2 months ago, # |
  Vote: I like it +54 Vote: I do not like it

Request to companies to stop using InterviewBit for contests.

(GCJ/FHC/Yandex/VK Cup are fine, I mean only the ones that are specifically a step in their selection process. It's not an issue where I'm from but I do see the problems that stem from it.)

  • »
    »
    2 months ago, # ^ |
      Vote: I like it +3 Vote: I do not like it

    Do you think companies hire directly from the contest results?

    • »
      »
      »
      2 months ago, # ^ |
        Vote: I like it 0 Vote: I do not like it

      people with top ranks from kickstart are called for interview if they have opted for it

      • »
        »
        »
        »
        2 months ago, # ^ |
          Vote: I like it +3 Vote: I do not like it

        Yes, so it is just a step in getting the interview, right? There will be 4 to 5 rounds of interviews and they will hire the deserving ones anyways. I may be wrong but it sounded like -is-this-fft- thinks they hire directly from the contests.

    • »
      »
      »
      2 months ago, # ^ |
      Rev. 3   Vote: I like it +3 Vote: I do not like it

      No. That'a not the issue.

»
2 months ago, # |
  Vote: I like it 0 Vote: I do not like it

What do you guys think should be no. of correct submissions to get shortlisted(basically under rank 150) ?

»
2 months ago, # |
  Vote: I like it +26 Vote: I do not like it

The question Swap it Harder had wrong tests, the array which they are forming is not always lexicographically largest. The question with Elon Musk also had wrong logic ,overlapping segments was working I wasted almost 30 mins only to realise the setter has screwed up.

  • »
    »
    2 months ago, # ^ |
    Rev. 2   Vote: I like it +17 Vote: I do not like it

    This contest felt more like April fool contest where we have to guess what the setter actually want rather than what the correct solution should be. Loved this new idea of contests. XD XD.

  • »
    »
    2 months ago, # ^ |
      Vote: I like it +16 Vote: I do not like it

    Your profile pic is the depicition of feelings of most coders who participated in this contest.

  • »
    »
    2 months ago, # ^ |
      Vote: I like it 0 Vote: I do not like it

    I actually wasted half of the contest time to debug my solutions for these two problems xD

  • »
    »
    2 months ago, # ^ |
      Vote: I like it +24 Vote: I do not like it

    One of the problem(i don't remember name) gave TLE for just declaring Fenwick tree of size 2e5.

»
2 months ago, # |
  Vote: I like it +25 Vote: I do not like it

Well played InterviewBit. They changed the test cases in the middle of the contest and what did they do to nofity the contestants? They only send an email stating that participants should resubmit as test cases were changed. Now tell me one thing, who would constantly check for upcoming emails in the middle of a hiring test? They could have simply notified on the website via a notification. Now rejudging with new test cases looks unfair for those who did not check their emails in the middle of a contest. And why does Trilogy Innovations take their test in InterviewBit who simply doesn't support notifications? :(

  • »
    »
    2 months ago, # ^ |
      Vote: I like it +17 Vote: I do not like it

    I received my email after I ended the contest :)

  • »
    »
    2 months ago, # ^ |
    Rev. 2   Vote: I like it +9 Vote: I do not like it

    I got the mail at 11:03. They think I am capable of time travelling, so generous of them.

  • »
    »
    2 months ago, # ^ |
      Vote: I like it +12 Vote: I do not like it

    How was one supposed to check the mail? They didn't want us to change tabs and proctoring was also on. So, can't use mobile phone as well.
    And what about people who already submitted the contest before the mail arrived?

  • »
    »
    2 months ago, # ^ |
      Vote: I like it +3 Vote: I do not like it

    Seems like the contest is completely ruined, so no question of rejudge.

  • »
    »
    2 months ago, # ^ |
      Vote: I like it 0 Vote: I do not like it

    Means I will `not receive any point for the testcase (A=0,B=0) since I made answer 2 for this testcase.

»
2 months ago, # |
  Vote: I like it 0 Vote: I do not like it

I don't know why but Two Summation was passing only for 270 pts . My time Complexity was Nlogn I used fenwick trees

  • »
    »
    2 months ago, # ^ |
      Vote: I like it 0 Vote: I do not like it

    How to solve Two summation with fenwick tree ? I solved using binary search and modifying the summation formula given.

    • »
      »
      »
      2 months ago, # ^ |
        Vote: I like it 0 Vote: I do not like it

      I used Fenwick to find out how many elements are actual less or equal to a[i]. Basically to use operations which are present in ordered set.

      • »
        »
        »
        »
        2 months ago, # ^ |
          Vote: I like it 0 Vote: I do not like it

        you have to compare on the basis of a[i]-b[i] not only on the basis of a[i]

        • »
          »
          »
          »
          »
          2 months ago, # ^ |
          Rev. 2   Vote: I like it 0 Vote: I do not like it

          Yes i did that only first i calculated all a[i] — b[i] then did coordidnate compression then inserted in Fenwick

    • »
      »
      »
      2 months ago, # ^ |
      Rev. 4   Vote: I like it 0 Vote: I do not like it

      You don't need fenwick/seg tree.

      Assuming a[i] + b[j] >= a[j] + b[i],
      
      a[i] - b[i] >= a[j] - b[j] (This contributes 2 * (a[i] + b[j]) in total).
      

      Sort according to a[i] — b[i] and then a traversal is enough. Assuming you are at index i, it will contribute i * a[i] + summation of all b till i. Now reverse the array and repeat but add i * b[i] + summation of all a till i (reversing because this time we are looking at elements greater than a[i] — b[i], although you can do it without reversal using suffix sum).

»
2 months ago, # |
  Vote: I like it +14 Vote: I do not like it

I think this contest was testing our "How to think like a problem-setter?" skill.
1. DP Integers: For A=0 B=0, they gave ans = 2
2. Swap It Harder: Their logic was incorrect. For [9,8,7,8], the answer was given by considering [9,8,7], [8] grouping. But the grouping [9,8], [8,7] was giving a better answer with same number of groups.
3. Jeff/Elon: They didn't consider double counting.

PS: They changed the test case for DP integers in the end of the contest. What about people who already submitted considering, if(A==0 and B==0) return 2; and exited the contest?

  • »
    »
    2 months ago, # ^ |
      Vote: I like it 0 Vote: I do not like it

    Now that I think about the test case of Swap it harder, their logic is incorrect. Anyone knows how to solve Swap It Harder ?

    • »
      »
      »
      2 months ago, # ^ |
      Rev. 2   Vote: I like it 0 Vote: I do not like it

      I maybe wrong. But consider the smallest most frequent element (say it occurs x times) as pivot.You will have atmost x groups.Then for every number (0-9) if it is greater than the pivot add it to the front groups, if it is less than pivot add to the rear groups. Write a custom comparator function to lexicographically compare these groups. Now you know your final array. Use segment tree/ordered set to count swaps.

      • »
        »
        »
        »
        2 months ago, # ^ |
          Vote: I like it +3 Vote: I do not like it

        Hard to prove the optimal partitioning into groups, but counting swaps part was so easier, using BIT/Segment Tree.

        • »
          »
          »
          »
          »
          2 months ago, # ^ |
            Vote: I like it 0 Vote: I do not like it

          How do you calculate swaps? Lets say we have initial and final array and we need to calculate adjacent sways to make them equal.

          PS : What i did in contest was to maintain 10 bit tree for each number storing their positions and then did some complicated shit over that

          • »
            »
            »
            »
            »
            »
            2 months ago, # ^ |
              Vote: I like it 0 Vote: I do not like it
            • »
              »
              »
              »
              »
              »
              »
              2 months ago, # ^ |
                Vote: I like it 0 Vote: I do not like it

              this blogs deals with array with distinct elements. But it is not the case with our problem

              • »
                »
                »
                »
                »
                »
                »
                »
                2 months ago, # ^ |
                  Vote: I like it 0 Vote: I do not like it

                The first problem itself has duplicate elements. We just have to make them distinct. We number duplicate elements in increasing order so that unnecessary swaps are not performed to sort them.

                Code
                • »
                  »
                  »
                  »
                  »
                  »
                  »
                  »
                  »
                  2 months ago, # ^ |
                  Rev. 2   Vote: I like it 0 Vote: I do not like it

                  got it Thanks

                  BTW, do you know how to solve 6th one of contest (one with weight and priority)

                • »
                  »
                  »
                  »
                  »
                  »
                  »
                  »
                  »
                  2 months ago, # ^ |
                    Vote: I like it 0 Vote: I do not like it

                  no i could only solve first four

      • »
        »
        »
        »
        2 months ago, # ^ |
          Vote: I like it 0 Vote: I do not like it

        If we partition like:

        minimum number of groups will be the max(count[digit]) .. and once we fill these groups, we can get lexicographically maximum by joining group[0]+group[1]..group[max-1]

        To do this, firstly we can partition the max digit to count[max_digit] groups starting from group 0.

        Now we'd like to keep the group[0]'s last element as big as possible and then from group[1] and so on..

        For this, traversing digit from high to low, we can check what is the leftmost starting group position for which these can be partitioned, but there can be case when a number lesser than current digit will have starting group position < this starting group position, so for each position we will skip, there should be no digit < current for which we "have" to start from this position.

        After that we can just combine group0...group(max), then minimum no of swaps can be check by segtree.

        Will there be any counter case for approach? I keep getting WA on a testcase

  • »
    »
    2 months ago, # ^ |
      Vote: I like it 0 Vote: I do not like it

    congrats! you got that.

»
2 months ago, # |
  Vote: I like it +14 Vote: I do not like it

How to solve 6th?

»
2 months ago, # |
Rev. 2   Vote: I like it +19 Vote: I do not like it

Wasted complete 4 hours just thinking why my correct code is not giving the output which they desire...Could've given Div2 instead :(

»
2 months ago, # |
  Vote: I like it +8 Vote: I do not like it

I don't know what type of developers are there in Interviewbit, I have a phobia to enter the website!

In one company's online interview, the sample test cases were depicting 1-based indexing in arrays but when I submitted in that way it kept giving me a run time error! It took the whole time of the test for me to debug to figure out where I was wrong and still failed.

The main function is hidden in an actual contest is not fair if the problem is not set correctly! Hackerrank is much better.
»
2 months ago, # |
  Vote: I like it +5 Vote: I do not like it
Meanwhile interviewbit
»
2 months ago, # |
  Vote: I like it 0 Vote: I do not like it

They all should use CF

»
2 months ago, # |
  Vote: I like it 0 Vote: I do not like it

Guys, Can you tell, how many questions have you done so that we can make a rough figure if there is some chance for shortlisting.
Starting:
Without changed tc: 3 questions
With changed tc: 2 questions

  • »
    »
    2 months ago, # ^ |
      Vote: I like it +12 Vote: I do not like it

    I am pretty sure, the contest will get cancelled. Maybe again it will be conducted later. So no question of shortlisting now.

»
2 months ago, # |
Rev. 2   Vote: I like it +6 Vote: I do not like it

biggest cp/hiring contest

-is-this-fft- triggered.

Edit:: See, was right

  • »
    »
    2 months ago, # ^ |
      Vote: I like it +18 Vote: I do not like it

    thanks for the link, upvoted him

»
2 months ago, # |
  Vote: I like it +32 Vote: I do not like it

Even though my expectations from such a contest were not high, thanks to the platform, wrong test cases, and not-so-good problems, the expectations are -inf now.

»
2 months ago, # |
  Vote: I like it 0 Vote: I do not like it

can someone paint Codeagon for me?

»
6 weeks ago, # |
  Vote: I like it +9 Vote: I do not like it

How many did you guys solve today in Codeagon2.0?