• Trusted by:

Hire C++ developers and engineers

Sasa Mrvos, Croatia

Member since August 15, 2013
Sasa is a top Architect/Developer/Entrepreneur with a background in desktop, embedded systems, and industrial solutions. He is versatile in C++ and other coding languages, and has extensive experience with algorithms, communication protocols, networking, signal processing, compression, parsers, and machine vision. Click to continue

Patrick Ryder, United States

Member since October 9, 2012
Pat has over a dozen years of experience developing applications on the .NET platform, including having been part of the development team at Microsoft which created the platform itself. He also develops for Windows native API (Win32/COM), he communicates extremely well, and he has worked in teams of all sizes. Click to continue

Sam Varshavchik, United States

Member since September 16, 2012
Sam is a senior freelance developer and architect with over 20 years of experience developing in the financial industry. Click to continue

Ken Whaley, Russia

Member since September 6, 2012
Ken is a top architect, engineer, and developer with over 30 years of experience in the field. He has a proven ability to understand, optimize, enhance, and create from scratch significant software tools and workflows with large user bases that greatly magnify productivity for large groups of engineers. Ken is eager to take on new challenges and has done so with teams of all sizes and compositions. Click to continue

Victor Tyutyunov, Ukraine

Member since February 2, 2014
Victor is a successful lead engineer with extensive experience in the development of high-loaded distributed systems, data processing, and data analysis. Click to continue

Gustav Stieger, Australia

Member since June 7, 2013
Gustav is a top engineer and programmer with 20 years of experience with all levels of software and architecture. A creative abstract and theoretical thinker with the ability to turn ideas into re-usable modules and solutions, Gustav has worked at all levels of participation, from contractor to technical lead. Click to continue

Richard Rozsa, Netherlands

Member since June 12, 2013
Richard Rozsa offers a vision of data as a self formatting entity. For more than 30 years, he's delivered top quality technical architecture, programming, testing and solutions for complex problems--on-time and within budget. He's extremely flexible and able to integrate as a standalone freelancer or within teams. Click to continue

Scott Ferrett, Germany

Member since December 6, 2013
Scott is a freelance architect and lead developer with extensive experience in C++, C#, and SQL. He has contributed to the ANSI standards for both C++ and SQL. He excels with problems that are best solved with multiple cooperative processes. Click to continue

Dmitrii Polutov, Australia

Member since May 30, 2013
Dmitrii is a Software Engineer with a strong background in the development, design, and maintenance of new and existing software. He has extensive experience programming across multiple platforms, writing C and C++ code for over two decades. Click to continue

Antonio Bello, Poland

Member since April 8, 2013
Antonio is an experienced, self-motivated, results-driven, flexible freelance professional who specializes in turning business ideas into software solutions. He covers the entire software development life cycle, from concept to final product, using the best technologies. Click to continue
Trustpilot
Toptal on TV
"Toptal is killing it, it kind of owns this market."
Andrew Ross Sorkin Reviews Toptal
Cnbc 02e66b
"Tech companies simply cannot find the quality employees they want to hire. The solution: Toptal."
Liz Claman´s Review of Toptal
Fox 7ef901
Toptal in the press
“Despite accelerating demand for coders, Toptal prides itself on almost Ivy League-level vetting.”
Selina Wang
“Toptal allows corporations to quickly assemble teams that have the right skills for specific projects.”
Steven Norton
A hiring guide
The Vital Guide To C++ Developer Interviewing

C++ is a powerful general purpose multi-paradigm programming language. The language's immense set of features, its overall complexity, lack of elegant external tooling that other popular languages have, and access to low-level resources makes this one of the most difficult programming languages to master. Taming this mammoth beast requires much experience and wisdom.

