View on GitHub

hackerrank

HackerRank personal solutions

C++

A general-purpose programming language with imperative, object-oriented and generic programming features.

Introduction

Name Preview Code Difficulty
Say “Hello, World!” With C++ Practice printing to stdout. C++ Easy
Input and Output Learn to take in the input and print the output. Take three number as input and print their sum as output. C++ Easy
Basic Data Types Learn about the basic data types in C++. Take the given input and print them. C++ Easy
Conditional Statements Practice using chained conditional statements. C++ Easy
For Loop Learn how to use for loop and print the output as per the given conditions C++ Easy
Functions Learn how to write functions in C++. Create a function to find the maximum of the four numbers. C++ Easy
Pointer Learn how to declare pointers and use them. C++ Easy
Arrays Introduction How to access and use arrays. Print the array in the reverse order. C++ Easy
Variable Sized Arrays Find the element described in the query for integer sequences. C++ Easy

Strings

Name Preview Code Difficulty
Strings Learn how to input and output strings. C++ Easy
StringStream Learn how to use stringstreams. C++ Easy
Attribute Parser Parse the values within various tags. C++ Medium

Classes

Name Preview Code Difficulty
Structs Learn how to create and use structures. C++ Easy
Class Learn how to create and use classes. C++ Easy
Classes and Objects Familiarize yourself with classes and objects. C++ Easy
Box It! Design a class named Box with overloaded operators. C++ Easy
Inherited Code Handle errors that can occur in the existing code. C++ Medium
Exceptional Server Handle server errors. C++ Medium
Virtual Functions Learn how to use virtual functions and solve the given problem. C++ Medium
Abstract Classes - Polymorphism Given an abstract class Cache, write a class LRUCache which extends the class Cache and implement an LRU cache. C++ Hard

STL

Name Preview Code Difficulty
Vector-Sort Learn about the container vector. Sort a vector and print the sorted vector. C++ Easy
Vector-Erase Erasing an element from a vector. C++ Easy
Lower Bound-STL Given N numbers, you have to find the smallest integer greater than the given number and print the index of that number. C++ Easy
Sets-STL Learn about the set container. Given a problem with 3 queries, try to answer the queries using the set container. C++ Easy
Maps-STL Learn to use map container. Given some queries, add the marks to a corresponding student, delete a student and print the marks of a particular student. C++ Easy
Print Pretty This challenge will test your knowledge of the STL library. C++ Easy
Deque-STL Learn to use deque container. Find the maximum number in each and every contiguous sub array of size K in the given array. C++ Medium

Inheritance

Name Preview Code Difficulty
Inheritance Introduction Learn how to inherit classes from other classes. C++ Easy
Rectangle Area Find out the area of a rectangle. You are given the objects to the class and you have to implement these classes. C++ Easy
Multi Level Inheritance Learn what multiple inheritance is and try to solve this problem. C++ Easy
Accessing Inherited Functions Access inherited functions with the same name. C++ Medium
Magic Spells Identify the correct kind of spell and possibly compare it with your spell journal. C++ Hard

Debugging

Name Preview Code Difficulty
Hotel Prices Debug the existing class definitions so the total hotel’s profit is calculated correctly. C++ Medium
Cpp exception handling Handle possible exceptions in a correct way. C++ Medium
Overloading Ostream Operator Overload the « operator for Person class. C++ Medium
Messages Order Implement a software layer over the top of a network, such that sent messages are printed by the recipient in the order they were sent. C++ Medium

Other Concepts

Name Preview Code Difficulty
C++ Class Templates Learn to use class templates. You are given a problem, solve that using class templates. C++ Easy
Preprocessor Solution Create preprocessor macros to make the existing code work. C++ Easy
Operator Overloading Learn how to overload operators. Print the sum of two matrices and print the resultant matrix. C++ Medium
Overload Operators Operator Overloading in C++. C++ Easy
Attending Workshops Define a structure for the workshop and find the number of workshops that the student can attend. C++ Medium
C++ Class Template Specialization Class templates in C++ create specializations for certain types. These can be used when difficult to provide a generic implementation. C++ Medium
C++ Variadics Create a function that takes an arbitrary number of binary digits as template parameters in reverse order and returns the value. C++ Hard
Bit Array Calculate the number of distinct integers created from the given code. C++ Hard