Deserialization

Medium Design Patterns & Final Challenges
Solve in Playground →

Problem Statement

Create a static method `User deserialize(std::string data)` that reads a string like `”101,Alice”`, parses the integer and string, and returns a reconstructed `User` object. Read a serialized string from input, deserialize it into an object, and print ‘Deserialized: [id] [name]’.

Input Format

A comma-separated string.

Output Format

Print the deserialized object properties.

Constraints

Format is always id,name.

Sample Input

101,Alice

Sample Output

Deserialized: 101 Alice

Explanation

Deserialization is the reverse process, parsing flat strings or bytes back into structured OOP memory objects.

Starter Code

#include <iostream>
#include <string>
#include <sstream>

class User {
public:
    int id;
    std::string name;
    User(int i, std::string n) : id(i), name(n) {}
    
    // Implement static deserialize() here
};

int main() {
    // Read string, deserialize, and print
    return 0;
}

Limits

  • Time Limit: 1s
  • Memory Limit: 256MB

Embedded C Programming

Updated: March 15, 2026
Intermediate

Embedded systems rely on efficient low-level programming to interact directly with hardware. In this course, you will learn how to write practical Embedded C programs used in real microcontroller-based systems. Rather than focusing only on theory, this course follows a practice-driven approach. Each lesson includes hands-on coding exercises that simulate real firmware development tasks used