Intervue.io | Release Notes

Rahool Benji
8 min readJul 6, 2020

--

Version 0.0.x, Historical record of releases done for intervue.io

Release 0.0.x | 4th July, 2020

Usage of intervue.io

Image customisation for Javascript

Running Node.js v10.20.1

Use HTML/CSS/JS for React, Angular, Vue.js, and other Javascript frameworks.

We provide a highly interactive REPL, which allows access to your runtime variables. If there were no errors, you will have a REPL with access to all of the global variables and functions defined in your script.

We run NodeJS with the --harmony flag on, which gives you access to many staged new features coming to the JavaScript spec. For a complete description of which modern JavaScript features are available, check out the Node compatibility table.Your code is also run for you in strict mode by default, which will enable features like const and let to work without configuration on your part.

We also have following npm packages available for your use:

Here’s a quick example of how to use sinon and chai:

var chai = require('chai')
var sinon = require('sinon')
var sinonChai = require('sinon-chai')
chai.should()
chai.use(sinonChai)
function hello(name, cb) {
cb('hello ' + name)
}
var cb = sinon.spy()
hello('world', cb)
cb.should.have.been.calledWith('this test should fail')

Example for mocha:

var Mocha = require('mocha')
var assert = require('assert')
var mocha = new Mocha()
mocha.suite.emit('pre-require', global, 'solution', mocha)describe('Test suite', function() {
it('should work', function() {
assert(true)
})
})
mocha.run()
  • async, request, and isomorphic-fetch for making async HTTP a little more convenient.
  • q and bluebird are promise libraries to help make managing async in general easier.
  • jsdom is a library for mimicking an HTML DOM within our JS environment. Useful if you want to test how candidates can manipulate elements without using our full HTML/CSS/JS environment.

Are there any libraries or settings we missed? Feel free to email us with suggestions!

Image customisation for Java

Running OpenJDK 14

Define a public class named Solution with a public static void main.

We have included few libraries which are available on the classpath. Simply import and use:

The google code project page has some useful examples.

Has a bunch of useful stuff like date parsing.

The import prefix is org.apache.commons.lang3, so you can perform imports by writing

import org.apache.commons.lang3.ArrayUtils.

  • JUnit, the gold standard for testing in Java. If you want to ask your candidate to write JUnit-style tests during the interview, please format your Java code like so:
import org.junit.*;
import org.junit.runner.*;
public class Solution {
@Test
public void testNoop() {
Assert.assertTrue(true);
}
public static void main(String[] args) {
JUnitCore.main("Solution");
}
}
  • jMock, a library to assist with mocking in Java. Combining jMock with the previous JUnit example:
import org.jmock.*;
import org.junit.*;
import org.junit.runner.*;
interface Receiver {
void receive(String message);
}
public class Solution {
@Test
public void testMock() {
Mockery context = new Mockery();
Receiver receiver = context.mock(Receiver.class);
context.checking(new Expectations() {{
oneOf (receiver).receive("hello");
}});
receiver.receive("hello");
context.assertIsSatisfied();
}
public static void main(String[] args) {
JUnitCore.main("Solution");
}
}

Are there any libraries or settings we missed? Feel free to email us with suggestions!

Image customisation for C++

Running GCC 8.2

We run your C++ code with GCC 8. You should define an int main() entrypoint. The gcc compiler is invoked with the following args:

g++ -Wall -fsanitize=address -std=c++17 -pthread \
-lboost_date_time -lboost_regex -lboost_system -lboost_thread -lboost_timer -lboost_filesystem \
-lssl -lcrypto

Which results in:

  • Use the C++17 standard
  • Link the pthread library
  • Link a few static boost libraries

We also provide a few libraries:

  • Boost is provided, with most of its header-only libraries working straight out of the box. We provide DateTime, Regex, System, Thread, and Timer.
  • Eigen, a library for linear algebra. We provide all of the Eigen modules and header files to the environment. Just include the header that you want and instantiate an object:
