Tech Interview Preparation Module 6 – Live coding and practical rounds
Choosing and preparing your interview language
Choose a language for coding rounds by fluency, safety and what the employer allows, then drill the standard-library tools rounds use, shown in 13 languages.
What you will learn
- Choose a language using your fluency, its safety and the employer's allowed list
- Use the standard-library tools rounds lean on: a comparator, a heap, a map and a deque
- Write correct code in a plain editor, without autocomplete
- Check the language version a platform runs before you rely on a new feature
Before you start
What you’ll learn · Before you start
What you will learn
- Choose a language using your fluency, its safety and the employer's allowed list
- Use the standard-library tools rounds lean on: a comparator, a heap, a map and a deque
- Write correct code in a plain editor, without autocomplete
- Check the language version a platform runs before you rely on a new feature
Before you start
On this page
Most employers let you choose the language of a coding round, and the choice is really made in the weeks of practice before it. Meta’s guide advises practising in the language you are most confident in, notes that scripting languages tend to be easier in interviews, and says to stick with a language you are comfortable with rather than learn a new one. Some rounds fix it: Amazon’s front-end assessment requires JavaScript, and TCS CodeVita Season 14 allows only C, C++, Java and Python.
Three tests settle the choice: fluency, safety and the allowed list. Preparing your interview language then takes the weeks before the round, until its standard library is reflex in a plain editor, on the version the platform runs.
Three tests choose the language: fluency, safety and the allowed list
Choosing comes down to three tests, applied in this order:
- Fluency: the language in which you have solved the most problems recently, quickly and without looking things up.
- Safety: how little the language punishes the slips a round makes likely, such as integer overflow or a missing heap.
- The allowed list: whether the round’s platform offers the language, and at which version.
The allowed list is usually long. Amazon’s SDE II assessment says you should be familiar with the syntax of a language such as C, C++, C++14, C#, Go, Java7, Java8, JavaScript, Kotlin, Objective-C, PyPy2, PyPy3, Python2, Python3, Ruby, Scala or Swift, and Atlassian’s coding interviews let you choose the language you work in. Choosing a language you would have to learn first fails the fluency test whatever its other merits. Answer three questions about your own round, and the table marks what fits:
Answer the questions above: the table then marks what fits your case and says why the rest does not.
| Choice | Fluency | Safety | Allowed list |
|---|---|---|---|
| Your strongest language | Good where you have solved the most problems recently, at speed | Mixed know its traps, such as integer overflow and any missing tools | Mixed check the invitation, and the version the platform runs |
| A scripting language you know | Mixed only as fluent as your practice in it | Good short code, and in Python no integer overflow | Good Python is on every list quoted in this lesson |
| The language the round requires | Mixed as fluent as the weeks you give it before the round | Mixed drill its traps, since you cannot avoid them | Good required, as JavaScript is in Amazon's front-end assessment |
| A language learned for the round | Poor weeks of practice are not enough for its library to become reflex | Poor its traps are the ones you have not met yet | Mixed only if the list has it, at the version you learned |
How the answers decide
- “Does the round require one language?” Yes, it names one: rules out Your strongest language, A scripting language you know and A language learned for the round. The round names one language, so that is the one to prepare, traps first.
- “Does the round require one language?” No, I may choose: rules out The language the round requires. Nothing is required, so choose by fluency first and safety second.
- “Where has most of your recent practice been?” Spread over several: adds a caveat to Your strongest language and A scripting language you know. Pick the one with the most recent problems and keep all practice in it from now on.
- “How long is it until the round?” A few weeks: rules out A language learned for the round. A language learned in a few weeks will not be fluent by the round; Meta's guide says to stick with one you are comfortable with.
For most candidates the answer is the strongest language, with its traps known. Preparing your interview language then means three things. The first is drilling the standard-library tools rounds use, from a sort with a comparator to a heap, until you write them without looking them up. The second is writing that code in a plain editor with no autocomplete, as Meta’s guide suggests for practice. The third is knowing the version the platform runs, since a new feature may be missing there.
Checkpoint
Check: Fluency, safety and the allowed list
The tools a round uses, in 13 languages Pro: opens with a Pro, Premium or Ultimate pass
In this part:
- Five traps that differ between languages
- A 20-item fluency drill
- Writing without autocomplete
- Check the version the platform runs
- Practise: your language, round-ready
- Interview questions
- Which language will you use for the coding rounds, and why that one?
- You are strongest in Python, and an assessment you take in three weeks requires JavaScript. How do you prepare in those three weeks?
- A problem needs the k largest values of a long stream, and your interview language has no heap in its standard library. What do you do in the round?
- You practised on the newest version of your language, and the assessment platform turns out to run an older one. How do you check what is safe to use, and what do you change?
- Key takeaways
1 runnable example · 3 interview answers · about 25 minutes
Opening this part with your pass…
This part opens with any MySmartCoPilot pass.
- Pro pass · 1 week₹79$2.99
- 30 days₹179$5.99
- 1 year₹1,699$45
One payment; a pass never renews. The price shown is the total you pay: no fees or charges are added at checkout.
Passes can’t be bought right now, so this part can’t be opened at the moment. The free part above stands on its own. If you have a pass, enter your licence key.
It also opens every other in-depth part in Learn and every Pro tool. Sales are final, except where the law gives you a right to withdraw, for example in the EU and the UK (refund policy).
Terms in this lesson
- comparator
- A function that decides the order of two items, usually returning a negative number, zero or a positive number. Sorts and heaps use one, with a tie-breaker for items that are otherwise equal.
- heap
- A tree kept in an array that always gives its smallest item, or its largest in a max-heap, at once, and adds or removes an item in O(log n) steps. Priority queues are usually built on one.
- standard library
- The library that comes with a language and its compiler or interpreter, usable without installing anything else.
References
- Software Engineer Full Loop Interview Guide (linked from the onsite preparation page) (Meta Careers)
- SDE II online assessment preparation: programming languages (Amazon.jobs)
- Front-end engineer interview prep (online assessment) (Amazon.jobs)
- TCS CodeVita: languages allowed this season (Tata Consultancy Services)
- Atlassian engineering interview handbook (Atlassian)
- heapq: heap queue algorithm (max-heap functions added in 3.14) (Python Software Foundation)
- Class PriorityQueue (Java SE 25) (Oracle)
- Interface List (Java SE 25): getFirst and getLast, since 21 (Oracle)
- std::priority_queue (cppreference.com)
- PriorityQueue<TElement,TPriority> class (Microsoft)
- Package container/heap (The Go Authors)
- Struct BinaryHeap (std::collections) (The Rust Project)
- What's new in Python 3.10 (structural pattern matching) (Python Software Foundation)
- What's new in Python 3.9 (str.removeprefix) (Python Software Foundation)
Related tools
Report a problem with this lesson
Kept only in this browser. Your Learn progress