Testimonials
“We're a small firm with big dreams. After trying 4 or 5 local or outsourced developers, we were out of options. I'd heard of Toptal, but was worried that my company wasn't big enough for them. After calling them up, I found out that I didn't need to meet any minimum budget and was immediately put in touch with a developer to talk through my problems and goals. A day later, he got back to me with a list of possible solutions. After 9 months and 5 developers, Toptal got me my solution in a single week at a price I could afford.”
Kevin Ramirez
Co-Founder @ SixtyVocab.com
“Getting set up with Toptal and finding a new team member was so easy, I don't know why anyone wouldn't give it a try. Best of all, we no longer have to worry about finding great people to help with our projects!”
Mike Branch
President & CTO @ HarborSI
“Toptal helped us when we had a hiring gap we needed to fill. The developer we received was excellent, with a great work ethic and fit in very well with the team. We are very happy with the service and would definitely consider using Toptal again in future should we need additional help. ”
David Gildeh
CEO @ Dataloop.io
“We needed a talented developer and we needed him/her very quickly. So we turned to Toptal and couldn't be happier with the results! Our Toptal freelancer has contributed extraordinary knowledge, talent, and startup experience to our team. We will continue to work with Toptal to fulfill our future talent needs.”
Lindsay Fairman
Founder & Owner @ FairTech Labs, LLC
“Toptal’s ability to rapidly match our project with the best developers was just superb! The developers have become part of our team, and I’m amazed of the level of professional commitments each one of them have demonstrated. For those looking to work remotely with the best engineers, look no further. Thank you, Toptal.”
laurent Alis
Founder @ Livepress
“Marcos was a wonderful engineer and really helped us out on this project. Without him I feel like we really would have been at a loss.”
Jama Mohamed
Owner @ JM Technologies
“Chris Wood is an absolutely exceptional Python developer, and the single most efficient programmer I've ever worked with. From the beginning of the project, Chris was instantly a vital member of the team. He's proactive, self-managed, knowledgeable, and efficient. I point him in a direction, and he delivers. Chris will be a part of the Crisis Cleanup team as long as I have anything to say about it.”
Aaron Titus
Project Manager @ Crisis Cleanup
“Robert was such a breath of fresh air! I’m used to working with developers who don’t speak good English, don’t understand my needs, and are bad communicators in general. But Robert was not only an EXCELLENT communicator, he knew exactly what I was looking for and made it better than I thought possible. Now I have a website that works better than I thought it could for less than the cost it would have taken other developers, and in half the time. Robert is as good as they come, and a true professional. Anyone thinking of working with him, stop thinking about it and hire him. You won’t regret it.”
Matthew Bennett
CEO @ Winning Social
“In Higgle's early days, we needed best-in-class developers, at affordable rates, in a timely fashion. Toptal delivered! Higgle enjoyed working with Toptal and we appreciate their professionalism.”
Lara Aldag
CEO @ Higgle
“We have been incredibly happy with our Toptal experience. Initially a skeptic, the process to find and recruit a fabulous iOS developer was very easy. Rather than sifting through hundreds of CVs, we saw two and hired them. They have worked effectively, getting up to speed incredibly quickly and have almost become part of the team. We would definitely use Toptal again. ”
James O'Day
Co-Founder @ Pearlshare
“Finding a good developer who specialised in the technologies we use seemed like an impossible task... until we used Toptal. We had several trial periods and have just accepted our first developer to join the team! The whole process went seamlessly and without any surprises or hidden costs. We are very happy and will continue to work together!”
Artem Tolmachev
CEO @ eKids.nl
“I'm incredibly impressed with the caliber of the Toptal developers I have worked with - they have proven themselves to be both dedicated and highly talented. We will most definitely continue to work with Toptal. ”
Savannah de Savary
Founder @ Industry Hub
“I'm incredibly impressed with Toptal. What I'm experiencing is something so different from what I'm used to. Our developer is communicating with me constantly every day, and he is a very powerful coder. His work is just excellent, and he is a true professional. I'm really pleased so far. 5 stars for Toptal.”
Pietro Casoar
CEO @ Ronin Play Pty Ltd
“While looking for a high-level Python/Django developer, I found Toptal via a simple Google search, and that was a stroke of luck for our company. We needed a expert engineer who could start on our project immediately as we had a tight deadline. We were introduced to Simanas and immediately knew he was a great choice who had already been vetted... and he exceeded our expectations with his work. Not having to interview and chase down an expert developer was an excellent time-saver and made everyone feel more comfortable with our choice to switch platforms to utilize a more robust language. Toptal made the process easy and convenient, and we are extremely happy with the results. Toptal is now the first place we look for expert-level help.”
Derek Minor
Senior VP of Web Development @ NetWorldMediaGroup
Hire a top C++ developer now.
Toptal is a marketplace for top C++ developers, engineers, programmers, coders, architects, and consultants. Top companies and start-ups choose Toptal freelancers for their mission critical software projects.
Full
profile
Sasa MrvosCroatia
Sasa is a top Architect/Developer/Entrepreneur with a background in desktop, embedded systems, and industrial solutions. He is versatile in C++ and other coding languages, and has extensive experience with algorithms, communication protocols, networking, signal processing, compression, parsers, and machine vision.
[click to continue…]
C++CVisual StudioWindows
Hire
Full
profile
Patrick RyderUnited States
Pat has over a dozen years of experience developing applications on the .NET platform, including having been part of the development team at Microsoft which created the platform itself. He also develops for Windows native API (Win32/COM), he communicates extremely well, and he has worked in teams of all sizes.
[click to continue…]
C++T-SQLC#.NETASP.NET MVCASP.NETMicrosoft Visual StudioWindows ServerWindowsSQL Server
Hire
Full
profile
Sam VarshavchikUnited States
Sam is a senior freelance developer and architect with over 20 years of experience developing in the financial industry.
[click to continue…]
C++SQLPerljQueryMySQL
Hire
Full
profile
Ken WhaleyRussia
Ken is a top architect, engineer, and developer with over 30 years of experience in the field. He has a proven ability to understand, optimize, enhance, and create from scratch significant software tools and workflows with large user bases that greatly magnify productivity for large groups of engineers. Ken is eager to take on new challenges and has done so with teams of all sizes and compositions.
[click to continue…]
C++JavaScriptCPHPPerlObjective-CPythonHTML5Apple XcodeMS Visual Studio
Hire
Full
profile
Victor TyutyunovUkraine
Victor is a successful lead engineer with extensive experience in the development of high-loaded distributed systems, data processing, and data analysis.
[click to continue…]
C++JavaScriptNode.jsPostgreSQLMySQLBack-end Development
Hire
Full
profile
Gustav StiegerAustralia
Gustav is a top engineer and programmer with 20 years of experience with all levels of software and architecture. A creative abstract and theoretical thinker with the ability to turn ideas into re-usable modules and solutions, Gustav has worked at all levels of participation, from contractor to technical lead.
[click to continue…]
C++SQLVB.NETC#JavaScriptMicrosoft Visual StudioMicrosoft SQL Server Management StudioWindowsMicrosoft SQL Server
Hire
Full
profile
Richard RozsaNetherlands
Richard Rozsa offers a vision of data as a self formatting entity. For more than 30 years, he's delivered top quality technical architecture, programming, testing and solutions for complex problems--on-time and within budget. He's extremely flexible and able to integrate as a standalone freelancer or within teams.
[click to continue…]
C++C#CSQLASP.NETASP.NET MVC.NETjQueryMS Visual StudioVisual Studio 2008SQL Server Management StudioMicrosoft Visual C++Visual Studio
Hire
Full
profile
Scott FerrettGermany
Scott is a freelance architect and lead developer with extensive experience in C++, C#, and SQL. He has contributed to the ANSI standards for both C++ and SQL. He excels with problems that are best solved with multiple cooperative processes.
[click to continue…]
C++C#C/C++Agile Software DevelopmentWindowsAPI Design
Hire
Full
profile
Dmitrii PolutovAustralia
Dmitrii is a Software Engineer with a strong background in the development, design, and maintenance of new and existing software. He has extensive experience programming across multiple platforms, writing C and C++ code for over two decades.
[click to continue…]
C++CCocoaXcodeiOSMac OS XMySQLUI Kit
Hire
Full
profile
Antonio BelloPoland
Antonio is an experienced, self-motivated, results-driven, flexible freelance professional who specializes in turning business ideas into software solutions. He covers the entire software development life cycle, from concept to final product, using the best technologies.
[click to continue…]
C++Objective-CSQLSwiftC#JavaC/C++JavaScriptASP.NET.NETiOS SDKNode.jsGit
Hire

