CRED Machine Coding Round for Solution Engineer
CRED Machine Coding Round
About Company
CRED is an exclusive community for India’s most trustworthy and creditworthy
individuals, where the members are rewarded for good financial behavior.
Job Profile:
Solution Engineer
About Test
Machine coding round involves solving a design problem in a matter of a
couple of hours. It requires designing and coding a clean, modular and
extensible solution based on a specific set of requirements.
This is supposed to be the second round in the hiring process for this
profile. First-round, is a coding round hosted over CodeChef or hackerrank.
The level of coding round is intermediate. Here is the link of
CREDs coding round
hosted over CodeChef in March 2022.
After clearing the coding round, we get an invite for the machine coding
round. In the invite, there are some pre-requisites to follow, like installations and environment setup. The expectation during this round
from us is to understand the problem statement (real-world and ambiguous),
able to break down and implement the same through the code.
Pre-requisites asked
Skills needed :
Hands-on Coding, Solving real-world problems, Clean Code, familiarity with OOPS methodology (Encapsulation, Abstraction, Modularity, Extensibility), SOLID, DRY principle.
Programming language :
PL would be limited in the project round to the following
- Java 8
- Python 3.5+
- NodeJS
- C++
Please note that we need to attempt the problem statement
only in one language
as per our preference.
Java setup:
Local IDE: IntelliJ
Version: Java 8
Packages and libraries: Maven and JUnit5 framework
Python setup:
Local IDE: Pycharm or VS code
Version: Python 3.5
Packages and libraries: pip install --user -r requirements.txt
Node JS setup:
Local IDE: VS code
Packages and libraries: npm test to run the test cases
Note: This test is tailored to understand our technical skills
and fasten the interview process.
Machine coding question
Duration: 2 hrs
Platform: Hackerrank with VS code integrated | webcam enabled
Design Vaccine Center
Vaccine Center is a physical location where the vaccines are administered.
Each center can have a supply for multiple vaccine types viz. Covishield,
Covaxin, Sputnik, etc. We have to design a vaccine center which has below
functionalities
Visit this github for
complete question and solution. Please STAR the repo to show your support😊
Functionalities
- Add a VC
- Add / Update / Remove availability of vaccines in the center based on type of vaccine and dose.
- Book a vaccine slot, given a center id, type of vaccine and dose.
- Search by vaccine type and dose type (Ex: Search for centers which have Covishield dose1 available)
So basically, we are asked to override this class methods. Visit the Github link for a better understanding of the template code provided in the round. Please STAR the repo to show your support 😊.
package com.vaccinecenter.service;
import java.util.List;
import com.vaccinecenter.enums.DoseType;
import com.vaccinecenter.enums.VaccineType;
import com.vaccinecenter.models.SearchRequest;
import com.vaccinecenter.models.SearchResponse;
import com.vaccinecenter.models.VaccineAvailability;
import com.vaccinecenter.models.VaccineCenter;
public interface VaccineCenterManager {
/**
* Add vaccine center in the
system,
* return true if insertion is
successful else false
* @return boolean
**/
boolean add(VaccineCenter
vaccineCenter);
/**
* Add availability of vaccines
in the center based on type of vaccine and type of dose,
* return true if insertion is
successful else false
* @return boolean
**/
boolean addAvailability(String
vaccineCenterId, VaccineAvailability vaccineAvailability);
/**
* Update availability of
vaccines in the center based on type of vaccine and type of
dose,
* return true if update is
successful else false
* @return boolean
**/
boolean updateAvailability(String
vaccineCenterId, VaccineAvailability vaccineAvailability);
/**
* Remove availability of
vaccines in the center based on type of vaccine and type of
dose,
* return true if remove is
successful else false
* @return boolean
**/
boolean removeAvailability(String
vaccineCenterId, VaccineAvailability vaccineAvailability);
/**
* Book vaccine slot for given
vaccineCenterId where vaccineType & doseType are
available.
* return true if slot is booked
successfully else false.
**/
boolean bookVaccineSlot(String
vaccineCenterId, VaccineType vaccineType, DoseType doseType);
/**
* Search by vaccineType &
doseType, returns all the vaccine centers which supports given vaccine
type and dose type
* return SearchResponse contains
count & list of the Vaccine center
* @return {@SearchResponse}
**/
SearchResponse search(VaccineType
vaccineType, DoseType doseType);
/**
* Search vaccine centers which
supports any of the given vaccine type and dose type
* return SearchResponse contains
count & list of the Vaccine Center
* @return {@SearchResponse}
**/
SearchResponse
search(List searchRequestList);
Hope that blog post helped you prepare for the machine round.
Please like 👍 the button at the top and poll ☝ your programming choice at the bottom. And don't forget to STAR the git repository
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.