Machine Coding Round — What is it & how to crack it

Kanhu Panda
4 min readFeb 23, 2022

--

Hello guys. If you have landed here, you are probably wondering what a Machine Coding Round is? It is a relatively new interview round, introduced in the interview structure of software companies in the past few years. I remember my reaction when I first heard about the Machine Coding Round. It was something like this.

Machine Coding Round

Candidates are usually not aware of this round or what they will be asked in this round and end up getting rejected because of it. But don’t worry folks!!! I have got you covered. We will be covering what a machine coding round is and what you need to do in order to crack this round.

What is Machine Coding Round?

In machine coding rounds, you will have to design the entire system in approximately 2–3 hours. You will be given a question at the start of the interview, and you need to write fully functional code that fulfills all the requirements mentioned by the interviewer. In the end, you need to tell the interviewer about your design in detail. After this, the code will need to be run against some inputs provided by the interviewer. And if there are some issues in your code, the interviewer will point those out and you need to take care of the issues.

In a machine coding round, you don’t need to take care of a database connection or even store the data in a database. Just create an in-memory database. You can use a HashMap for this purpose.

Which companies have Machine Coding Rounds?

Machine Coding Rounds are a part of the interview structure of several companies. Some of these are:

  • Flipkart
  • Uber
  • Swiggy
  • Gojek
  • PhonePe
  • Razorpay
  • Upstox
  • Navi
  • Udaan
  • Supr Daily
  • Cred
  • BrowserStack
  • WhiteHat Jr

In the case of Flipkart, it is a part of the interview structure for SDE-1 and SDE-2 roles. But it might be asked for SDE-3 roles too depending on the situation. And the general duration for Machine Coding Round in Flipkart is around 2 hours.

Machine Coding round sample/ practice questions

There are a lot of examples/ questions for machine coding rounds. Following are some of the example questions. The companies in which they have been asked are in brackets.

  • Digital Wallet System (Flipkart) — I have written the solution along with the code for this question. Click on the title for more details.
  • Concurrent In-memory Publisher-Subscriber System (Uber)
  • Ride-Sharing Application (Flipkart)
  • Coffee Machine (Flipkart)
  • Splitwise (Swiggy, Flipkart, Upstox)
  • In-memory Task Scheduler Library (Uber)
  • Snakes & Ladders
  • Conference Room Management System (Flipkart)
  • Online Coding Platform (Flipkart)
  • Movie Booking System
  • Parking Lot Design (Swiggy)
  • Library Management System

How To Prepare For Machine Coding Rounds?

The best thing you can do to prepare for Machine Coding Rounds is to practice. And practice a lot. You need to do the following in order to prepare for the machine coding rounds:

  • Learn about Design Patterns
  • Learn about SOLID principles
  • Learn to write Object-Oriented Code
  • Practice Low-Level Design(LLD)
  • Practice Machine Coding

Machine Coding Round expectations

  • The code/ application should be executable. This is the most important expectation in a machine coding round.
  • The code should fulfill all the requirements mentioned by the interviewer.
  • The system/ code should be modular and easy to understand.
  • Your code should follow object-oriented principles.
  • Use a design pattern if possible.
  • The code should be easily extensible, which means it should be designed to allow the addition of new capabilities or functionality.

How To Crack Machine Coding Rounds?

You need to follow a 3-step process to crack the coding rounds. Since machine coding rounds typically last for around 1.5–2 hours and you need to write fully functional code, you need to plan ahead to make sure you complete all the requirements on time.

Planning:

  • Understand the requirements fully.
  • Ask questions if you have doubts.
  • Take some time to think about what approach you will be taking.
  • Use design patterns if possible.
  • Note down your classes and attributes.
  • Tell the interviewer about the implementation and approach you have chosen.

Implementation:

  • Have different classes for different purposes. Follow the single responsibility principle.
  • Make sure your code is modular.
  • Mark important fields as private and use getters and setters.
  • Have a separate class as a driver class where your main method will reside.
  • You must complete your coding 30 to 45 minutes before the scheduled time. So that you have time to discuss and make changes if necessary.

Review:

  • Tell the interviewer about the important classes and the relationship between them.
  • Tell them about SOLID principles if you have followed any. Also, inform about any design pattern you have used.
  • The interviewer might ask you to run the code against some other input. And these will most likely be inputs to test your code limitations.
  • The code might fail against some custom input provided by the interviewer.
  • Don’t panic. Make changes as necessary.

That’s it, folks!!! Hope I have helped you in preparing for the machine coding round. Please click the ❤ button below if you found the article helpful :)

More on Machine Coding Round:

Further Reading:

--

--

Kanhu Panda

Software Engineer by profession. I write about Tech & Tech interviews. My email: techwithkp06@gmail.com. My blog: https://techwithkp.com/.