Sobes.tech

Embedded / IoT

Are there any questions about the Bizon company?

Middle+
209

// What will the following code output and why? package main import "fmt" type Person struct { Name string } func changeName(person *Person) { person = &Person{ Name: "Alice", } } func main() { person := &Person{ Name: "Bob", } fmt.Println(person.Name) changeName(person) fmt.Println(person.Name) }

209

Tell about your work experience — who you are, where you worked, what you did?

208

import javax.xml.bind.annotation.XmlAccessType; import javax.xml.bind.annotation.XmlAccessorType; import javax.xml.bind.annotation.XmlType; import java.io.*; @XmlAccessorType(XmlAccessType.PROPERTY) @XmlType(name = "Person", propOrder = { "name", "surname", "address", "phone", }) public class Person implements Serializable, Externalizable { private String name; private String surname; public String address; public String phone; public Person(String name, String surname) { this.name = name; this.surname = surname; } public String getName() { return name; } public String getSurname() { return surname; } @Override public int hashCode() { return 1; } @Override public boolean equals(Object o) { if (this == o) { return true; } if (o == null || getClass() != o.getClass()) { return false; } Person person = (Person) o; if (name != null ? !name.equals(person.name) : person.name != null) { return false; } if (surname != null ? !surname.equals(person.surname) : person.surname != null) { return false; } return true; } @Override public void writeExternal(ObjectOutput out) throws IOException { out.writeObject(name); out.writeObject(surname); out.writeObject(phone); out.writeObject(address); } @Override public void readExternal(ObjectInput in) throws IOException, ClassNotFoundException { name = (String) in.readObject(); surname = (String) in.readObject(); address = (String) in.readObject(); phone = (String) in.readObject(); } }

208

// ... some code here? private static List<DocumentProvider> getDocumentProviders() { Reflections reflections = new Reflections(Main.class.getProtectionDomain().getCodeSource().getLocation()); Set<Class<?>> subTypes = reflections.get(SubTypes.of(DocumentProvider.class).asClass()); return subTypes.stream().map(subType -> { try { return (DocumentProvider) subType.getConstructor().newInstance(); } catch (Exception ex) { throw new RuntimeException(ex); } }).collect(Collectors.toList()); }

207

What is a reverse proxy and how can it be implemented?

Intern
207

In a topic with 6 partitions, 6 more were added. The key is — userID. Will a message with the same key go to the same partition?

207

How long will the execution take after optimization? Does it depend on the number of processor threads (GOMAXPROCS)?

206

Explain the logic behind the occurrence of duplicates — the mechanics of the process, where exactly the problem arose during event processing?

203
/9