Nitin Agrawal
Contact -
  • Home
  • Interviews
    • Secret Receipe
    • InterviewFacts
    • Resume Thoughts
    • Daily Coding Problems
    • BigShyft
    • CompanyInterviews >
      • InvestmentBanks >
        • ECS
        • Bank Of America
        • WesternUnion
        • WellsFargo
      • ProductBasedCompanies >
        • CA Technologies
        • Model N India
        • Verizon Media
        • Oracle & GoJek
        • IVY Computec
        • Nvidia
        • ClearWaterAnalytics
        • ADP
        • ServiceNow
        • Pubmatic
        • Expedia
        • Amphora
        • CDK Global
        • CDK Global
        • Epic
        • Sincro-Pune
        • Whiz.AI
        • ChargePoint
      • ServiceBasedCompanies >
        • Altimetrik
        • ASG World Wide Pvt Ltd
        • Paraxel International & Pramati Technologies Pvt Ltd
        • MitraTech
        • Intelizest Coding Round
        • EPAM
    • Interviews Theory
  • Programming Languages
    • Java Script >
      • Tutorials
      • Code Snippets
    • Reactive Programming >
      • Code Snippets
    • R
    • DataStructures >
      • LeetCode Problems
      • AnagramsSet
    • Core Java >
      • Codility
      • Program Arguments OR VM arguments & Environment variables
      • Java Releases
      • Threading >
        • ThreadsOrder
        • ProducerConsumer
        • Finalizer
        • RaceCondition
        • Executors
        • Future Or CompletableFuture
      • Important Points
      • Immutability
      • Dictionary
      • URL Validator
    • Julia
    • Python >
      • Decorators
      • String Formatting
      • Generators_Threads
      • JustLikeThat
    • Go >
      • Tutorial
      • CodeSnippet
      • Go Routine_Channel
      • Suggestions
    • Methodologies & Design Patterns >
      • Design Principles
      • Design Patterns >
        • TemplatePattern
        • Adapter Design Pattern
        • Decorator
        • Proxy
        • Lazy Initialization
        • CombinatorPattern
        • RequestChaining
        • Singleton >
          • Singletons
  • Frameworks
    • Apache Velocity
    • Spring >
      • Spring Boot >
        • CustomProperties
        • ExceptionHandling
        • Issues
      • Quick View
    • Rest WebServices >
      • Interviews
      • Swagger
    • Cloudera BigData >
      • Ques_Ans
      • Hive
      • Apache Spark >
        • ApacheSpark Installation
        • SparkCode
        • Sample1
        • DataFrames
        • RDDs
        • SparkStreaming
        • SparkFiles
    • Integration >
      • Apache Camel
    • Testing Frameworks >
      • JUnit >
        • JUnit Runners
      • EasyMock
      • Mockito >
        • Page 2
      • TestNG
    • Blockchain >
      • Ethereum Smart Contract
      • Blockchain Java Example
    • Microservices >
      • Messaging Formats
      • Design Patterns
    • AWS >
      • Honeycode
    • Dockers >
      • GitBash
      • Issues
  • Databases
    • MySql
    • Oracle >
      • Interview1
      • SQL Queries
    • Elastic Search
  • Random issues
    • TOAD issue
    • Architect's suggestions
  • Your Views
I got this opportunity with CDK Global, Pune & below process details from CerTro Technologies Pvt. Ltd.
As this interview happened in month of May 2020, so interview happened over Zoom. And I will suggest not to use the online IDE being offered by CDK interviewers, as this IDE just s*cks to give the reason that you can't code. So try to use your own desktop IDE & share that screen rather. And if you get call with this Snehasish from CerTro, don't expect proper feedback from him, he is also like any other recruiter only & never get proper feedback, only can tell Yes or No.

Selection Process:
1.       Coding challenge (Programming Test for 60 – 90 minutes)
2.       2 Technical Face to Face interview.
3.       1 interview with Hiring Manager Face to Face
4.       1 HR Interview.

Anyone looking for the answer of the coding, please let me know I will provide the perfectly working & innovative solution, which no one at CDK also would have ever thought of.
Coding problem was on Shopping Cart.
Then I had only one interview discussion once & interviewer was looking more about logics & approach but due to some miscommunication that interview was interrupted & rescheduled.
Next week I had the interview discussion with some other interviewer where I am pretty much sure, interviewer himself was not interested. So he just spent time in asking about the project in previous company. Then in last 30 mins he asked below 3 questions only -

Question 1 : Write a code to show the deadlock.
Solution :
public class CDKDeadlock {

public static void main(String[] args) throws InterruptedException {
Resource1 resource1 = new Resource1();
Resource2 resource2 = new Resource2();
Thread t1 = new Thread(new Deadlock(resource1, resource2, 1));
Thread t2 = new Thread(new Deadlock(resource1, resource2, 2));
t1.start();
t2.start();
t1.join();
t2.join();
System.out.println("No Deadlock detected....");
}

static class Deadlock implements Runnable {
int order;
Resource1 resource1;
Resource2 resource2;

public Deadlock(Resource1 resource1, Resource2 resource2, int order) {
this.order = order;
this.resource1 = resource1;
this.resource2 = resource2;
resource1.setResource2(resource2);
resource2.setResource1(resource1);
}
@Override
public void run() {
if(order == 1) {
resource1.getResource();
} else if(order == 2) {
resource2.getResource();
}
}
}

static class Resource1 {
Resource2 resource2 = null;
public Resource1() {

}
public void setResource2(Resource2 resource2) {
this.resource2 = resource2;
}
public synchronized void getResource() {
System.out.println("Resource1");
try {
Thread.sleep(100);
} catch (InterruptedException e) {
e.printStackTrace();
}
resource2.getResource();
}
}

static class Resource2 {
Resource1 resource1 = null;
public Resource2() {

}
public void setResource1(Resource1 resource1) {
this.resource1 = resource1;
}
public synchronized void getResource() {
System.out.println("Resource2");
try {
Thread.sleep(100);
} catch (InterruptedException e) {
e.printStackTrace();
}
resource1.getResource();
}
}
}

Question 2 : Why Map is not part of Collection interface in Java?
Solution : I gave him the reasons as per my understanding with reasons but I think he was not interested in what I am
                 explaining & he had already made his mind about my profile. But anyhow this question is straight & simple one if
                 one understands a bit about Java APIs.
​
Question 3 : You are given array of positive integers,which are in sorted order
                     int [] intArray = new int[] { 1,2,3,5,6,8,9,10,12 } ;
                     Print the output in below format -
                     //1,2,3
                     //5,6
                     //8,9,10
​Solution : 
Picture
Below is better version with less if-else statements -
Picture
 Enough show off for such simple problem, use below simple way -
Picture
Powered by Create your own unique website with customizable templates.