The Vital Guide To C++ Developer Interviewing

C++ is a powerful general purpose multi-paradigm programming language. It powers some of the most performance intensive applications, and serves well to satisfy some particular niches, including but not limited to desktop applications, embedded applications, device drivers, game engines, and more. The language’s immense set of features, its overall complexity, lack of elegant external tooling that other popular languages have, and access to low-level resources makes this one of the most difficult programming languages to master. Taming this mammoth beast requires much experience and wisdom.

Harnessing the power of C++ requires nothing short of experience and wisdom

Harnessing the power of C++ requires nothing short of experience and wisdom

This hiring guide will help you identify C++ developers who not only know the basics, but also understand its relevant concepts in-depth and know their way around the various challenges and pitfalls of this powerful programming language.

Basics

Questions like the following are meant to figure out how familiar the candidate is with C++, and to see if they know all the quirks and nuances of the language.

Q: Consider the following snippet of code:

string ext = "";
switch(ext) {
case "cpp":
case "cc":
        cout << "C++ source file" << endl;
case "java":
        cout << "Java source file" << endl;
default;
        cout << "Unknown extension" << endl;
}

Explain what, if anything, is wrong with it? How can you improve this code or work around any issue in it?

The switch statement, in C++, only accepts types that are integral, enumerated or class which has a single conversion function to an integral or enumerated type. std::string in C++ is not a primitive type.