#include <iostream>
#include <Eigen/Dense>
using Eigen::MatrixXd; int main()
{
MatrixXd m(2,2);
m(0,0) = 3;
m(1,0) = 2.5;
m(0,1) = -1;
m(1,1) = m(1,0) + m(0,1);
std::cout << m << std::endl;
}

Are there any libraries or settings we missed? Feel free to email us with suggestions!

Image customisation for Python2

Running Python 2.7

The Python environment is augmented with a few REPL features as well as some helpful libraries.

The REPL uses IPython to provide a REPL with history, highlighting, and autocomplete. Additionally, whenever you run scripts in Intervue’s editor, the REPL will deposit you at the exact line and state of any exceptions. If there were no errors, you will have a REPL with access to all of the variables and functions defined in your script.

The libraries included and ready for importing are:

Testing

We’ve got a few ways you can test your Python code:

The excellent unittest library that ships with Python by default. Here’s a quick example:

import unittest

class TestStringMethods(unittest.TestCase):
def test_upper(self):
self.assertEqual('foo'.upper(), 'FOO')

def test_isupper(self):
self.assertTrue('FOO'.isupper())
self.assertFalse('Foo'.isupper())

def test_split(self):
s = 'hello world'
self.assertEqual(s.split(), ['hello', 'world'])
# s.split should throw when the separator is not a string
with self.assertRaises(TypeError):
s.split(2)

unittest.main(exit=False)

The versatile pytest. The above snippet of code would look like the following when written for pytest:

import pytest

def test_upper():
assert 'foo'.upper() == 'FOO'

def test_isupper():
assert 'FOO'.isupper()
assert not 'Foo'.isupper()

def test_split():
s = 'hello world'
assert s.split() == ['hello', 'world']
# s.split should throw when the separator is not a string
with pytest.raises(TypeError):
s.split(2)

pytest.main()

mock is also available if you need to stub out some behavior. Here’s a quick usage example:

from mock import Mock

mock = Mock()
mock.method(1, 2, 3)
mock.method.assert_called_with('this should break')

mock can of course be combined with unittest and pytest for even more fun.

hypothesis is available for property-based testing in Python. You can read more about it on their website, but here’s a stubbed example of how you might test that an encoding and decoding function both work:

from hypothesis import given
from hypothesis.strategies import text

def encode(string):
# return encoded string

def decode(string):
# return decoded string

@given(text())
def test_decode_inverts_encode(s):
assert decode(encode(s)) == s

test_decode_inverts_encode()

Calling test_decode_inverts_encode() fires up Hypothesis and tries to find an input that breaks your code.

Are there any libraries or settings we missed? Feel free to email us with suggestions!

Image customisation for Python3

Running Python 3.6.9

The Python environment is augmented with a few REPL features as well as some helpful libraries.

The REPL uses IPython to provide a REPL with history, highlighting, and autocomplete. Additionally, whenever you run scripts in Intervue’s editor, the REPL will deposit you at the exact line and state of any exceptions. If there were no errors, you will have a REPL with access to all of the variables and functions defined in your script.

The libraries included and ready for importing are:

Testing

We’ve got a few ways you can test your Python code:

The excellent unittest library that ships with Python by default. Here’s a quick example:

import unittestclass TestStringMethods(unittest.TestCase):
def test_upper(self):
self.assertEqual('foo'.upper(), 'FOO')
def test_isupper(self):
self.assertTrue('FOO'.isupper())
self.assertFalse('Foo'.isupper())
def test_split(self):
s = 'hello world'
self.assertEqual(s.split(), ['hello', 'world'])
# s.split should throw when the separator is not a string
with self.assertRaises(TypeError):
s.split(2)
unittest.main(exit=False)

The versatile pytest. The above snippet of code would look like the following when written for pytest:

import pytestdef test_upper():
assert 'foo'.upper() == 'FOO'
def test_isupper():
assert 'FOO'.isupper()
assert not 'Foo'.isupper()
def test_split():
s = 'hello world'
assert s.split() == ['hello', 'world']
# s.split should throw when the separator is not a string
with pytest.raises(TypeError):
s.split(2)
pytest.main()

mock is also available if you need to stub out some behavior. Here’s a quick usage example:

from mock import Mockmock = Mock()
mock.method(1, 2, 3)
mock.method.assert_called_with('this should break')

mock can of course be combined with unittest and pytest for even more fun.

hypothesis is available for property-based testing in Python. You can read more about it on their website, but here’s a stubbed example of how you might test that an encoding and decoding function both work:

from hypothesis import given
from hypothesis.strategies import text
def encode(string):
# return encoded string
def decode(string):
# return decoded string
@given(text())
def test_decode_inverts_encode(s):
assert decode(encode(s)) == s
test_decode_inverts_encode()

Calling test_decode_inverts_encode() fires up Hypothesis and tries to find an input that breaks your code.

Are there any libraries or settings we missed? Feel free to email us with suggestions!

Mysql support

Running MySQL Server 8.0

MySQL mode spins up a MySQL server with a default database with some sample data in it. The schema of the default database looks like:

Intervue provides a basic Sql sandbox with the following schema.candidate                             task
+---------------+---------+ +---------------+---------+
| id | int |<----+ +->| id | int |
| first_name | varchar | | | | title | varchar |
| last_name | varchar | | | | complexity | varchar |
| current_org | varchar | | | +---------------+---------+
| language_id | int |--+ | |
+---------------+---------+ | | |
| | |
language | | | candidate_tasks
+---------------+---------+ | | | +---------------+------------+
| id | int |<-+ | +--| task_id | int |
| name | varchar | +-----| candidate_id | int |
+---------------+---------+ | start_time | timestamptz|
| end_time | timestamptz|
+---------------+------------+

The database is reset when the “Reset” button is clicked, or the pad switches to another language.

Are there any libraries or settings we missed? Feel free to email us with suggestions!

Haskell support

Running GHC 8.6

Your code is run with runghc solution.hs. Your code runs in interpreted mode, so you don’t need a special entrypoint or anything.

Server side rendering of scratchpad to enhance performance

The scratchpad where interviews are taken is the core of intervue.io.

The performance has been improved to ensure better UX for the end user.

The page for scratchpad is now rendered from the server which improves perceived performance of the page.

Sample of creating a pad using intevue.io for interviews

Enhanced language description in the info panel of language

Getting started guide for candidates before an interview

If you are a candidate who has an interview scheduled on intervue.io, don’t worry, we have you covered.

The above link will take you through a summarized tutorial of the tool which will enable you to be comfortable during interviews.

The same will come as a part of invitation emails as well which have been automated in this release.

Copy invitation details to invite manually

Once you click on Invite at the bottom left of the pad, click copy invitation details. Content given below will be copied. You can share it with the person you want to invite by pasting it in any medium of your choice like email, hangouts chat, whatsapp, telegram etc.

Intervue meeting invite!!

<Your Name> is inviting you to a scheduled Intervue meeting.

Topic: <Pad Name>

Join Intervue meeting

https://www.intervue.io/<PAD_UNIQUE_ID>

Interview Team

Authentication support on server side

Moving authentication to the server side enabled us to load the logged in/guest state of the user directly from the server.

This enabled us to:

  • Improve perceived performance of the Webpage
  • Reduce some API calls from the client

Bug fixes

Following bugs have been fixed in this release:

  • Scratch pad and sandbox had a white flicker which has been fixed
  • HTML/CSS/JS had a bug with Question Bank tab in scratch pad which has been fixed
  • Stop code works properly in HTML/CSS/JS sandbox now

More stable infra

Infra supports auto-scalability now in:

  • UI
  • Backend
  • Socket
  • Redis and postgres are backed-up regularly to ensure data integrity

--

--