Coding Round - Interviewer's RuleBook
Coding Round - Interviewer's RuleBook
🙂
PROBLEM UNTIL YOU SEE WORKING IDE OR CANDIDATE CONFIRMS TO USE
ONLINE JAVA TOOL.
6. When a problem is shared in a written form over chat, there are good chances that the
candidate will post the same on different websites while sharing his interview
experience. It is always good to give requirements verbally. It also helps to judge how
many requirements a candidate captures in the first go and whether they ask or repeat
the requirements again to get confirmation from the interview panel. If something is
missed by the candidate, please repeat that specific requirement part again. - As
discussed during discussion, POCs have decided to share problems over chat.
7. There are cases where a recruiter schedules a coding round for a candidate, in this case
the recruiter should inform this to the interviewer. Interviewer can also check with the
candidate during the interview whether it is their first coding round or second. Ask the
candidate if this is his first round or not. Many times its possible this may be this second
round and already attempted this question in that case choose to start with Optional
Question Extension & more coding questions from Infohub.
8. In the case of the REDO coding round, the interviewer must ask a different problem.
9. Interviewer should capture or ask the candidate to share the code and output once the
interview is complete. As this is must to include in the feedback form.
Write a function, add, which adds two large numbers together and returns their sum:
// Returns sum of two numbers
String add(String a, String b)
Do not share in chat anything below this with the Candidate, This is for the interviewer's
reference only.
// Basic Test
assertAdd("1", "5", "6");
assertAdd("301", "5", "306");
// Carryover test
assertAdd("7", "8", "15");
assertAdd("144", "89", "233");
assertAdd("1", "999", "1000");
Extend your solution to allow commas for readability in the input and add commas in the output
as appropriate (ex: 33,560). Large numbers should include separators every 3 digits for
readability
● Large numbers should include separators every 3 digits for readability, ( comma ‘,’ is
preferred)
Share below information with candidate only if they ask for specific additional information or related
queries
● Previous test cases with output > 999 are allowed to fail due to missing commas
● Formatting should be for a US audience (ex: 1,000,000); European number formatting (ex:
1.000.000) need not be supported
Do not share anything below this with the Candidate, This is for the interviewer's
reference only.
- Ask the approach candidate starts with, Ask him to think out or say out loud what
approach / logic he will use to solve the problem.
- If candidate is not able to think loud on each steps then once the problem is solved ask
on each steps implementation and purpose of it
- You can give a few hints and help candidates but not for all steps only if they are stuck
and do share it in your feedback on area’s he improved / solved after your hint.
- You can give candidate 10-15 mins extension if you feel he is on right track and only Unit
Test cases are pending
- If a candidate is not able to write a unit test case for Problem 1, he/she does not quality
further
- If a candidate is not able to solve Part 1 of problem then he/she does not quality further
- If a candidate is able to solve Part 1 but not able to solve Part 2 then recommend level is
L1 for candidate
- If a candidate is able to solve both Part 1 & Part 2 then use of the below table will help
you determine the level.
Candidates addressing certain cases without prompting or exhibiting certain behaviors can be an
indicator of experience and level.
● L1
○ Iterates over numbers from right-to-left
○ Converts string to number (and vice-versa) on a digit-by-digit basis
○ Accounts for the carry between digits
● L2
○ Understands that large input numbers will exceed max-int and will negate the use
of wholesale conversion between String and Int
○ Accounts for inputs of different length
● L3
○ Accounts for the final carry after loop iteration
- Candidate’s that are able to complete Problem 1 & 2 below table will help you to
recommend final feedback.
Candidates addressing certain cases without prompting or exhibiting certain behaviors can be an
indicator of experience and level.
● L1
○ Removes commas from input and adds commas to output appropriately for basic
comma test case
● L2
○ Understands that the original large number test will now fail without commas
○ Adds comma for final carry test case
○ Omits leading comma for 3/6/9... digit results
● L3
○ Separates the parsing and formatting of commas from core calculation logic
When To Use What level of candidate is this appropriate for? Should this section be
used to validate specific competencies?
Problem Statement In technical terms, describe exactly what the candidate should produce.
This section may include a method signature for coding problems.
● Use the function you wrote to compute the nth number of the
Fibonacci series: 1, 1, 2, 3, 5, 8, 13, 21, 34, 55…
● Implement two functions:
fibonacci(n) = fibonacci(n-1) +
fibonacci(n-2)
Test Cases
assertFibonacci(1, "1");
assertFibonacci(3, "2");
assertFibonacci(31, "1,346,269");
// Performance Test
assertFibonacci(100,
"354,224,848,179,261,915,075");
Expectations by Level Candidates addressing certain cases without prompting or exhibiting
certain behaviors can be an indicator of experience and level.
● L3
○ Anyone who completes this in addition to the required
extensions in a ~35 minute coding block should be
recognized as a blazing fast coder
○ Solution has algorithmic complexity of O(n) (naive
recursive approach will timeout around n=45)
● L4 TT
○ When prompted, can name the algorithmic complexity
of O(2^n) for the naive recursive implementation
FAQs
1. Can I ask java questions?
Ask 2-3 java related questions before sharing the coding problem.
● If a candidate mentions more than one java version in his experience. Ask about
the new features in the latest version mentioned.
● If a candidate has experience in java8 only, ask questions on heap memory
change and how Strings & Objects are stored in memory.
● How much time do they spend on coding on a daily basis? 60% or 80% or so.
2. Candidate looks familiar with an add two large number problem and wrote correct
code within 15 min.
It is common that candidates are already familiar with the DSA problems. Consider
below points to judge a candidate:
● Did the candidate explain his approach when asked before coding?
● Is code written in a clean manner or easily readable?
● Did candidate make right choices to use data type to solve this problem:
Example: to build String output which is continuously changing in a for loop, it is
good to use StringBuilder. String is the last choice. StringBuffer is the second
choice. If a candidate did not use StringBuilder, drop a hint if they can use any
other class which is a better option to build output. If not, then directly ask the
difference between String, StringBuilder and StringBuffer.
● Ask all the extensions of the problem.
● Ask the Time Complexity of each problem. Mention that in the feedback form.
● Once they are done with all extensions within 45-50 min, the panel should ask
candidates to make that code production ready. No hints should be given here.
Let’s purely judge on what candidates think of prod ready code.
● Give more weightage to other traits like Thinking out loud, requirement gathering,
communication, potential resume, attitude.
3. Candidate needed many hints during the interview but was able to code problems.
Should I select a candidate for the next round?
● It is okay to give hints but the number of hints should be 2-3 only. More hints
implies the candidate does not have critical thinking traits and needs assistance
from time to time.
● It is alway good to mention what hints you provided to candidates in the feedback
form.