In C/C++, switch statements are typically implemented as branch tables. Generating them for integers, integer-like or enumerated types is easy, which is not the case for strings.

One way to work around this limitation, in this particular case, is by using a map:

map<string, string> m;
m["cpp"] = "C++ source file";
m["cc"] = m["cpp"];
m["java"] = "Java source file";

string ext = "cc";
string r = m[ext];
if(r != "") {
	cout << r << endl;
} else {
	cout << "Unknown extension" << endl;
}

In case ext is expected to hold unknown values, you might want to use m.find(ext) != m.end() to determine if the key actually exists first. This is because the [] operator will automatically increase the container’s size everytime a non-existence key is used.

Q: How do you implement a variadic function in C++?

Functions that can accept a variable number of arguments can be declared using an ellipsis as its last parameter:

int int_sum(int n, ...)

For example, the following function will accept an argument, n, followed by any number of additional arguments.

int int_sum(int n, ...) {
	va_list args;
	va_start(args, n);
	int r = 0;
	while(n--) {
		int x = va_arg(args, int);
		r += x;
	}
	va_end(args);
	return r;
}

However, starting C++11, Variadic templates can be used to achieve similar results, as they are type safe and do not perform automatic type conversions.

Q: What are the different ways of passing parameters in a function call? Explain how they are different.

  • Pass by value: this causes the parameter’s value to be copied. Typically used for primitive types where the overhead of copying the value is minimal. In newer standards, such as C++11, with move semantics even complex objects may be efficiently passed by value.

  • Pass by reference: this causes the parameter inside the function to alias the variable passed when the function is called. Parameters can also be passed by const reference. This is very similar to what pass by value does, except the underlying object is not copied.

Additionally, pass by pointer can be considered another way of passing parameters. Although not the most recommended way of passing parameters, this works by passing the memory location of a variable by value, allowing the function to access the original variable’s contents, as if by reference. Typically used when it is important to pass NULL as the parameter. However, recommended ways of dealing with optional parameters involve the use of external libraries.

Q: What is the expected output for the following snippet of code:

int a[2];
int *x = &a[0];
*x = 2;
*(++x) = 4;
cout << a[0] << endl;
cout << a[1] << endl;

Explain.

The expected output of this program is:

2
4

This is because:

  • We start by declaring an array of 2 ints.
  • We are then taking a pointer to the first element in x.
  • Next, we are updating the value pointed at by x to 2.
  • Finally, we are Incrementing the pointer to move to the 2nd element and updating the value pointed at by x now to 4.

Q: How are exceptions handled in C++?

In C++, exceptions are handled using try-catch blocks:

try {
	// Something that may throw an exception
} catch(int ex) {
}

Exceptions are thrown using a throw statement:

throw 42;

Here, 42 is the parameter which will be passed to the handler as the only argument. Within a catch block, this parameter can be omitted to rethrow the current exception.

In a try-catch block, multiple exception handlers can be specified using multiple catch blocks. The type specified for the catch block will determine if it will be used to handle a particular exception.

And, Beyond

Even though C++ is closer to the metal than most other popular programming languages, there is still a lot going on under the hood. A great C++ developers is very likely to have gained this knowledge, sometimes out of sheer curiosity and sometimes the hard way.

Q: In the following snippet of code:

int *arr1 = new int[10];
int arr2[10];
// ...
delete[] arr1;

Why is the delete[] statement necessary for variable arr1, but not for arr2? How can this be re-written using smart pointers?

Memory allocated dynamically using new or new[] must be deallocated to reclaim the used memory. This is because C++ doesn’t have a garbage collector to deallocate those resources automatically. The delete[] operator works on an array of objects that destroys each element before marking the memory as reusable on the heap.

The declaration line for arr1 could be replaced with the following:

unique_ptr<int[]> arr1(new int[10]);

This will automatically destroy and deallocate the array as soon as the smart pointer object goes out of scope.

Q: What is stack unwinding? What are its implications on object storage?

Stack unwinding happens when an exception is thrown. This is when function entries are removed from the stack up until an exception handler is found. In C++, stack unwinding will also cause stack variables to be destroyed automatically.

However, depending on how and when memory was allocated, stack winding may cause memory leaks. For example:

void leaky(bool panic) {
	SomeClass *scp = new SomeClass();
	if(panic) {
		throw 42;
	}
	delete scp;
}

Here, if panic is true, an exception will be thrown causing the program to never reach the delete statement and thus preventing the SomeClass instance to be deallocated from the heap.

Q: What is a function-try-block? What are these ideally used for?

A function-try-block allows you to attach a sequence of exception handlers after the function body that effectively treats the entire function body as a try block. This way, any exception that occurs with the function body may be handled by one of the catch blocks following it.

Ideally this syntax is used to log exceptions rather than handling them. Sometimes these are also used to modify the exception and rethrow them.

Q: What are templates? In terms of function declarations, how is this different from function overloading?

Templates are what allow C++ to define a group of classes, functions, types or variables in a parameterized manner. For example, the following definition of a function template:

template<typename T>
T add(T a, T b) {
	return a+b;
}

… will allow a developer to use the function add with any type that supports the + operator.

add(5, 1); // will use int add(int, int)
add(‘e’, ‘t’); // will use char add(char, char)

Templates allow classes, functions, etc. to be declared in a type “independent” way as long as the behavior remains the same. The compiler automatically generates the necessary code for every instance of the templated function or class used.

Templates are also not limited to types. They can also be used with expressions of a particular type. For example:

template<typename T, int a>
T add(T b) {
	return a+b;
}
add<int, 5>(1)

When it comes to functions, unlike function templates, function overloading requires you to explicitly define the behavior of each instance of the function.

Q: What are special member functions in C++? Briefly explain their use and state their defaults when not explicitly defined.

The default constructor, destructor, copy constructor and copy assignment (along with move constructor and assignment as introduced in C++11) are the special member functions in C++.

The default constructor is called when objects of a class are instantiated without passing any arguments. When no constructors are defined for a class, the default constructor is automatically defined as a function that is no-op.

The destructor, meant to serve as the opposite of constructors, allows an object to clean after itself before it is deallocated from memory. When not defined, similar to the default constructor, a no-op function is automatically declared on the class.

The copy constructor is essentially a constructor that accepts an argument of its own type by const reference. This constructor is meant to create a clone of the object being passed. When not defined, a default that copies all the members of the object is defined if and only if no move constructor or assignment function is defined.

The copy assignment function is called when an object is being assigned to another variable of the same type that is already initialized. Automatic default declaration follows the same rule as copy constructor as stated above.

Move constructor and assignment functions are similar to copy constructor and assignment functions, except that these are called when the values of the source object are no longer necessary and may be taken over by the destination object. The default behavior moves all members, but is automatically declared only when no copy constructor, assignment function, or move assignment function is declared.

Q: Does C++ allow multiple inheritance? What are some pitfalls of multiple inheritance and how can you work around them in C++?

C++ allows multiple inheritance. A class can extend one or more classes by providing a comma-separated list of their names:

class SomeClass: public ParentClass1, public ParentClass2 {
	// …
};

One of the pitfalls of multiple inheritance is ambiguity. For example, both ParentClass1 and ParentClass2 in the example above may have methods declared with the exact same signature. Attempting to call these inherited methods on SomeClass will cause the compiler to complain about this ambiguity - exactly which inherited method should be called? This issue can be worked around with explicit qualification:

SomeClass *sc = new SomeClass;
sc->ParentClass1::parentMethod();
sc->ParentClass2::parentMethod();

Another with multiple inheritance is the diamond problem. Let us assume that both ParentClass1 and ParentClass2 were derived from the same class:

class ParentClass1: public RootClass { /* … */ };
class ParentClass2: public RootClass { /* … */ };

… and if the RootClass had some public method named rootMethod, then calling that method would automatically result in ambiguity. This is because both ParentClass1 and ParentClass2 has inherited these methods, and to SomeClass this is ambiguous. One possible way of working around this issue is to use virtual inheritance:

class ParentClass1: public virtual RootClass { /* … */ };
class ParentClass2: public virtual RootClass { /* … */ };

Wrap up

The questions outlined in this guide cover some basic and some tricky aspects of C++. But just like its possibilities, the language’s hidden surprises are limitless, and that makes it difficult to cover everything about C++ in interviews. Therefore it is essential to evaluate a candidate’s competency and deep understanding of C++ through their ability to convey their ideas clearly and vividly.

We hope these questions will help you as a guide in your search for a true C++ expert. These rare elites may be hard to come by, but they will clearly stand out from the rest of the pack.

Hire C++ developers now
Alvaro 1506e7

My team is going to personally help you find the best candidate to join your team.

Alvaro Oliveira
VP of Talent Operations